diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthdev/FlowDepthDevelopmentCalculation.java @ 8980:b194fa64506a

SINFO - show results themes according to spec, either raw data or floating mean values. Some improvements to error handling and handling of empty results.
author gernotbelger
date Thu, 05 Apr 2018 18:30:34 +0200
parents b5600453bb8f
children d5802f22e4f5
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthdev/FlowDepthDevelopmentCalculation.java	Thu Apr 05 17:12:23 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthdev/FlowDepthDevelopmentCalculation.java	Thu Apr 05 18:30:34 2018 +0200
@@ -70,8 +70,7 @@
         final FlowDepthDevelopmentCalculationResults results = new FlowDepthDevelopmentCalculationResults(calcModeLabel, user, riverInfo, calcRange);
 
         final FlowDepthDevelopmentCalculationResult result = calculateResult(calcRange, currentPair, histPair, problems, infoProvider);
-        if (result != null)
-            results.addResult(result);
+        results.addResult(result, problems);
 
         return new CalculationResult(results, problems);
     }
@@ -118,8 +117,11 @@
         }
 
         // FIXME: distinguish error messages
-        FlowDepthUtils.checkYearDifference("", currentWstYear, currentSoundingYear, problems);
-        FlowDepthUtils.checkYearDifference("", historicalWstYear, historicalSoundingYear, problems);
+        FlowDepthUtils.checkYearDifference(Resources.getMsg(this.context.getMeta(), "flowdepthdevelopmentcalculation.yearDifferenceCurrent"), currentWstYear,
+                currentSoundingYear, problems);
+        FlowDepthUtils.checkYearDifference(Resources.getMsg(this.context.getMeta(), "flowdepthdevelopmentcalculation.yearDifferenceHistorical"),
+                historicalWstYear,
+                historicalSoundingYear, problems);
 
         /* re-determine the reference gauge, in the same way as the WaterlevelArtifact would do it */
         final RiverInfoProvider currentRiverInfoProvider = infoProvider.forWaterlevel(currentWaterlevel);

http://dive4elements.wald.intevation.org