changeset 9510:9ea704de63ee

Error message added if no bed height found for a calc range
author mschaefer
date Mon, 01 Oct 2018 09:56:14 +0200
parents 6146358c4842
children 5c1e66a3c878
files artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/TkhCalculation.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/TkhCalculation.java	Mon Oct 01 09:53:36 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/TkhCalculation.java	Mon Oct 01 09:56:14 2018 +0200
@@ -27,9 +27,9 @@
 import org.dive4elements.river.artifacts.common.ResultRow;
 import org.dive4elements.river.artifacts.model.Calculation;
 import org.dive4elements.river.artifacts.model.Calculation.Problem;
-import org.dive4elements.river.artifacts.model.river.RiverInfoProvider;
 import org.dive4elements.river.artifacts.model.CalculationResult;
 import org.dive4elements.river.artifacts.model.WQKms;
+import org.dive4elements.river.artifacts.model.river.RiverInfoProvider;
 import org.dive4elements.river.artifacts.resources.Resources;
 import org.dive4elements.river.artifacts.sinfo.SINFOArtifact;
 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.DischargeValuesFinder;
@@ -79,6 +79,11 @@
         }
 
         final double[] stations = extractStations(bedHeights);
+        if (stations.length == 0) {
+            final TkhCalculationResults results = new TkhCalculationResults(calcModeLabel, user, riverInfo, calcRange, "");
+            problems.addProblem("sinfo.bedheightsfinder.empty");
+            return new CalculationResult(results, problems);
+        }
 
         /* misuse winfo-artifact to calculate waterlevels in the same way */
         final WINFOArtifact winfo = new WinfoArtifactWrapper(sinfo);

http://dive4elements.wald.intevation.org