8854
|
1 /* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
8884
|
2 * Software engineering by |
|
3 * Björnsen Beratende Ingenieure GmbH |
8854
|
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt |
|
5 * |
|
6 * This file is Free Software under the GNU AGPL (>=v3) |
|
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
|
8 * documentation coming with Dive4Elements River for details. |
|
9 */ |
|
10 |
|
11 package org.dive4elements.river.artifacts.sinfo.flowdepth; |
|
12 |
8884
|
13 import java.util.HashSet; |
|
14 import java.util.Set; |
8854
|
15 |
8884
|
16 public final class FlowDepthProcessor extends AbstractSInfoProcessor { |
8854
|
17 |
8884
|
18 /* Theme name, usually defined in 'FacetTypes', but that is soooo bad dependencies... */ |
|
19 // REMARK: these mustend with 'filtered' so extra handling happens in chart: point are always recalculated, because data |
|
20 // changes depending on zoom state |
8854
|
21 static String FACET_FLOW_DEPTH_FILTERED = "sinfo_flow_depth.filtered"; |
|
22 |
8884
|
23 static String FACET_FLOW_DEPTH_TKH_FILTERED = "sinfo_flow_depth.tkh.filtered"; |
|
24 |
|
25 private static final Set<String> HANDLED_FACET_TYPES = new HashSet<>(); |
|
26 |
|
27 static { |
|
28 HANDLED_FACET_TYPES.add(FACET_FLOW_DEPTH_FILTERED); |
|
29 HANDLED_FACET_TYPES.add(FACET_FLOW_DEPTH_TKH_FILTERED); |
|
30 } |
8854
|
31 |
|
32 private static final String I18N_AXIS_LABEL = "sinfo.chart.flow_depth.section.yaxis.label"; |
|
33 |
8884
|
34 public FlowDepthProcessor() { |
|
35 super(I18N_AXIS_LABEL, HANDLED_FACET_TYPES); |
8854
|
36 } |
|
37 |
8884
|
38 // FIXME: do filtering |
|
39 @Override |
|
40 protected double[][] generatePoints(final FlowDepthCalculationResult data, final String facetName) { |
8854
|
41 |
8884
|
42 if (FACET_FLOW_DEPTH_FILTERED.contentEquals(facetName)) |
|
43 return data.getFlowDepthPoints(); |
8854
|
44 |
8884
|
45 if (FACET_FLOW_DEPTH_TKH_FILTERED.contentEquals(facetName)) |
|
46 return data.getFlowDepthTkhPoints(); |
8854
|
47 |
8884
|
48 return super.generatePoints(data, facetName); |
8854
|
49 } |
|
50 } |