Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FlowVelocityState.java @ 4635:53fa4d5c9fb2
Deprecate FLYSUtils
FLYSUtils should not be used anymore. Instead use/create a Access class hirarchy
to provide a data "view" of an artifact.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Tue, 04 Dec 2012 14:40:54 +0100 |
parents | bb267a0aa8c2 |
children | d0b9b77fff9f |
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; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 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
|
11 |
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.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
|
13 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
|
14 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
|
15 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
|
16 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
|
17 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
|
18 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
|
19 import de.intevation.flys.artifacts.model.FlowVelocityFacet; |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
20 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
|
21 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 |
4466
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
23 /* 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
|
24 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
|
25 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 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
|
27 |
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
|
28 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
|
29 "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
|
30 |
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_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
|
32 "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
|
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_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
|
35 "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
|
36 |
4466
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
37 public static final String I18N_DISCHARGE_FACET = |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
38 "facet.flow_velocity.discharge"; |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
39 |
2706
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
40 |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 @Override |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 public Object computeAdvance( |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 FLYSArtifact artifact, |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 String hash, |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 CallContext context, |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 List<Facet> facets, |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 Object old |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 ) { |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 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
|
50 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 List<Facet> newFacets = new ArrayList<Facet>(); |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
52 |
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
|
53 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
|
54 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 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
|
56 ? (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
|
57 : 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
|
58 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 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
|
60 return res; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 } |
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 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
|
64 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 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
|
66 |
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
|
67 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
|
68 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
|
69 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 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
|
71 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
|
72 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
|
73 idx, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
74 FLOW_VELOCITY_MAINCHANNEL, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
75 buildMainChannelName(artifact, context, d), |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
76 ComputeType.ADVANCE, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
77 id, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
78 hash |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
79 )); |
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
|
80 |
4624
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
81 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
|
82 idx, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
83 FLOW_VELOCITY_TAU, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
84 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
|
85 ComputeType.ADVANCE, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
86 id, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
87 hash |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
88 )); |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
89 } |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
90 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
|
91 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
|
92 idx, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
93 FLOW_VELOCITY_TOTALCHANNEL, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
94 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
|
95 ComputeType.ADVANCE, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
96 id, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
97 hash |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
98 )); |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
99 } |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
100 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
|
101 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
|
102 idx, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
103 FLOW_VELOCITY_MAINCHANNEL, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
104 buildMainChannelName(artifact, context, d), |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
105 ComputeType.ADVANCE, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
106 id, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
107 hash |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
108 )); |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
109 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
|
110 idx, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
111 FLOW_VELOCITY_TAU, |
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 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
|
118 idx, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
119 FLOW_VELOCITY_TOTALCHANNEL, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
120 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
|
121 ComputeType.ADVANCE, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
122 id, |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
123 hash |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
124 )); |
bb267a0aa8c2
Generate flow velocity facets based on the type the user selected.
Raimund Renkert <rrenkert@intevation.de>
parents:
4466
diff
changeset
|
125 } |
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
|
126 |
4466
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
127 newFacets.add(new FlowVelocityFacet( |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
128 idx, |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
129 FLOW_VELOCITY_DISCHARGE, |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
130 buildDischargeName(artifact, context, d), |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
131 ComputeType.ADVANCE, |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
132 id, |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
133 hash |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
134 )); |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
135 |
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
|
136 idx++; |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 } |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 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
|
140 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
|
141 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 // 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
|
143 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 newFacets.add(csv); |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 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
|
147 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 facets.addAll(newFacets); |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 return res; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 } |
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
|
152 |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
153 |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
154 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
|
155 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
|
156 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
|
157 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
|
158 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
|
159 ) { |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
160 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
|
161 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
|
162 }; |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
163 |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
164 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
|
165 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
|
166 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
|
167 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
|
168 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
|
169 } |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
170 |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
171 |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
172 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
|
173 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
|
174 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
|
175 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
|
176 ) { |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
177 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
|
178 } |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
179 |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
180 |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
181 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
|
182 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
|
183 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
|
184 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
|
185 ) { |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
186 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
|
187 } |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
188 |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
189 |
4466
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
190 protected String buildDischargeName( |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
191 FLYSArtifact flys, |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
192 CallContext cc, |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
193 FlowVelocityData data |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
194 ) { |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
195 return buildFacetName(flys, cc, data, I18N_DISCHARGE_FACET); |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
196 } |
4d856f11e527
FlowVelocityState: Create new discharge facet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4433
diff
changeset
|
197 |
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
|
198 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
|
199 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
|
200 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
|
201 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
|
202 ) { |
d8444fcb4e44
Create chart facets for flow velocity calculation and a chart generator for this.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2702
diff
changeset
|
203 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
|
204 } |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
205 } |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
206 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |