diff flys-artifacts/src/main/java/de/intevation/flys/exports/HistoricalDischargeCurveExporter.java @ 4241:49cb65d5932d

Improved the historical discharge calculation. The calculation now creates new HistoricalWQKms (new subclass of WQKms). Those WQKms are used to create new facets from (new) type 'HistoricalDischargeCurveFacet'. The chart generator is improved to support those facets.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 24 Oct 2012 14:34:35 +0200
parents 810db532803a
children 420c553bc86d
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/HistoricalDischargeCurveExporter.java	Wed Oct 24 14:35:59 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/HistoricalDischargeCurveExporter.java	Wed Oct 24 14:34:35 2012 +0200
@@ -28,6 +28,7 @@
 
 import de.intevation.flys.artifacts.FLYSArtifact;
 import de.intevation.flys.artifacts.model.CalculationResult;
+import de.intevation.flys.artifacts.model.HistoricalDischargeData;
 import de.intevation.flys.artifacts.model.Timerange;
 import de.intevation.flys.artifacts.model.WQTimerange;
 import de.intevation.flys.artifacts.model.WQTJRDataSource;
@@ -85,9 +86,13 @@
 
             logger.debug("Internal data of CalculationResult: " + d.getClass());
 
-            if (d instanceof WQTimerange[]) {
-                logger.debug("Add new data of type WQTimerange");
-                data.add((WQTimerange[]) d);
+            if (d instanceof HistoricalDischargeData) {
+                d = (WQTimerange[]) ((HistoricalDischargeData) d).getWQTimeranges();
+
+                if (d instanceof WQTimerange[]) {
+                    logger.debug("Add new data of type WQTimerange");
+                    data.add((WQTimerange[]) d);
+                }
             }
         }
     }

http://dive4elements.wald.intevation.org