changeset 2618:3a93bbbe2ec7

Fix for 'W free' validation and theme names. flys-artifacts/trunk@4203 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 05 Apr 2012 15:29:25 +0000
parents 71086a3a1c5f
children 6ed24efc80de
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelState.java
diffstat 3 files changed, 21 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Apr 05 08:51:53 2012 +0000
+++ b/flys-artifacts/ChangeLog	Thu Apr 05 15:29:25 2012 +0000
@@ -1,3 +1,15 @@
+2012-04-05  Raimund Renkert <raimund.renkert@intevation.de>
+
+	Fix for 'W free' validation and theme names.
+
+	* src/main/java/de/intevation/flys/artifacts/states/WaterlevelState.java:
+	  Append the current Q values to theme name if the previous theme has
+	  the same name.
+
+	* src/main/java/de/intevation/flys/artifacts/states/WQSelect.java:
+	  Use the start km to get min/max W values in distance mode and use the
+	  first km to get min/max W values if in location mode.
+
 2012-04-05  Raimund Renkert <raimund.renkert@intevation.de>
 
 	Issue 499.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java	Thu Apr 05 08:51:53 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java	Thu Apr 05 15:29:25 2012 +0000
@@ -419,20 +419,12 @@
             double[] km = null;
             if(winfo.isRange()) {
                 km = winfo.getFromToStep();
-                minmaxW = valueTable.getMinMaxW(km[0], km[1], km[2]);
+                // Use the start km to determine the min max values.
+                minmaxW = valueTable.getMinMaxW(km[0]);
             }
             else {
                 km = winfo.getKms();
                 minmaxW = valueTable.getMinMaxW(km[0]);
-                for (int i = 1; i < km.length; i++) {
-                    double[] tmp = valueTable.getMinMaxW(km[i]);
-                    if(tmp[0] < minmaxW[0]) {
-                        minmaxW[0] = tmp[0];
-                    }
-                    if(tmp[1] > minmaxW[1]) {
-                        minmaxW[1] = tmp[1];
-                    }
-                }
             }
         }
         return minmaxW != null
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelState.java	Thu Apr 05 08:51:53 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelState.java	Thu Apr 05 15:29:25 2012 +0000
@@ -71,6 +71,13 @@
             String nameW = FLYSUtils.createWspWTitle(winfo, cc, name);
             String nameQ = FLYSUtils.createWspQTitle(winfo, cc, name);
 
+            // Hotfix for theme names. Themes with the same name cause problems
+            // aggregating chart legend items.
+            if (i > 0 && name.equals(wqkms[i - 1].getName())) {
+                nameW += "; Q=" + wqkms[i].get(0, new double[3])[1];
+                nameQ += " = " + wqkms[i].get(0, new double[3])[1];
+            }
+
             if (debug) {
                 logger.debug("Create facet: " + nameW);
                 logger.debug("Create facet: " + nameQ);

http://dive4elements.wald.intevation.org