changeset 2062:ed6c6d437875

Added min/max values for free Qs to the Artifact's DESCRIBE document. flys-artifacts/trunk@3555 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 29 Dec 2011 14:21:52 +0000
parents 87f9153bb7ca
children 97a25b54eea3
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java
diffstat 2 files changed, 41 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Dec 28 12:46:56 2011 +0000
+++ b/flys-artifacts/ChangeLog	Thu Dec 29 14:21:52 2011 +0000
@@ -1,3 +1,8 @@
+2011-12-29  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/states/WQSelect.java: Write
+	  min/max values for free Qs into Artifact's DESCRIBE document.
+
 2011-12-28  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/states/WQSelect.java: Fixed
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java	Wed Dec 28 12:46:56 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java	Thu Dec 29 14:21:52 2011 +0000
@@ -220,23 +220,39 @@
         String      name,
         CallContext context)
     {
-        // TODO Insert correct min/max values!
-        double[] minmaxW = determineMinMaxW(artifact);
-        double[] minmaxQ = determineMinMaxQAtGauge(artifact);
+        double[] minmaxW     = determineMinMaxW(artifact);
+        double[] minmaxQ     = determineMinMaxQAtGauge(artifact);
+        double[] minmaxQFree = determineMinMaxQ(artifact);
 
         if (name.equals("wq_from")) {
-            Element minW = createItem(
-                cr, new String[] {"minW", new Double(minmaxW[0]).toString()});
-            Element minQ = createItem(
-                cr, new String[] {"minQ", new Double(minmaxQ[0]).toString()});
-            return new Element[] { minW, minQ };
+            Element minW = createItem(cr, new String[] {
+                "minW",
+                String.valueOf(minmaxW[0])});
+
+            Element minQ = createItem(cr, new String[] {
+                "minQ",
+                String.valueOf(minmaxQ[0])});
+
+            Element minQFree = createItem(cr, new String[] {
+                "minQFree",
+                String.valueOf(minmaxQFree[0])});
+
+            return new Element[] { minW, minQ, minQFree };
         }
         else if (name.equals("wq_to")) {
-            Element maxW = createItem(
-                cr, new String[] {"maxW", new Double(minmaxW[1]).toString()});
-            Element maxQ = createItem(
-                cr, new String[] {"maxQ", new Double(minmaxQ[1]).toString()});
-            return new Element[] { maxW, maxQ };
+            Element maxW = createItem(cr, new String[] {
+                "maxW",
+                String.valueOf(minmaxW[1])});
+
+            Element maxQ = createItem(cr, new String[] {
+                "maxQ",
+                String.valueOf(minmaxQ[1])});
+
+            Element maxQFree = createItem(cr, new String[] {
+                "maxQFree",
+                String.valueOf(minmaxQFree[1])});
+
+            return new Element[] { maxW, maxQ, maxQFree };
         }
         else {
             Element stepW = createItem(
@@ -246,8 +262,13 @@
             Element stepQ = createItem(
                 cr, new String[] {
                     "stepQ",
-                    String.valueOf(getStepsW(minmaxQ[0], minmaxQ[1]))});
-            return new Element[] { stepW, stepQ };
+                    String.valueOf(getStepsQ(minmaxQ[0], minmaxQ[1]))});
+            Element stepQFree = createItem(
+                cr, new String[] {
+                    "stepQFree",
+                    String.valueOf(getStepsQ(minmaxQFree[0], minmaxQFree[1]))});
+
+            return new Element[] { stepW, stepQ, stepQFree };
         }
     }
 

http://dive4elements.wald.intevation.org