Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java @ 1080:fa01c3602f66
Added MainValue-Fetching-Capabilities to MainValuesArtifact.
flys-artifacts/trunk@2577 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 25 Aug 2011 10:45:12 +0000 |
parents | ef756e166154 |
children | 07878836ee0d |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java Thu Aug 25 10:42:23 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java Thu Aug 25 10:45:12 2011 +0000 @@ -64,6 +64,20 @@ { logger.debug("MainValuesArtifact.setup"); super.setup(identifier, factory, context, callMeta, data); + // TODO in initialize(*), access master/winfo artifact, + // get locations and river. + } + + + @Override + protected void initialize(Artifact artifact, Object context, CallMeta meta) { + logger.debug("MainValuesArtifact.initialize"); + WINFOArtifact winfo = (WINFOArtifact) artifact; + River river = winfo.getRiver(); + double location = winfo.getLocations()[0]; // Ort der Abflusskurve + + logger.error("Location: " + location); + Gauge gauge = river.determineGaugeByPosition(location); } @@ -135,8 +149,12 @@ } - state.getOutputs().add(mainValuesOutput); - return state; + public List getMainValues() { + River river = RiverFactory.getRiver("Saar"); + logger.warn("Go to river " + river); + double location = 5.0f; + Gauge gauge = river.determineGaugeByPosition(location); + return gauge.getMainValues(); }