[Dive4elements-commits] [PATCH 08 of 10] FixWQCurveGenerator: Render fix events

Wald Commits scm-commit at wald.intevation.org
Tue Apr 16 16:17:25 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1366109034 -7200
# Node ID 0152d639d7a7f5f091a65260906671ec9b4dc2da
# Parent  4ce126aa130c60fc88f484d3a44172ef93c451bb
FixWQCurveGenerator: Render fix events.

diff -r 4ce126aa130c -r 0152d639d7a7 flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java	Tue Apr 16 12:42:54 2013 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java	Tue Apr 16 12:43:54 2013 +0200
@@ -130,6 +130,9 @@
         else if(QSECTOR.equals(name)) {
             doQSectorOut(aaf, doc, visible);
         }
+        else if(FIX_EVENTS.equals(name)) {
+            doEventsOut(aaf, doc, visible);
+        }
         else if(/*STATIC_WKMS_INTERPOL.equals(name) ||*/
                 STATIC_WKMS_MARKS.equals(name) ||
                 STATIC_WKMS.equals(name) ||
@@ -244,6 +247,21 @@
         }
     }
 
+    protected void doEventsOut(ArtifactAndFacet aaf, Document doc, boolean visible) {
+        logger.debug("doEventsOut");
+        // Find W/Q at km.
+        XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), doc);
+        Double ckm = (Double) context.getContextValue(CURRENT_KM);
+        WQKms wqkms = (WQKms) aaf.getData(context);
+        double[] kms = wqkms.getKms();
+        for (int i = 0 ; i< kms.length; i++) {
+            if (Math.abs(kms[i] - ckm) <= 0.01d) {
+                series.add(wqkms.getQ(i), wqkms.getW(i));
+                addAxisSeries(series, YAXIS.W.idx, visible);
+                return;
+            }
+        }
+    }
 
     protected void doWQCurveOut(ArtifactAndFacet aaf, Document doc, boolean visible) {
         logger.debug("doWQCurveOut");


More information about the Dive4elements-commits mailing list