[Dive4elements-commits] [PATCH] Find correct discharge table for gauge
Wald Commits
scm-commit at wald.intevation.org
Wed Jan 30 18:57:39 CET 2013
# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1359568617 -3600
# Node ID dbe9b7d6b80bf6b1bfea93a8a77888eb51dc6074
# Parent 65778fd0d0fdcc94646cec7c0b99d19edb5fa890
Find correct discharge table for gauge.
diff -r 65778fd0d0fd -r dbe9b7d6b80b flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java Wed Jan 30 16:11:08 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java Wed Jan 30 18:56:57 2013 +0100
@@ -129,8 +129,16 @@
}
// TODO: Filter by time interval
- DischargeTable table = tables.get(0);
-
+ DischargeTable table = null;
+ for (DischargeTable dt : tables) {
+ if (dt.getKind() == 0) {
+ table = dt;
+ break;
+ }
+ }
+ if (table == null) {
+ table = tables.get(0);
+ }
double [][] vs = loadDischargeTableValues(table, scale);
values.put(gaugeName, vs);
diff -r 65778fd0d0fd -r dbe9b7d6b80b flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/GaugeDischargeCurveFacet.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/GaugeDischargeCurveFacet.java Wed Jan 30 16:11:08 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/GaugeDischargeCurveFacet.java Wed Jan 30 18:56:57 2013 +0100
@@ -60,7 +60,7 @@
DischargeTables dt = new DischargeTables(river, name);
Map<String, double [][]> map = dt.getValues(
- DischargeTables.HISTORICAL_SCALE);
+ DischargeTables.MASTER_SCALE);
double [][] values = map.get(name);
if (values == null) {
More information about the Dive4elements-commits
mailing list