[PATCH 1 of 5] DischargeProcessor: Minor refactoring (use getter), warn when no Ẁ/Q data found

Wald Commits scm-commit at wald.intevation.org
Thu Aug 22 14:23:43 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1377174221 -7200
# Node ID 34c04d8771492326bae58635627fad410c21abe2
# Parent  84b1e87e86692db4202c5d68e0c521185ef0f9d2
DischargeProcessor: Minor refactoring (use getter), warn when no Ẁ/Q data found.

diff -r 84b1e87e8669 -r 34c04d877149 artifacts/src/main/java/org/dive4elements/river/exports/process/DischargeProcessor.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/DischargeProcessor.java	Wed Aug 21 17:15:06 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/DischargeProcessor.java	Thu Aug 22 14:23:41 2013 +0200
@@ -80,6 +80,12 @@
     }
 
 
+    /** The station of the current calculation/view. */
+    protected double getKm() {
+        return km;
+    }
+
+
     /** Handle WQKms data by finding w/q values at given km. */
     protected void doWQKmsPointOut(XYChartGenerator generator,
         WQKms wqkms,
@@ -96,7 +102,7 @@
         double[] kms = wqkms.getKms();
 
         for (int i = 0 ; i< kms.length; i++) {
-            if (Math.abs(kms[i] - km) <= KM_EPSILON) {
+            if (Math.abs(kms[i] - getKm()) <= KM_EPSILON) {
                 series.add(wqkms.getQ(i), wqkms.getW(i));
                 generator.addAxisSeries(series, axidx, visible);
                 if(visible && ThemeUtil.parseShowPointLabel(theme)) {
@@ -114,6 +120,8 @@
                 return;
             }
         }
+
+        logger.warn("No WQ found for km " + getKm());
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :


More information about the Dive4elements-commits mailing list