changeset 2765:79f6d0802b06

Prepare improved Discharge curve compatibility. flys-artifacts/trunk@4504 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 24 May 2012 13:39:59 +0000
parents f8a1a8af338e
children 7dc4681a2bed
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java
diffstat 3 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu May 24 10:45:12 2012 +0000
+++ b/flys-artifacts/ChangeLog	Thu May 24 13:39:59 2012 +0000
@@ -1,3 +1,11 @@
+2012-05-24	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java
+	  (getWaterlevelData): Exception for discharge case.
+
+	* src/main/java/de/intevation/flys/utils/FLYSUtils.java
+	  (getLocations): Exception for discharge case.
+
 2012-05-24  Raimund Renkert <raimund.renkert@intevation.de>
 
 	Issue 667.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Thu May 24 10:45:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Thu May 24 13:39:59 2012 +0000
@@ -318,6 +318,10 @@
     {
         logger.debug("WINFOArtifact.getWaterlevelData");
 
+        if (getDataAsString("calculation_mode").equals("calc.discharge.longitudinal.section")) {
+            return getDischargeLongitudinalSectionData();
+        }
+
         River river = FLYSUtils.getRiver(this);
         if (river == null) {
             return error(new WQKms[0], "no.river.selected");
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java	Thu May 24 10:45:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/FLYSUtils.java	Thu May 24 13:39:59 2012 +0000
@@ -317,6 +317,16 @@
         String locationStr = flys.getDataAsString("ld_locations");
 
         if (locationStr == null || locationStr.length() == 0) {
+            if (flys instanceof WINFOArtifact) {
+                WINFOArtifact winfo = (WINFOArtifact) flys;
+                if (winfo.getReferenceStartKm() != null) {
+                    return new double[]
+                        {
+                            winfo.getReferenceStartKm().doubleValue(),
+                            winfo.getReferenceEndKms()[0]
+                        };
+                }
+            }
             return null;
         }
 

http://dive4elements.wald.intevation.org