changeset 1640:fb296bdf815f

Improved w-differences diagram generation with included 'absolute' values. flys-artifacts/trunk@2825 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 26 Sep 2011 13:37:30 +0000
parents 12235a2ace21
children eb3ab28d1c21
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java
diffstat 2 files changed, 28 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Sep 26 13:17:55 2011 +0000
+++ b/flys-artifacts/ChangeLog	Mon Sep 26 13:37:30 2011 +0000
@@ -1,3 +1,13 @@
+2011-09-26  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+ Improved w-differences diagram generation with included "absolute"
+ values.
+
+	* src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java:
+	  Fixed one (of two) incorrect labels.
+	  (doWaterlevelOut): Survive non-found gauge, fetch kilometer and w
+	  instead of values for w and q.
+
 2011-09-26  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
  Add positional-conflict-awareness when merging Facets for a
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java	Mon Sep 26 13:17:55 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java	Mon Sep 26 13:37:30 2011 +0000
@@ -18,10 +18,8 @@
 import de.intevation.flys.artifacts.model.WKms;
 
 import de.intevation.flys.utils.DataUtil;
-import de.intevation.flys.model.DischargeTable;
 import de.intevation.flys.model.Gauge;
 import de.intevation.flys.model.River;
-import de.intevation.flys.model.TimeInterval;
 
 import de.intevation.flys.artifacts.WINFOArtifact;
 
@@ -53,7 +51,7 @@
     // TODO proper i18n.
     public static final String I18N_CHART_TITLE_DEFAULT  = "W-Differenzen";
     public static final String I18N_XAXIS_LABEL_DEFAULT  = "km";
-    public static final String I18N_YAXIS_LABEL_DEFAULT  = "W [NN + m]";
+    public static final String I18N_YAXIS_LABEL_DEFAULT  = "W [m]";
 
 
     /**
@@ -104,34 +102,44 @@
     }
 
 
+    /**
+     * Add the waterlevel-curves (the "absolutes" from which
+     * differences were calculated).
+     * @param wqkms The wqkms to add to the diagram.
+     */
     public void doWaterlevelOut(WQKms wqkms,
          String description,
          Document theme,
          WINFOArtifact flysArtifact) {
-        String gaugeName = wqkms.getName();
+        String wqkmsName = wqkms.getName();
 
         River river = FLYSUtils.getRiver(flysArtifact);
 
         if (river == null) {
-            logger.debug("no river found");
+            logger.warn("no river found");
             return;
         }
 
-        Gauge gauge = river.determineGaugeByName(gaugeName);
+        logger.debug("WDifferencesCurveGenerator.doWaterlevelOut, gauge: " +
+            wqkmsName);
+        /*
+        Gauge gauge = river.determineGaugeByName(wqkmsName);
 
         if (gauge == null) {
-            logger.debug("no gauge found");
+            logger.warn("no gauge found");
             return;
         }
+        */
 
-        String seriesName = "(tbd)Source for Diff.";
-        //getSeriesName(gauge);
 
         double [][] values = new double [][] {
-            wqkms.getQs(), wqkms.getWs() };
+            wqkms.getKms(), wqkms.getWs() };
 
         int size = values != null ? values[0].length : 0;
 
+        String seriesName = wqkmsName;
+        //getSeriesName(gauge);
+
         XYSeries series = new StyledXYSeries(seriesName, theme);
 
         for (int i = 0; i < size; i++) {

http://dive4elements.wald.intevation.org