changeset 6897:34c04d877149

DischargeProcessor: Minor refactoring (use getter), warn when no αΊ€/Q data found.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 22 Aug 2013 14:23:41 +0200
parents 84b1e87e8669
children ebe7dfffacc4
files artifacts/src/main/java/org/dive4elements/river/exports/process/DischargeProcessor.java
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 :

http://dive4elements.wald.intevation.org