changeset 2304:abb390101595

#483 Display error message in calculation report for empty historical discharge calculations. flys-artifacts/trunk@3973 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 08 Feb 2012 15:50:25 +0000
parents da35b8a23ffb
children ff558d0332e2
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation6.java flys-artifacts/src/main/resources/messages.properties flys-artifacts/src/main/resources/messages_de.properties flys-artifacts/src/main/resources/messages_de_DE.properties flys-artifacts/src/main/resources/messages_en.properties
diffstat 6 files changed, 25 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Feb 08 15:31:24 2012 +0000
+++ b/flys-artifacts/ChangeLog	Wed Feb 08 15:50:25 2012 +0000
@@ -1,3 +1,17 @@
+2012-02-08  Ingo Weinzierl <ingo@intevation.de>
+
+	flys/issue483 (Historische Abflusstafeln ohne Ergebnis)
+
+	* src/main/java/de/intevation/flys/artifacts/model/Calculation6.java: Add
+	  a problem for the calculation report if no discharge tables were found
+	  for the given timerange.
+
+	* src/main/resources/messages.properties,
+	  src/main/resources/messages_de_DE.properties,
+	  src/main/resources/messages_en.properties,
+	  src/main/resources/messages_de.properties: Added translation for error
+	  messages created by Calculation6.
+
 2012-02-08	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	Fix flys/issue468 (Fehler beim Projekt-Duplizieren)
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation6.java	Wed Feb 08 15:31:24 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation6.java	Wed Feb 08 15:50:25 2012 +0000
@@ -49,7 +49,13 @@
 
         List<DischargeTable> dts = fetchDischargeTables(gauge);
 
-        logger.debug("Take " + dts.size() + " into account.");
+        int numTables = dts.size();
+
+        logger.debug("Take " + numTables + " into account.");
+
+        if (numTables == 0) {
+            addProblem("cannot.find.hist.q.tables");
+        }
 
         WQTimerange[] wqt = prepareCalculationData(dts);
 
--- a/flys-artifacts/src/main/resources/messages.properties	Wed Feb 08 15:31:24 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages.properties	Wed Feb 08 15:50:25 2012 +0000
@@ -178,6 +178,7 @@
 cannot.create.index.q.relation = Cannot create index/Q relation.
 relating.w.w.failed = Relating W with W failed.
 cannot.find.hist.q.for.w = Cannot find Q for W = {0,number,#.##} in timerange {1, date} - {2, date}
+cannot.find.hist.q.tables = Cannot find Discharge Tables for given timerange.
 
 no.river.selected = No river selected.
 no.gauge.selected = No gauge selected.
--- a/flys-artifacts/src/main/resources/messages_de.properties	Wed Feb 08 15:31:24 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_de.properties	Wed Feb 08 15:50:25 2012 +0000
@@ -178,6 +178,7 @@
 cannot.create.index.q.relation = Spaltenindex/Q-Beziehung konnte nicht erstellt werden.
 relating.w.w.failed = W-zu-W-Zuordnung fehlgeschlagen.
 cannot.find.hist.q.for.w = Konnte zu W = {0,number,#.##} im Zeitraum ({1,date} - {2,date}) kein Abfluss ermitteln.
+cannot.find.hist.q.tables = Konnte f\u00fcr den angegebenen Zeitraum keine Abflusstafeln finden.
 
 no.river.selected = Kein Gew\u00e4sser ausgew\u00e4hlt.
 no.gauge.selected = Kein Pegel ausgew\u00e4hlt.
--- a/flys-artifacts/src/main/resources/messages_de_DE.properties	Wed Feb 08 15:31:24 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_de_DE.properties	Wed Feb 08 15:50:25 2012 +0000
@@ -178,6 +178,7 @@
 cannot.create.index.q.relation = Spaltenindex/Q-Beziehung konnte nicht erstellt werden.
 relating.w.w.failed = W-zu-W-Zuordnung fehlgeschlagen.
 cannot.find.hist.q.for.w = Konnte zu W = {0,number,#.##} im Zeitraum ({1,date} - {2,date}) kein Abfluss ermitteln.
+cannot.find.hist.q.tables = Konnte f\u00fcr den angegebenen Zeitraum keine Abflusstafeln finden.
 
 no.river.selected = Kein Gew\u00e4sser ausgew\u00e4hlt.
 no.gauge.selected = Kein Pegel ausgew\u00e4hlt.
--- a/flys-artifacts/src/main/resources/messages_en.properties	Wed Feb 08 15:31:24 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_en.properties	Wed Feb 08 15:50:25 2012 +0000
@@ -174,6 +174,7 @@
 cannot.create.index.q.relation = Cannot create index/Q relation.
 relating.w.w.failed = Relating W with W failed.
 cannot.find.hist.q.for.w = Cannot find Q for W = {0,number,#.##} in timerange {1, date} - {2, date}
+cannot.find.hist.q.tables = Cannot find Discharge Tables for given timerange.
 
 no.river.selected = No river selected.
 no.gauge.selected = No gauge selected.

http://dive4elements.wald.intevation.org