diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthdev/FlowDepthDevelopmentState.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 ee5ce13016ed
children 3828c7d820ef
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthdev/FlowDepthDevelopmentState.java	Thu Apr 05 17:12:23 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthdev/FlowDepthDevelopmentState.java	Thu Apr 05 18:30:34 2018 +0200
@@ -77,24 +77,28 @@
 
         final FlowDepthDevelopmentCalculationResults results = (FlowDepthDevelopmentCalculationResults) res.getData();
         final FlowDepthDevelopmentCalculationResult result = results.getResult();
-        if (result == null)
-            return res;
-
-        /* add themes for chart, for each result */
-        final int index = 0;
+        if (result != null) {
+            /* add themes for chart, for each result */
+            final int index = 0;
 
-        // /* filtered (zoom dependent mean) flow depth development */
-        facets.add(FlowDepthDevelopmentProcessor.createFlowDepthDevelopmentFacet(context, hash, this.id, result, index));
-        facets.add(FlowDepthDevelopmentProcessor.createWaterlevelDifferenceFacet(context, hash, this.id, result, index));
-        facets.add(FlowDepthDevelopmentProcessor.createBedHeightDifferenceFacet(context, hash, this.id, result, index));
+            // /* filtered (zoom dependent mean) flow depth development */
+            facets.add(FlowDepthDevelopmentProcessor.createFlowDepthDevelopmentFilteredFacet(context, hash, this.id, result, index));
+            facets.add(FlowDepthDevelopmentProcessor.createFlowDepthDevelopmentRawFacet(context, hash, this.id, result, index));
 
-        facets.add(FlowDepthDevelopmentPerYearProcessor.createFlowDepthDevelopmentFacet(context, hash, this.id, result, index));
+            facets.add(FlowDepthDevelopmentProcessor.createWaterlevelDifferenceFacet(context, hash, this.id, result, index));
+            facets.add(FlowDepthDevelopmentProcessor.createBedHeightDifferenceFacet(context, hash, this.id, result, index));
 
-        facets.add(FlowDepthProcessor.createFlowDepthCurrentFacet(context, hash, this.id, result, index));
-        facets.add(FlowDepthProcessor.createFlowDepthHistoricalFacet(context, hash, this.id, result, index));
+            facets.add(FlowDepthDevelopmentPerYearProcessor.createFlowDepthDevelopmentFilteredFacet(context, hash, this.id, result, index));
+            facets.add(FlowDepthDevelopmentPerYearProcessor.createFlowDepthDevelopmentRawFacet(context, hash, this.id, result, index));
 
-        facets.add(new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id));
-        facets.add(new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id));
+            facets.add(FlowDepthProcessor.createFlowDepthCurrentFilteredFacet(context, hash, this.id, result, index));
+            facets.add(FlowDepthProcessor.createFlowDepthCurrentRawFacet(context, hash, this.id, result, index));
+            facets.add(FlowDepthProcessor.createFlowDepthHistoricalFilteredFacet(context, hash, this.id, result, index));
+            facets.add(FlowDepthProcessor.createFlowDepthHistoricalRawFacet(context, hash, this.id, result, index));
+
+            facets.add(new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id));
+            facets.add(new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id));
+        }
 
         final Calculation report = res.getReport();
         if (report.hasProblems())

http://dive4elements.wald.intevation.org