comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepth/FlowDepthState.java @ 8916:5d5d0051723f

Working on outputmodes of tkh calculation
author gernotbelger
date Wed, 28 Feb 2018 18:55:39 +0100
parents e3519c3e7a0a
children 82998242ba84
comparison
equal deleted inserted replaced
8915:d9dbf0b74bc2 8916:5d5d0051723f
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.resources.Resources; 23 import org.dive4elements.river.artifacts.resources.Resources;
24 import org.dive4elements.river.artifacts.sinfo.SINFOArtifact; 24 import org.dive4elements.river.artifacts.sinfo.SINFOArtifact;
25 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultFacet;
26 import org.dive4elements.river.artifacts.sinfo.common.TkhProcessor;
25 import org.dive4elements.river.artifacts.states.DefaultState; 27 import org.dive4elements.river.artifacts.states.DefaultState;
26 28
27 /** State in which a waterlevel has been calculated. */ 29 /** State in which a waterlevel has been calculated. */
28 public class FlowDepthState extends DefaultState { 30 public class FlowDepthState extends DefaultState {
29 31
34 36
35 private static final String I18N_FACET_FLOW_DEPTH_FILTERED_DESCRIPTION = "sinfo.facet.flow_depth.filtered.description"; 37 private static final String I18N_FACET_FLOW_DEPTH_FILTERED_DESCRIPTION = "sinfo.facet.flow_depth.filtered.description";
36 38
37 private static final String I18N_FACET_FLOW_DEPTH_TKH_FILTERED_DESCRIPTION = "sinfo.facet.flow_depth.tkh.filtered.description"; 39 private static final String I18N_FACET_FLOW_DEPTH_TKH_FILTERED_DESCRIPTION = "sinfo.facet.flow_depth.tkh.filtered.description";
38 40
39 private static final String I18N_FACET_TKH_DESCRIPTION = "sinfo.facet.tkh.description";
40 41
41 private static final String SINFO_CHART_FLOW_DEPTH_YAXIS_LABEL = "sinfo.chart.flow_depth.yaxis.label"; 42 private static final String SINFO_CHART_FLOW_DEPTH_YAXIS_LABEL = "sinfo.chart.flow_depth.yaxis.label";
42
43 private static final String SINFO_CHART_TKX_YAXIS_LABEL = "sinfo.chart.tkh.yaxis.label";
44 43
45 /** 44 /**
46 * From this state can only be continued trivially. 45 * From this state can only be continued trivially.
47 */ 46 */
48 @Override 47 @Override
92 final FlowDepthCalculationResult result = resultList.get(index); 91 final FlowDepthCalculationResult result = resultList.get(index);
93 92
94 /* filtered (zoom dependent mean) flow depth */ 93 /* filtered (zoom dependent mean) flow depth */
95 final String facetFlowDepthFilteredDescription = Resources.getMsg(context.getMeta(), I18N_FACET_FLOW_DEPTH_FILTERED_DESCRIPTION, 94 final String facetFlowDepthFilteredDescription = Resources.getMsg(context.getMeta(), I18N_FACET_FLOW_DEPTH_FILTERED_DESCRIPTION,
96 I18N_FACET_FLOW_DEPTH_FILTERED_DESCRIPTION, result.getLabel()); 95 I18N_FACET_FLOW_DEPTH_FILTERED_DESCRIPTION, result.getLabel());
97 facets.add(new FlowDepthFacet(index, FlowDepthProcessor.FACET_FLOW_DEPTH_FILTERED, facetFlowDepthFilteredDescription, 96 facets.add(new SInfoResultFacet(index, FlowDepthProcessor.FACET_FLOW_DEPTH_FILTERED, facetFlowDepthFilteredDescription,
98 SINFO_CHART_FLOW_DEPTH_YAXIS_LABEL, ComputeType.ADVANCE, this.id, hash)); 97 SINFO_CHART_FLOW_DEPTH_YAXIS_LABEL, ComputeType.ADVANCE, this.id, hash));
99 98
100 if (results.isUseTkh()) { 99 if (results.isUseTkh()) {
101 /* filtered (zoom dependent mean) flow depth including tkh */ 100 /* filtered (zoom dependent mean) flow depth including tkh */
102 final String facetFlowDepthTkhFilteredDescription = Resources.getMsg(context.getMeta(), I18N_FACET_FLOW_DEPTH_TKH_FILTERED_DESCRIPTION, 101 final String facetFlowDepthTkhFilteredDescription = Resources.getMsg(context.getMeta(), I18N_FACET_FLOW_DEPTH_TKH_FILTERED_DESCRIPTION,
103 I18N_FACET_FLOW_DEPTH_TKH_FILTERED_DESCRIPTION, result.getLabel()); 102 I18N_FACET_FLOW_DEPTH_TKH_FILTERED_DESCRIPTION, result.getLabel());
104 facets.add(new FlowDepthFacet(index, FlowDepthProcessor.FACET_FLOW_DEPTH_TKH_FILTERED, facetFlowDepthTkhFilteredDescription, 103 facets.add(new SInfoResultFacet(index, FlowDepthProcessor.FACET_FLOW_DEPTH_TKH_FILTERED, facetFlowDepthTkhFilteredDescription,
105 SINFO_CHART_FLOW_DEPTH_YAXIS_LABEL, ComputeType.ADVANCE, this.id, hash)); 104 SINFO_CHART_FLOW_DEPTH_YAXIS_LABEL, ComputeType.ADVANCE, this.id, hash));
106 105
107 // FIXME: add other themes 106 facets.add(TkhProcessor.createTkhFacet(context, hash, this.id, result, index));
108 // - Streckenfavoriten
109
110 // FIXME:
111 // - Gemittelte Linie der Fließtiefe mitsamt TKH
112 // - Transportkörperhöhen (oben/unten/schraffur)
113 final String facetTkhDescription = Resources.getMsg(context.getMeta(), I18N_FACET_TKH_DESCRIPTION, I18N_FACET_TKH_DESCRIPTION,
114 result.getLabel());
115 facets.add(new FlowDepthFacet(index, TkhProcessor.FACET_TKH, facetTkhDescription, SINFO_CHART_TKX_YAXIS_LABEL, ComputeType.ADVANCE, this.id,
116 hash));
117 } 107 }
118
119 // FIXME: Datenkorbkonfiguration
120 } 108 }
121 109
122 if (!resultList.isEmpty()) { 110 if (!resultList.isEmpty()) {
123 final Facet csv = new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id); 111 final Facet csv = new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id);
124 final Facet pdf = new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id); 112 final Facet pdf = new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id);

http://dive4elements.wald.intevation.org