Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FlowVelocityState.java @ 5308:7712dacc27ab
Avoid NPE if data list is null.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 14 Mar 2013 17:16:15 +0100 |
parents | a3dc382bc1ca |
children |
rev | line source |
---|---|
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.states; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 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
|
4 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
|
5 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 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
|
7 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import de.intevation.artifactdatabase.state.Facet; |
4669
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
9 import de.intevation.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
|
10 |
4669
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
11 import de.intevation.artifacts.Artifact; |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.artifacts.CallContext; |
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 de.intevation.flys.artifacts.FLYSArtifact; |
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
|
15 import de.intevation.flys.artifacts.access.FlowVelocityAccess; |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.flys.artifacts.model.CalculationResult; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 import de.intevation.flys.artifacts.model.DataFacet; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.flys.artifacts.model.FacetTypes; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.flys.artifacts.model.FlowVelocityCalculation; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.flys.artifacts.model.FlowVelocityData; |
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
|
21 import de.intevation.flys.artifacts.model.FlowVelocityFacet; |
4669
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
22 import de.intevation.flys.artifacts.model.FlowVelocityFilterFacet; |
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
|
23 import de.intevation.flys.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
|
24 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 |
4466
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
26 /* 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
|
27 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
|
28 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 private static Logger logger = Logger.getLogger(FlowVelocityState.class); |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 |
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
|
31 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
|
32 "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
|
33 |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
34 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
|
35 "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
|
36 |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
37 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
|
38 "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
|
39 |
4669
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
40 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
|
41 "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
|
42 |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
43 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
|
44 "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
|
45 |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
46 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
|
47 "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
|
48 |
4466
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
49 public static final String I18N_DISCHARGE_FACET = |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
50 "facet.flow_velocity.discharge"; |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
51 |
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
|
52 |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 @Override |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 public Object computeAdvance( |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 FLYSArtifact artifact, |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 String hash, |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 CallContext context, |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 List<Facet> facets, |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 Object old |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 ) { |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 logger.debug("FlowVelocityState.computeAdvance"); |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 List<Facet> newFacets = new ArrayList<Facet>(); |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
64 |
4826
a3dc382bc1ca
BedHeightAccess, FlowVelocityAccess, SedimentLoadAccess: Inherit from RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4793
diff
changeset
|
65 FlowVelocityAccess access = new FlowVelocityAccess(artifact, context); |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 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
|
68 ? (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
|
69 : 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
|
70 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 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
|
72 return res; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 } |
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 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
|
76 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 logger.debug("Calculated " + data.length + " FlowVelocityData objects"); |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 |
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
|
79 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
|
80 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
|
81 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 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
|
83 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
|
84 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
|
85 idx, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
86 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
|
87 buildFacetName(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
|
88 ComputeType.ADVANCE, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
89 id, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
90 hash |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
91 )); |
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
|
92 |
4624
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_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
|
96 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
|
97 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
|
98 id, |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
99 hash |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
100 )); |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
101 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
|
102 idx, |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
103 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
|
104 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
|
105 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
|
106 id, |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
107 hash |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
108 )); |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
109 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
|
110 idx, |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
111 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
|
112 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
|
113 ComputeType.ADVANCE, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
114 id, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
115 hash |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
116 )); |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
117 } |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
118 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
|
119 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
|
120 idx, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
121 FLOW_VELOCITY_TOTALCHANNEL, |
4669
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
122 buildFacetName(artifact, context, d, 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
|
123 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
|
124 id, |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
125 hash |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
126 )); |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
127 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
|
128 idx, |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
129 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
|
130 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
|
131 ComputeType.ADVANCE, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
132 id, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
133 hash |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
134 )); |
4736
b195fede1c3b
Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4669
diff
changeset
|
135 |
4624
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
136 } |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
137 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
|
138 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
|
139 idx, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
140 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
|
141 buildFacetName(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
|
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 )); |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
146 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
|
147 idx, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
148 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
|
149 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
|
150 ComputeType.ADVANCE, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
151 id, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
152 hash |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
153 )); |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
154 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
|
155 idx, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
156 FLOW_VELOCITY_TOTALCHANNEL, |
4669
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
157 buildFacetName(artifact, context, d, 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
|
158 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
|
159 id, |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
160 hash |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
161 )); |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
162 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
|
163 idx, |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
164 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
|
165 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
|
166 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
|
167 id, |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
168 hash |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
169 )); |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
170 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
|
171 idx, |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
172 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
|
173 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
|
174 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
|
175 id, |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
176 hash |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
177 )); |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
178 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
|
179 idx, |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
180 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
|
181 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
|
182 ComputeType.ADVANCE, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
183 id, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
184 hash |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
185 )); |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
186 } |
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
|
187 |
4466
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
188 newFacets.add(new FlowVelocityFacet( |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
189 idx, |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
190 FLOW_VELOCITY_DISCHARGE, |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
191 buildDischargeName(artifact, context, d), |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
192 ComputeType.ADVANCE, |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
193 id, |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
194 hash |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
195 )); |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
196 |
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
|
197 idx++; |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 } |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
200 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
|
201 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
|
202 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
203 // 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
|
204 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
205 newFacets.add(csv); |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
206 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
207 logger.debug("Created " + newFacets.size() + " new Facets."); |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
209 facets.addAll(newFacets); |
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 return res; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
212 } |
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
|
213 |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
214 |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
215 protected String buildFacetName( |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
216 FLYSArtifact flys, |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
217 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
|
218 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
|
219 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
|
220 ) { |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
221 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
|
222 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
|
223 }; |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
224 |
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 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
|
226 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
|
227 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
|
228 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
|
229 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
|
230 } |
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 |
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 protected String buildMainChannelName( |
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 FLYSArtifact flys, |
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 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
|
236 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
|
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 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
|
239 } |
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 |
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 |
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 protected String buildTotalChannelName( |
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 FLYSArtifact flys, |
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 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
|
245 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
|
246 ) { |
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 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
|
248 } |
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 |
4466
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
251 protected String buildDischargeName( |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
252 FLYSArtifact flys, |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
253 CallContext cc, |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
254 FlowVelocityData data |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
255 ) { |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
256 return buildFacetName(flys, cc, data, I18N_DISCHARGE_FACET); |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
257 } |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
258 |
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
|
259 protected String buildTauName( |
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 FLYSArtifact flys, |
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 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
|
262 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
|
263 ) { |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
264 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
|
265 } |
4669
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
266 |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
267 static { |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
268 // 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
|
269 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
|
270 "minfo", |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
271 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
|
272 @Override |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
273 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
|
274 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
|
275 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
|
276 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
|
277 ) { |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
278 String name = facet.getName(); |
4793
c0d6391bec6f
Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents:
4736
diff
changeset
|
279 if (name.equals(FLOW_VELOCITY_MAINCHANNEL_FILTERED) || |
c0d6391bec6f
Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents:
4736
diff
changeset
|
280 name.equals(FLOW_VELOCITY_TAU_FILTERED) || |
c0d6391bec6f
Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents:
4736
diff
changeset
|
281 name.equals(FLOW_VELOCITY_DISCHARGE) || |
c0d6391bec6f
Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents:
4736
diff
changeset
|
282 name.equals(FLOW_VELOCITY_TOTALCHANNEL_FILTERED)) { |
c0d6391bec6f
Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents:
4736
diff
changeset
|
283 return Boolean.TRUE; |
c0d6391bec6f
Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents:
4736
diff
changeset
|
284 } |
c0d6391bec6f
Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents:
4736
diff
changeset
|
285 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
|
286 name.equals(FLOW_VELOCITY_TAU) || |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
287 name.equals(FLOW_VELOCITY_TOTALCHANNEL)) { |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
288 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
|
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 else { |
4793
c0d6391bec6f
Fixed facet activities.
Raimund Renkert <rrenkert@intevation.de>
parents:
4736
diff
changeset
|
291 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
|
292 } |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
293 } |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
294 }); |
d0b9b77fff9f
Generate new facets to have raw and filtered data in flow velocity chart.
Raimund Renkert <rrenkert@intevation.de>
parents:
4624
diff
changeset
|
295 } |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
296 } |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
297 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |