changeset 4919:dbe9b7d6b80b

Find correct discharge table for gauge.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 30 Jan 2013 18:56:57 +0100
parents 65778fd0d0fd
children 80ff4abcdbf0
files flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/GaugeDischargeCurveFacet.java
diffstat 2 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);
--- 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) {

http://dive4elements.wald.intevation.org