[Dive4elements-commits] [PATCH 3 of 4] WaterlevelFacet: Deal with ExtremeResult if it is embedded in CalculationResult (instead of WQKms)

Wald Commits scm-commit at wald.intevation.org
Mon Oct 29 13:44:06 CET 2012


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1351514854 -3600
# Node ID d65cf8e40230ff551b91c1dd129ebeb9e91b0a56
# Parent  ce10b846bc86696523953bc020bbe21a3b1ea860
WaterlevelFacet: Deal with ExtremeResult if it is embedded in CalculationResult (instead of WQKms).

diff -r ce10b846bc86 -r d65cf8e40230 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WaterlevelFacet.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WaterlevelFacet.java	Mon Oct 29 13:46:39 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WaterlevelFacet.java	Mon Oct 29 13:47:34 2012 +0100
@@ -6,6 +6,7 @@
 import de.intevation.flys.artifacts.FLYSArtifact;
 import de.intevation.flys.artifacts.math.Linear;
 import de.intevation.flys.artifacts.states.DefaultState.ComputeType;
+import de.intevation.flys.artifacts.model.extreme.ExtremeResult;
 
 import org.apache.log4j.Logger;
 
@@ -35,7 +36,9 @@
     }
 
     protected WQKms [] getWQKms(CalculationResult res) {
-        return (WQKms [])res.getData();
+        if (res.getData() instanceof ExtremeResult)
+            return ((ExtremeResult) res.getData()).getWQKms();
+        return (WQKms []) res.getData();
     }
 
     /**


More information about the Dive4elements-commits mailing list