annotate artifacts/src/main/java/org/dive4elements/river/artifacts/states/FlowVelocityState.java @ 9801:1d7a72a50183 3.2.x tip

Assume Compose V2, consistently
author Tom Gottfried <tom@intevation.de>
date Thu, 23 Nov 2023 10:14:13 +0100
parents 0a5239a1e46e
children
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
9 package org.dive4elements.river.artifacts.states;
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import java.util.ArrayList;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import java.util.List;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
14 import org.apache.logging.log4j.Logger;
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
15 import org.apache.logging.log4j.LogManager;
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
17 import org.dive4elements.artifactdatabase.state.Facet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
18 import org.dive4elements.artifactdatabase.state.FacetActivity;
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
20 import org.dive4elements.artifacts.Artifact;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
21 import org.dive4elements.artifacts.CallContext;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
22
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
23 import org.dive4elements.river.artifacts.D4EArtifact;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
24 import org.dive4elements.river.artifacts.access.FlowVelocityAccess;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
25 import org.dive4elements.river.artifacts.model.CalculationResult;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
26 import org.dive4elements.river.artifacts.model.DataFacet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
27 import org.dive4elements.river.artifacts.model.FacetTypes;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
28 import org.dive4elements.river.artifacts.model.FlowVelocityCalculation;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
29 import org.dive4elements.river.artifacts.model.FlowVelocityData;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
30 import org.dive4elements.river.artifacts.model.FlowVelocityFacet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
31 import org.dive4elements.river.artifacts.model.FlowVelocityFilterFacet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
32 import org.dive4elements.river.artifacts.resources.Resources;
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34
4466
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
35 /* State in which flow velocities can/will be calculated. */
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36 public class FlowVelocityState extends DefaultState implements FacetTypes {
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
38 private static Logger log = LogManager.getLogger(FlowVelocityState.class);
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
40 public static final String I18N_MAINCHANNEL_FACET =
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
41 "facet.flow_velocity.mainchannel";
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
42
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
43 public static final String I18N_TOTALCHANNEL_FACET =
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
44 "facet.flow_velocity.totalchannel";
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
45
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
46 public static final String I18N_TAU_FACET =
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
47 "facet.flow_velocity.tauchannel";
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
48
4669
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
49 public static final String I18N_MAINCHANNEL_FACET_RAW =
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
50 "facet.flow_velocity.mainchannel.raw";
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
51
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
52 public static final String I18N_TOTALCHANNEL_FACET_RAW =
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
53 "facet.flow_velocity.totalchannel.raw";
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
54
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
55 public static final String I18N_TAU_FACET_RAW =
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
56 "facet.flow_velocity.tauchannel.raw";
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
57
4466
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
58 public static final String I18N_DISCHARGE_FACET =
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
59 "facet.flow_velocity.discharge";
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
60
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
61
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62 @Override
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 public Object computeAdvance(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
64 D4EArtifact artifact,
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 String hash,
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 CallContext context,
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 List<Facet> facets,
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 Object old
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 ) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7668
diff changeset
70 log.debug("FlowVelocityState.computeAdvance");
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 List<Facet> newFacets = new ArrayList<Facet>();
3232
cdbc457e23e2 Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3230
diff changeset
73
6101
a0078e5e3b39 Removed unused context from RangeAccess and subclasses leading to some dead code removal.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
74 FlowVelocityAccess access = new FlowVelocityAccess(artifact);
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 CalculationResult res = old instanceof CalculationResult
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 ? (CalculationResult) old
3230
b888c5eb65b3 Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2706
diff changeset
78 : new FlowVelocityCalculation().calculate(access);
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 if (facets == null || res == null) {
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 return res;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 }
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 FlowVelocityData[] data = (FlowVelocityData[]) res.getData();
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7668
diff changeset
86 log.debug("Calculated " + data.length + " FlowVelocityData objects");
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
88 String id = getID();
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
89 int idx = 0;
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91 for (FlowVelocityData d: data) {
4624
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
92 if (d.getType().equals("main")) {
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
93 newFacets.add(new FlowVelocityFacet(
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
94 idx,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
95 FLOW_VELOCITY_MAINCHANNEL,
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
96 buildFacetName(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
97 artifact, context, d, I18N_MAINCHANNEL_FACET_RAW),
4624
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
98 ComputeType.ADVANCE,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
99 id,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
100 hash
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
101 ));
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
102
4624
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
103 newFacets.add(new FlowVelocityFacet(
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
104 idx,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
105 FLOW_VELOCITY_TAU,
4669
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
106 buildFacetName(artifact, context, d, I18N_TAU_FACET_RAW),
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
107 ComputeType.ADVANCE,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
108 id,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
109 hash
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
110 ));
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
111 newFacets.add(new FlowVelocityFilterFacet(
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
112 idx,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
113 FLOW_VELOCITY_MAINCHANNEL_FILTERED,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
114 buildMainChannelName(artifact, context, d),
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
115 ComputeType.ADVANCE,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
116 id,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
117 hash
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
118 ));
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
119 newFacets.add(new FlowVelocityFilterFacet(
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
120 idx,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
121 FLOW_VELOCITY_TAU_FILTERED,
4624
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
122 buildTauName(artifact, context, d),
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
123 ComputeType.ADVANCE,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
124 id,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
125 hash
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
126 ));
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
127 }
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
128 else if (d.getType().equals("total")) {
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
129 newFacets.add(new FlowVelocityFacet(
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
130 idx,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
131 FLOW_VELOCITY_TOTALCHANNEL,
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
132 buildFacetName(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
133 artifact, context, d, I18N_TOTALCHANNEL_FACET_RAW),
4669
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
134 ComputeType.ADVANCE,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
135 id,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
136 hash
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
137 ));
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
138 newFacets.add(new FlowVelocityFilterFacet(
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
139 idx,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
140 FLOW_VELOCITY_TOTALCHANNEL_FILTERED,
4624
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
141 buildTotalChannelName(artifact, context, d),
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
142 ComputeType.ADVANCE,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
143 id,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
144 hash
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
145 ));
4736
b195fede1c3b Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4669
diff changeset
146
4624
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
147 }
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
148 else if(d.getType().equals("main_total")) {
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
149 newFacets.add(new FlowVelocityFacet(
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
150 idx,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
151 FLOW_VELOCITY_MAINCHANNEL,
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
152 buildFacetName(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
153 artifact, context, d, I18N_MAINCHANNEL_FACET_RAW),
4624
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
154 ComputeType.ADVANCE,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
155 id,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
156 hash
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
157 ));
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
158 newFacets.add(new FlowVelocityFacet(
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
159 idx,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
160 FLOW_VELOCITY_TAU,
4669
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
161 buildFacetName(artifact, context, d, I18N_TAU_FACET_RAW),
4624
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
162 ComputeType.ADVANCE,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
163 id,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
164 hash
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
165 ));
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
166 newFacets.add(new FlowVelocityFacet(
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
167 idx,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
168 FLOW_VELOCITY_TOTALCHANNEL,
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
169 buildFacetName(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
170 artifact, context, d, I18N_TOTALCHANNEL_FACET_RAW),
4669
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
171 ComputeType.ADVANCE,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
172 id,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
173 hash
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
174 ));
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
175 newFacets.add(new FlowVelocityFilterFacet(
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
176 idx,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
177 FLOW_VELOCITY_MAINCHANNEL_FILTERED,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
178 buildMainChannelName(artifact, context, d),
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
179 ComputeType.ADVANCE,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
180 id,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
181 hash
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
182 ));
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
183 newFacets.add(new FlowVelocityFilterFacet(
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
184 idx,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
185 FLOW_VELOCITY_TAU_FILTERED,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
186 buildTauName(artifact, context, d),
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
187 ComputeType.ADVANCE,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
188 id,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
189 hash
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
190 ));
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
191 newFacets.add(new FlowVelocityFilterFacet(
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
192 idx,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
193 FLOW_VELOCITY_TOTALCHANNEL_FILTERED,
4624
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
194 buildTotalChannelName(artifact, context, d),
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
195 ComputeType.ADVANCE,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
196 id,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
197 hash
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
198 ));
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
199 }
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
200
4466
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
201 newFacets.add(new FlowVelocityFacet(
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
202 idx,
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
203 FLOW_VELOCITY_DISCHARGE,
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
204 buildDischargeName(artifact, context, d),
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
205 ComputeType.ADVANCE,
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
206 id,
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
207 hash
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
208 ));
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
209
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
210 idx++;
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
211 }
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
212
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
213 Facet csv = new DataFacet(
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
214 CSV, "CSV data", ComputeType.ADVANCE, hash, id);
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
215
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
216 // TODO ADD PDF FACET
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
217
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
218 newFacets.add(csv);
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
219
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7668
diff changeset
220 log.debug("Created " + newFacets.size() + " new Facets.");
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
221
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
222 facets.addAll(newFacets);
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
223
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
224 return res;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
225 }
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
226
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
227
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
228 protected String buildFacetName(
7307
173d872a374c cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6101
diff changeset
229 D4EArtifact flys,
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
230 CallContext cc,
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
231 FlowVelocityData data,
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
232 String resourceId
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
233 ) {
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
234 Object[] args = new Object[] {
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
235 data.getZone()
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
236 };
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
237
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
238 return Resources.getMsg(
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
239 cc.getMeta(),
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
240 resourceId,
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
241 resourceId,
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
242 args);
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
243 }
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
244
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
245
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
246 protected String buildMainChannelName(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
247 D4EArtifact flys,
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
248 CallContext cc,
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
249 FlowVelocityData data
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
250 ) {
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
251 return buildFacetName(flys, cc, data, I18N_MAINCHANNEL_FACET);
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
252 }
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
253
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
254
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
255 protected String buildTotalChannelName(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
256 D4EArtifact flys,
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
257 CallContext cc,
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
258 FlowVelocityData data
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
259 ) {
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
260 return buildFacetName(flys, cc, data, I18N_TOTALCHANNEL_FACET);
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
261 }
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
262
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
263
4466
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
264 protected String buildDischargeName(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
265 D4EArtifact flys,
4466
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
266 CallContext cc,
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
267 FlowVelocityData data
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
268 ) {
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
269 return buildFacetName(flys, cc, data, I18N_DISCHARGE_FACET);
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
270 }
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
271
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
272 protected String buildTauName(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
273 D4EArtifact flys,
2706
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
274 CallContext cc,
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
275 FlowVelocityData data
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
276 ) {
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
277 return buildFacetName(flys, cc, data, I18N_TAU_FACET);
d8444fcb4e44 Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
278 }
4669
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
279
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
280 static {
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
281 // Active/deactivate facets.
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
282 FacetActivity.Registry.getInstance().register(
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
283 "minfo",
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
284 new FacetActivity() {
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
285 @Override
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
286 public Boolean isInitialActive(
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
287 Artifact artifact,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
288 Facet facet,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
289 String output
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
290 ) {
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
291 String name = facet.getName();
4793
c0d6391bec6f Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents: 4736
diff changeset
292 if (name.equals(FLOW_VELOCITY_MAINCHANNEL_FILTERED) ||
c0d6391bec6f Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents: 4736
diff changeset
293 name.equals(FLOW_VELOCITY_TAU_FILTERED) ||
c0d6391bec6f Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents: 4736
diff changeset
294 name.equals(FLOW_VELOCITY_TOTALCHANNEL_FILTERED)) {
c0d6391bec6f Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents: 4736
diff changeset
295 return Boolean.TRUE;
c0d6391bec6f Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents: 4736
diff changeset
296 }
c0d6391bec6f Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents: 4736
diff changeset
297 else if (name.equals(FLOW_VELOCITY_MAINCHANNEL) ||
4669
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
298 name.equals(FLOW_VELOCITY_TAU) ||
7668
e0219f4079a8 issue1688: In flow velocity, discharges are now initially inactive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7307
diff changeset
299 name.equals(FLOW_VELOCITY_TOTALCHANNEL) ||
e0219f4079a8 issue1688: In flow velocity, discharges are now initially inactive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7307
diff changeset
300 name.equals(FLOW_VELOCITY_DISCHARGE)
e0219f4079a8 issue1688: In flow velocity, discharges are now initially inactive.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7307
diff changeset
301 ) {
4669
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
302 return Boolean.FALSE;
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
303 }
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
304 else {
4793
c0d6391bec6f Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents: 4736
diff changeset
305 return null;
4669
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
306 }
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
307 }
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
308 });
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
309 }
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
310 }
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
311 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org