[PATCH 3 of 9] Handle flow velocity discharge in the new part of the QOutProcessor

Wald Commits scm-commit at wald.intevation.org
Thu Sep 26 12:57:01 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1380184741 -7200
# Node ID 704a33c0f5a29a6e6b169a28f46bd3912fe9c541
# Parent  4683bdf77ff9551649e28058694e623c212ddc8a
Handle flow velocity discharge in the new part of the QOutProcessor

diff -r 4683bdf77ff9 -r 704a33c0f5a2 artifacts/src/main/java/org/dive4elements/river/exports/process/QOutProcessor.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/QOutProcessor.java	Thu Sep 26 10:38:21 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/QOutProcessor.java	Thu Sep 26 10:39:01 2013 +0200
@@ -15,6 +15,7 @@
 import org.dive4elements.artifacts.CallContext;
 import org.dive4elements.river.artifacts.model.FacetTypes;
 import org.dive4elements.river.artifacts.model.WQKms;
+import org.dive4elements.river.artifacts.model.FlowVelocityData;
 
 import org.dive4elements.river.exports.StyledSeriesBuilder;
 import org.dive4elements.river.exports.XYChartGenerator;
@@ -46,16 +47,19 @@
             ThemeDocument    theme,
             boolean          visible) {
         CallContext context = generator.getCallContext();
-        WQKms wqkms = (WQKms) bundle.getData(context);
+        Object data = bundle.getData(context);
+        XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme);
+        String facetName = bundle.getFacetName();
 
-        XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), theme);
-
-        StyledSeriesBuilder.addStepPointsKmQ(series, wqkms);
+        if (facetName.equals(FacetTypes.FLOW_VELOCITY_DISCHARGE)) {
+            FlowVelocityData fData = (FlowVelocityData) data;
+            StyledSeriesBuilder.addPoints(series, fData.getQPoints(), true);
+        } else {
+            WQKms wqkms = (WQKms) data;
+            StyledSeriesBuilder.addStepPointsKmQ(series, wqkms);
+        }
 
         generator.addAxisSeries(series, axisName, visible);
-
-        /* Check if the diagram should be inverted*/
-        generator.setInverted(wqkms.guessRTLData());
     }
 
     @Override
@@ -96,7 +100,8 @@
 
         if (facetType.equals(FacetTypes.STATIC_WQKMS_Q)
             || facetType.equals(FacetTypes.LONGITUDINAL_Q)
-            || facetType.startsWith(FacetTypes.DISCHARGE_LONGITUDINAL_Q)) {
+            || facetType.startsWith(FacetTypes.DISCHARGE_LONGITUDINAL_Q)
+            || facetType.startsWith(FacetTypes.FLOW_VELOCITY_DISCHARGE)) {
             return true;
         }
         return false;


More information about the Dive4elements-commits mailing list