comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxState.java @ 8950:b0aeed4c97c1

Implemented chart output for sinfo flow depth min/max calculation
author gernotbelger
date Thu, 15 Mar 2018 17:22:28 +0100
parents 5d5d482da3e9
children b194fa64506a
comparison
equal deleted inserted replaced
8949:09e4a4909814 8950:b0aeed4c97c1
19 import org.dive4elements.river.artifacts.model.DataFacet; 19 import org.dive4elements.river.artifacts.model.DataFacet;
20 import org.dive4elements.river.artifacts.model.EmptyFacet; 20 import org.dive4elements.river.artifacts.model.EmptyFacet;
21 import org.dive4elements.river.artifacts.model.FacetTypes; 21 import org.dive4elements.river.artifacts.model.FacetTypes;
22 import org.dive4elements.river.artifacts.model.ReportFacet; 22 import org.dive4elements.river.artifacts.model.ReportFacet;
23 import org.dive4elements.river.artifacts.sinfo.SINFOArtifact; 23 import org.dive4elements.river.artifacts.sinfo.SINFOArtifact;
24 import org.dive4elements.river.artifacts.sinfo.common.FlowDepthProcessor;
24 import org.dive4elements.river.artifacts.states.DefaultState; 25 import org.dive4elements.river.artifacts.states.DefaultState;
25 26
26 /** State in which a waterlevel has been calculated. */ 27 /** State in which a waterlevel has been calculated. */
27 public class FlowDepthMinMaxState extends DefaultState { 28 public class FlowDepthMinMaxState extends DefaultState {
28 29
79 for (int index = 0; index < resultList.size(); index++) { 80 for (int index = 0; index < resultList.size(); index++) {
80 81
81 final FlowDepthMinMaxCalculationResult result = resultList.get(index); 82 final FlowDepthMinMaxCalculationResult result = resultList.get(index);
82 83
83 /* filtered (zoom dependent mean) flow depth */ 84 /* filtered (zoom dependent mean) flow depth */
84 // facets.add(FlowDepthProcessor.createFlowDepthFacet(context, hash, this.id, result, index)); 85 if (result.hasMin())
86 facets.add(FlowDepthProcessor.createFlowDepthMinFacet(context, hash, this.id, result, index));
85 87
88 if (result.hasMax())
89 facets.add(FlowDepthProcessor.createFlowDepthMaxFacet(context, hash, this.id, result, index));
86 } 90 }
87 91
88 if (!resultList.isEmpty()) { 92 if (!resultList.isEmpty()) {
89 final Facet csv = new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id); 93 facets.add(new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id));
90 final Facet pdf = new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id); 94 facets.add(new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id));
91
92 facets.add(csv);
93 facets.add(pdf);
94 } 95 }
95 96
96 final Calculation report = res.getReport(); 97 final Calculation report = res.getReport();
97 if (report.hasProblems()) 98 if (report.hasProblems())
98 facets.add(new ReportFacet(ComputeType.ADVANCE, hash, this.id)); 99 facets.add(new ReportFacet(ComputeType.ADVANCE, hash, this.id));

http://dive4elements.wald.intevation.org