annotate artifacts/src/main/java/org/dive4elements/river/artifacts/states/FlowVelocityState.java @ 9425:3f49835a00c3

Extended CrossSectionFacet so it may fetch different data from within the artifact result. Also allows to have acces to the potentially already computed artifact result via its normal computation cache.
author gernotbelger
date Fri, 17 Aug 2018 15:31:02 +0200
parents 5e38e2924c07
children 0a5239a1e46e
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
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 import org.apache.log4j.Logger;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
16 import org.dive4elements.artifactdatabase.state.Facet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
17 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
18
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
19 import org.dive4elements.artifacts.Artifact;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
20 import org.dive4elements.artifacts.CallContext;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
21
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
22 import org.dive4elements.river.artifacts.D4EArtifact;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
23 import org.dive4elements.river.artifacts.access.FlowVelocityAccess;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
24 import org.dive4elements.river.artifacts.model.CalculationResult;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
25 import org.dive4elements.river.artifacts.model.DataFacet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
26 import org.dive4elements.river.artifacts.model.FacetTypes;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
27 import org.dive4elements.river.artifacts.model.FlowVelocityCalculation;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
28 import org.dive4elements.river.artifacts.model.FlowVelocityData;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
29 import org.dive4elements.river.artifacts.model.FlowVelocityFacet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
30 import org.dive4elements.river.artifacts.model.FlowVelocityFilterFacet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4826
diff changeset
31 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
32
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33
4466
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
34 /* 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
35 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
36
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7668
diff changeset
37 private static Logger log = Logger.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
38
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
39 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
40 "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
41
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 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
43 "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
44
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 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
46 "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
47
4669
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
48 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
49 "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
50
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
51 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
52 "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
53
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
54 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
55 "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
56
4466
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
57 public static final String I18N_DISCHARGE_FACET =
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
58 "facet.flow_velocity.discharge";
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
59
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
60
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 @Override
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62 public Object computeAdvance(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
63 D4EArtifact artifact,
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 String hash,
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 CallContext context,
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 List<Facet> facets,
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 Object old
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 ) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7668
diff changeset
69 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
70
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 List<Facet> newFacets = new ArrayList<Facet>();
3232
cdbc457e23e2 Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3230
diff changeset
72
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
73 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
74
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 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
76 ? (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
77 : 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
78
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 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
80 return res;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 }
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 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
84
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7668
diff changeset
85 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
86
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
87 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
88 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
89
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90 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
91 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
92 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
93 idx,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
94 FLOW_VELOCITY_MAINCHANNEL,
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
95 buildFacetName(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
96 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
97 ComputeType.ADVANCE,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
98 id,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
99 hash
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
100 ));
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
101
4624
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
102 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
103 idx,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
104 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
105 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
106 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
107 id,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
108 hash
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
109 ));
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
110 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
111 idx,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
112 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
113 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
114 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
115 id,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
116 hash
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
117 ));
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
118 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
119 idx,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
120 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
121 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
122 ComputeType.ADVANCE,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
123 id,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
124 hash
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
125 ));
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 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
128 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
129 idx,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
130 FLOW_VELOCITY_TOTALCHANNEL,
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
131 buildFacetName(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
132 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
133 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
134 id,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
135 hash
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
136 ));
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
137 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
138 idx,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
139 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
140 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
141 ComputeType.ADVANCE,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
142 id,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
143 hash
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
144 ));
4736
b195fede1c3b Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4669
diff changeset
145
4624
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
146 }
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
147 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
148 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
149 idx,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
150 FLOW_VELOCITY_MAINCHANNEL,
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
151 buildFacetName(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
152 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
153 ComputeType.ADVANCE,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
154 id,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
155 hash
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
156 ));
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
157 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
158 idx,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
159 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
160 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
161 ComputeType.ADVANCE,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
162 id,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
163 hash
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
164 ));
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
165 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
166 idx,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
167 FLOW_VELOCITY_TOTALCHANNEL,
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
168 buildFacetName(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
169 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
170 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
171 id,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
172 hash
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
173 ));
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
174 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
175 idx,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
176 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
177 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
178 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
179 id,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
180 hash
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
181 ));
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
182 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
183 idx,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
184 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
185 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
186 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
187 id,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
188 hash
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
189 ));
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
190 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
191 idx,
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
192 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
193 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
194 ComputeType.ADVANCE,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
195 id,
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
196 hash
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
197 ));
bb267a0aa8c2 Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents: 4466
diff changeset
198 }
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
199
4466
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
200 newFacets.add(new FlowVelocityFacet(
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
201 idx,
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
202 FLOW_VELOCITY_DISCHARGE,
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
203 buildDischargeName(artifact, context, d),
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
204 ComputeType.ADVANCE,
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
205 id,
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
206 hash
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
207 ));
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
208
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
209 idx++;
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
210 }
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 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
213 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
214
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
215 // 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
216
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
217 newFacets.add(csv);
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
218
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7668
diff changeset
219 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
220
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
221 facets.addAll(newFacets);
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
222
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
223 return res;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
224 }
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
225
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 protected String buildFacetName(
7307
173d872a374c cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6101
diff changeset
228 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
229 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
230 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
231 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
232 ) {
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 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
234 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
235 };
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 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
238 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
239 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
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 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
242 }
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 protected String buildMainChannelName(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
246 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
247 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
248 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
249 ) {
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 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
251 }
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 protected String buildTotalChannelName(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
255 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
256 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
257 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
258 ) {
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 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
260 }
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
4466
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
263 protected String buildDischargeName(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
264 D4EArtifact flys,
4466
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
265 CallContext cc,
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
266 FlowVelocityData data
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
267 ) {
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
268 return buildFacetName(flys, cc, data, I18N_DISCHARGE_FACET);
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
269 }
4d856f11e527 FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4433
diff changeset
270
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
271 protected String buildTauName(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
272 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
273 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
274 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
275 ) {
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 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
277 }
4669
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
278
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
279 static {
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
280 // 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
281 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
282 "minfo",
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
283 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
284 @Override
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
285 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
286 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
287 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
288 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
289 ) {
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
290 String name = facet.getName();
4793
c0d6391bec6f Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents: 4736
diff changeset
291 if (name.equals(FLOW_VELOCITY_MAINCHANNEL_FILTERED) ||
c0d6391bec6f Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents: 4736
diff changeset
292 name.equals(FLOW_VELOCITY_TAU_FILTERED) ||
c0d6391bec6f Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents: 4736
diff changeset
293 name.equals(FLOW_VELOCITY_TOTALCHANNEL_FILTERED)) {
c0d6391bec6f Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents: 4736
diff changeset
294 return Boolean.TRUE;
c0d6391bec6f Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents: 4736
diff changeset
295 }
c0d6391bec6f Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents: 4736
diff changeset
296 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
297 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
298 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
299 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
300 ) {
4669
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
301 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
302 }
d0b9b77fff9f Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents: 4624
diff changeset
303 else {
4793
c0d6391bec6f Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents: 4736
diff changeset
304 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
305 }
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 }
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
309 }
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
310 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org