changeset 1669:0296684a5553

Bugfix: #330 Add problem if no data was found for duration curves. flys-artifacts/trunk@2881 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 04 Oct 2011 13:38:21 +0000
parents 6566c7868456
children fc9719cddbc6
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation3.java
diffstat 2 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Oct 04 11:28:37 2011 +0000
+++ b/flys-artifacts/ChangeLog	Tue Oct 04 13:38:21 2011 +0000
@@ -1,3 +1,10 @@
+2011-10-04  Ingo Weinzierl <ingo@intevation.de>
+
+	flys/issue330 (Dauerlinie kann nicht berechnet werden)
+
+	* src/main/java/de/intevation/flys/artifacts/model/Calculation3.java:
+	  Add a problem if no data was found for duration curves.
+
 2011-10-04  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/themes/Theme.java,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation3.java	Tue Oct 04 11:28:37 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation3.java	Tue Oct 04 13:38:21 2011 +0000
@@ -24,6 +24,18 @@
 
         double [] ws = wst.interpolateW(km, qs, new double[qs.length], this);
 
+        if (days == null || days.length == 0) {
+            addProblem(km, "cannot find Ds");
+        }
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("Calculate duration curve data:");
+            logger.debug("    km       : " + km);
+            logger.debug("    num Days : " + (days != null ? days.length : 0));
+            logger.debug("    num Qs   : " + (qs != null ? qs.length : 0));
+            logger.debug("    result Ws: " + (ws != null ? ws.length : 0));
+        }
+
         WQDay wqday = new WQDay(days, ws, qs);
 
         if (hasProblems()) {

http://dive4elements.wald.intevation.org