changeset 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 d10efbe2e5c0
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java
diffstat 2 files changed, 35 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Aug 25 10:42:23 2011 +0000
+++ b/flys-artifacts/ChangeLog	Thu Aug 25 10:45:12 2011 +0000
@@ -1,3 +1,18 @@
+2011-08-25  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+	Added MainValue-Fetching-Capabilities to MainValuesArtifact.
+
+	* src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java
+	  (initialize, getMinValues):
+	  Let MainValuesArtifact return "real" MainValues, although ignorant of all
+	  parameterization.
+
+2011-08-25  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java
+	  (MainValueFacet):
+	  Improved and straightened implementation, added code-Annotations and Todos.
+
 2011-08-25  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java
--- 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();
     }
 
 

http://dive4elements.wald.intevation.org