# HG changeset patch # User Sascha L. Teichmann # Date 1327917479 0 # Node ID 4e3bfa2d9584f98af9cb857f445a237efde0ee49 # Parent 575ed0248be2d2b85564520c12e0009dcc9af872 "Bezugslinienverfahren": Add start and end km to WW to determine if kms are at gauges. flys-artifacts/trunk@3819 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 575ed0248be2 -r 4e3bfa2d9584 flys-artifacts/ChangeLog --- 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 + + * 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 * doc/conf/artifacts/winfo.xml: Added transitions for "historical discharge diff -r 575ed0248be2 -r 4e3bfa2d9584 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation5.java --- 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(); diff -r 575ed0248be2 -r 4e3bfa2d9584 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WW.java --- 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 });