diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationState.java @ 9145:e6b63b2b41b9

sinfo.flood_duration pdf, csv, ui
author gernotbelger
date Tue, 12 Jun 2018 10:23:23 +0200
parents 2ed3824a3d53
children 23945061daec
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationState.java	Mon Jun 11 09:55:35 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationState.java	Tue Jun 12 10:23:23 2018 +0200
@@ -15,7 +15,9 @@
 import org.dive4elements.river.artifacts.ChartArtifact;
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.model.CalculationResult;
+import org.dive4elements.river.artifacts.model.DataFacet;
 import org.dive4elements.river.artifacts.model.EmptyFacet;
+import org.dive4elements.river.artifacts.model.FacetTypes;
 import org.dive4elements.river.artifacts.sinfo.SINFOArtifact;
 import org.dive4elements.river.artifacts.states.DefaultState;
 
@@ -66,36 +68,29 @@
 
         if (facets == null)
             return res;
-        //
-        // final FlowDepthCalculationResults results = (FlowDepthCalculationResults) res.getData();
-        //
-        // /* add themes for chart, for each result */
-        // final List<FlowDepthCalculationResult> resultList = results.getResults();
-        // for (int index = 0; index < resultList.size(); index++) {
-        //
-        // final FlowDepthCalculationResult result = resultList.get(index);
-        //
-        // /* filtered (zoom dependent mean) flow depth */
-        // facets.add(FlowDepthProcessor.createFlowDepthFilteredFacet(context, hash, this.id, result, index));
-        // facets.add(FlowDepthProcessor.createFlowDepthRawFacet(context, hash, this.id, result, index));
-        //
-        // if (results.isUseTkh()) {
-        // /* filtered (zoom dependent mean) flow depth including tkh */
-        // facets.add(FlowDepthProcessor.createFlowDepthTkhFilteredFacet(context, hash, this.id, result, index));
-        // facets.add(FlowDepthProcessor.createFlowDepthTkhRawFacet(context, hash, this.id, result, index));
-        //
-        // facets.add(TkhProcessor.createTkhFacet(context, hash, this.id, result, index));
-        // }
-        // }
 
-        // if (!resultList.isEmpty()) {
-        // final Facet csv = new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id);
-        // final Facet pdf = new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id);
-        //
-        // facets.add(csv);
-        // facets.add(pdf);
-        // }
-        //
+        final FloodDurationCalculationResults results = (FloodDurationCalculationResults) res.getData();
+
+        /* add themes for chart, for each result */
+        final List<FloodDurationCalculationResult> resultList = results.getResults();
+        for (int index = 0; index < resultList.size(); index++) {
+
+            final FloodDurationCalculationResult result = resultList.get(index);
+
+            /* filtered (zoom dependent mean) flow depth TODO: */
+            // facets.add(FloodDurationProcessor.createFlowDepthFilteredFacet(context, hash, this.id, result, index));
+            // facets.add(FloodDurationProcessor.createFlowDepthRawFacet(context, hash, this.id, result, index));
+
+        }
+
+        if (!resultList.isEmpty()) {
+            final Facet csv = new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id);
+            final Facet pdf = new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id);
+
+            facets.add(csv);
+            facets.add(pdf);
+        }
+
         // final Calculation report = res.getReport();
         //
         // if (report.hasProblems()) {

http://dive4elements.wald.intevation.org