[PATCH 8 of 9] Process corrected WQkms (WQCKms) also in the WOutProcessor

Wald Commits scm-commit at wald.intevation.org
Tue Sep 24 11:44:05 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1380015724 -7200
# Branch generator-refactoring
# Node ID 099f9faf5bf9c3b8d488a4a203f1e8e78ec0bcc0
# Parent  7b88b87958ac5c212210ca71965f9e9fdfd37396
Process corrected WQkms (WQCKms) also in the WOutProcessor

diff -r 7b88b87958ac -r 099f9faf5bf9 artifacts/src/main/java/org/dive4elements/river/exports/process/WOutProcessor.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/WOutProcessor.java	Tue Sep 24 11:40:43 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/WOutProcessor.java	Tue Sep 24 11:42:04 2013 +0200
@@ -16,6 +16,7 @@
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.model.FacetTypes;
 import org.dive4elements.river.artifacts.model.WKms;
+import org.dive4elements.river.artifacts.model.WQCKms;
 import org.dive4elements.river.exports.StyledSeriesBuilder;
 import org.dive4elements.river.exports.XYChartGenerator;
 import org.dive4elements.river.exports.DiagramGenerator;
@@ -47,13 +48,23 @@
             ThemeDocument    theme,
             boolean          visible) {
         CallContext context = generator.getCallContext();
-        WKms wkms = (WKms) bundle.getData(context);
+        Object data = bundle.getData(context);
+        WKms wkms = (WKms) data;
 
-        logger.debug("doOut");
+        logger.debug("Processing facet: " + bundle.getFacetName());
 
         XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme);
 
-        StyledSeriesBuilder.addPoints(series, wkms);
+        if (bundle.getFacetName().equals(FacetTypes.DISCHARGE_LONGITUDINAL_C)) {
+            // Add corrected values
+            WQCKms wqckms = (WQCKms) data;
+            int size = wqckms.size();
+            for (int i = 0; i < size; i++) {
+                series.add(wqckms.getKm(i), wqckms.getC(i), false);
+            }
+        } else {
+            StyledSeriesBuilder.addPoints(series, wkms);
+        }
         generator.addAxisSeries(series, axisName, visible);
 
         // If a "band around the curve shall be drawn, add according area.
@@ -75,9 +86,11 @@
 
         if (bundle.getFacetName().equals(FacetTypes.LONGITUDINAL_W) ||
             bundle.getFacetName().equals(FacetTypes.DISCHARGE_LONGITUDINAL_W) ||
-            bundle.getFacetName().equals(FacetTypes.STATIC_WQKMS_W)) {
+            bundle.getFacetName().equals(FacetTypes.STATIC_WQKMS_W) ||
+            bundle.getFacetName().equals(FacetTypes.DISCHARGE_LONGITUDINAL_C)) {
             /* Only use W values to check if the diagram should be inverted
              * see flys/issue1290 for details */
+            logger.debug("Check for RTL data: "+ wkms.guessRTLData());
             generator.setInverted(wkms.guessRTLData());
         }
     }


More information about the Dive4elements-commits mailing list