changeset 2201:4e3bfa2d9584

"Bezugslinienverfahren": Add start and end km to WW to determine if kms are at gauges. flys-artifacts/trunk@3819 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 30 Jan 2012 09:57:59 +0000
parents 575ed0248be2
children d1660809daab
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation5.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WW.java
diffstat 3 files changed, 46 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Jan 30 09:03:12 2012 +0000
+++ b/flys-artifacts/ChangeLog	Mon Jan 30 09:57:59 2012 +0000
@@ -1,3 +1,14 @@
+2012-01-28	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/WW.java:
+	  Added field 'startKm' and 'endKm' to make it easier to associate
+	  gauge to km to return Ws in cm if km is at a gauge.
+
+	* src/main/java/de/intevation/flys/artifacts/model/Calculation5.java:
+	  Construct the WWs with startKm and endKm. This is necessary because
+	  if an error occurs in calcuting an in between km in a list of end kms
+	  the index does not correspond to the input value any more. 
+
 2012-01-30  Ingo Weinzierl <ingo@intevation.de>
 
 	* doc/conf/artifacts/winfo.xml: Added transitions for "historical discharge
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation5.java	Mon Jan 30 09:03:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation5.java	Mon Jan 30 09:57:59 2012 +0000
@@ -32,7 +32,10 @@
             int newNumProblems = numProblems();
 
             if (wws.length == 2) {
-                WW ww = new WW(generateName(startKm, endKm), wws[0], wws[1]);
+                WW ww = new WW(
+                    generateName(startKm, endKm),
+                    startKm, wws[0],
+                    endKm,   wws[1]);
 
                 if (newNumProblems > numProblems) {
                     ww.removeNaNs();
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WW.java	Mon Jan 30 09:03:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WW.java	Mon Jan 30 09:57:59 2012 +0000
@@ -49,6 +49,9 @@
 
     protected TDoubleArrayList ws2;
 
+    protected double startKm;
+    protected double endKm;
+
     public WW() {
     }
 
@@ -65,10 +68,18 @@
         ws2 = new TDoubleArrayList(capacity);
     }
 
-    public WW(String name, double [] ws, double [] ws2) {
-        this.name = name;
-        this.ws  = new TDoubleArrayList(ws);
-        this.ws2 = new TDoubleArrayList(ws2);
+    public WW(
+        String    name, 
+        double    startKm, 
+        double [] ws, 
+        double    endKm,
+        double [] ws2
+    ) {
+        this.name    = name;
+        this.ws      = new TDoubleArrayList(ws);
+        this.ws2     = new TDoubleArrayList(ws2);
+        this.startKm = startKm;
+        this.endKm   = endKm;
     }
 
     public WW(String name, TDoubleArrayList ws, TDoubleArrayList ws2) {
@@ -102,6 +113,22 @@
         return dst;
     }
 
+    public double getStartKm() {
+        return startKm;
+    }
+
+    public void setStartKm(double startKm) {
+        this.startKm = startKm;
+    }
+
+    public double getEndKm() {
+        return endKm;
+    }
+
+    public void setEndKm(double endKm) {
+        this.endKm = endKm;
+    }
+
     @Override
     public void removeNaNs() {
         removeNaNs(new TDoubleArrayList [] { ws, ws2 });

http://dive4elements.wald.intevation.org