changeset 7259:a36e26abcf54

issue1490: Translate other points as well, when at gauge.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 08 Oct 2013 11:49:28 +0200
parents 0e6b399e72f9
children 0b32f8980fed
files artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java	Tue Oct 08 09:26:09 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java	Tue Oct 08 11:49:28 2013 +0200
@@ -646,17 +646,24 @@
         DateFormat dateFormat = DateFormat.getDateInstance(
                 DateFormat.SHORT);
 
+        double gaugeDatum = getCurrentGaugeDatum();
+        double factor = (gaugeDatum == 0d) ? 1d : 100d;
         for (QWI qw: qws) {
-            series.add(qw.getQ(), qw.getW(), false);
+            series.add(qw.getQ(), factor*(qw.getW()-gaugeDatum), false);
 
             XYTextAnnotation anno = new CollisionFreeXYTextAnnotation(
                     dateFormat.format(qw.getDate()),
                     qw.getQ(),
-                    qw.getW());
+                    factor*(qw.getW()-gaugeDatum));
             textAnnos.add(anno);
         }
 
-        addAxisSeries(series, YAXIS.W.idx, visible);
+        if (gaugeDatum == 0d) {
+            addAxisSeries(series, YAXIS.W.idx, visible);
+        }
+        else {
+            addAxisSeries(series, YAXIS.WCm.idx, visible);
+        }
         if (visible && theme.parseShowPointLabel()) {
             RiverAnnotation flysAnno =
                     new RiverAnnotation(null, null, null, theme);

http://dive4elements.wald.intevation.org