annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/GaugeDischargeState.java @ 5461:16c14e5ab00f

merge
author Tom Gottfried <tom.gottfried@intevation.de>
date Wed, 27 Mar 2013 15:38:07 +0100
parents 94d78e0dc5e9
children
rev   line source
2723
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts.states;
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
2
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
3 import java.util.List;
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
4
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
5 import org.apache.log4j.Logger;
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
6
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
7 import de.intevation.artifacts.CallMeta;
2734
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
8 import de.intevation.artifacts.CallContext;
2723
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
9
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10 import de.intevation.artifactdatabase.state.Facet;
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
11
2734
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
12 import de.intevation.flys.artifacts.ChartArtifact;
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
13 import de.intevation.flys.artifacts.GaugeDischargeArtifact;
2723
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
14 import de.intevation.flys.artifacts.FLYSArtifact;
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
15
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
16 import de.intevation.flys.artifacts.model.GaugeDischargeFacet;
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
17 import de.intevation.flys.artifacts.model.FacetTypes;
2734
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
18 import de.intevation.flys.artifacts.model.WQKms;
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
19 import de.intevation.flys.artifacts.model.ReportFacet;
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
20 import de.intevation.flys.artifacts.model.EmptyFacet;
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
21 import de.intevation.flys.artifacts.model.CalculationResult;
2723
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
22
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
23 import de.intevation.flys.artifacts.resources.Resources;
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
24
3051
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
25 import de.intevation.flys.model.Gauge;
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
26
2723
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
27
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
28 /**
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
29 * The only state for an GaugeDischargeState (River and km known).
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
30 */
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
31 public class GaugeDischargeState
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
32 extends DefaultState
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
33 implements FacetTypes
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
34 {
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
35 /** Developer-centric description of facet. */
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
36 public static final String I18N_DESCRIPTION = "facet.discharge.curve";
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
37
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
38 /** The logger that is used in this state. */
3051
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
39 private static final Logger logger =
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
40 Logger.getLogger(GaugeDischargeState.class);
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
41
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
42
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
43 /**
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
44 * Create i18ned name for gaugedischargeFacet.
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
45 * @param artifact The artifact which has information about the gauge.
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
46 * @param meta used for i18n.
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
47 * @return localized name for gaugedischargefacet.
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
48 */
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
49 protected String createFacetName(GaugeDischargeArtifact artifact,
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
50 CallMeta meta) {
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
51
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
52 Gauge gauge = artifact.getGauge();
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
53 Object[] args = new Object[] {
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
54 gauge.getName(),
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
55 gauge.getStation()
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
56 };
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
57
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
58 String name = Resources.getMsg(
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
59 meta,
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
60 "chart.computed.discharge.curve.gauge",
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
61 "",
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
62 args);
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
63
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
64 return name;
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
65 }
2723
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
66
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
67
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
68 /**
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
69 * Add an GaugeDischargeFacet to list of Facets.
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
70 *
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
71 * @param artifact Ignored.
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
72 * @param hash Ignored.
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
73 * @param context Ignored.
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
74 * @param meta CallMeta to be used for internationalization.
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
75 * @param facets List to add AnnotationFacet to.
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
76 *
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
77 * @return null.
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
78 */
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
79 @Override
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
80 public Object computeInit(
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
81 FLYSArtifact artifact,
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
82 String hash,
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
83 Object context,
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
84 CallMeta meta,
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
85 List<Facet> facets
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
86 ) {
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
87 logger.debug("GaugeDischargeState.computeInit()");
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
88
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
89 GaugeDischargeFacet facet = new GaugeDischargeFacet(
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
90 0,
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
91 DISCHARGE_CURVE,
3051
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
92 createFacetName((GaugeDischargeArtifact) artifact, meta));
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
93
2723
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
94 facets.add(facet);
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
95
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
96 return null;
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
97 }
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
98
2734
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
99
3051
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
100 /**
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
101 * 'Calculate' Discharge at Gauge.
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
102 */
2734
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
103 @Override
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
104 public Object computeAdvance(
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
105 FLYSArtifact artifact,
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
106 String hash,
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
107 CallContext context,
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
108 List<Facet> facets,
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
109 Object old
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
110 ) {
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
111 if (artifact instanceof GaugeDischargeArtifact) {
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
112 logger.debug("GaugeDischargeState.computeAdvance()");
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
113 GaugeDischargeArtifact dischargeArtifact = (GaugeDischargeArtifact) artifact;
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
114
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
115 CalculationResult res;
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
116
3053
bb576facbe50 Use cache.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3051
diff changeset
117
bb576facbe50 Use cache.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3051
diff changeset
118 if (old instanceof CalculationResult) {
2734
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
119 res = (CalculationResult) old;
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
120 }
3053
bb576facbe50 Use cache.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3051
diff changeset
121 else {
2734
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
122 res = dischargeArtifact.getDischargeCurveData();
3053
bb576facbe50 Use cache.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3051
diff changeset
123 }
2734
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
124
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
125 WQKms[] wqkms = (WQKms[]) res.getData();
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
126
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
127 if (wqkms != null && facets != null) {
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
128 logger.debug("GaugeDischargeState.computeAdvance(): create facets");
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
129
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
130 GaugeDischargeFacet facet = new GaugeDischargeFacet(
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
131 0,
3051
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
132 DISCHARGE_CURVE,
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
133 createFacetName(dischargeArtifact, context.getMeta()));
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
134
2734
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
135 facets.add(facet);
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
136
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
137 //facets.add(new DataFacet(CSV, "CSV data"));
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
138 //facets.add(new DataFacet(PDF, "PDF data"));
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
139
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
140 if (res.getReport().hasProblems()) {
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
141 facets.add(new ReportFacet());
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
142 }
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
143 }
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
144 else {
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
145 if (wqkms == null)
3051
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
146 logger.debug("GaugeDischargeState.computeAdvance(): wqkms 0");
2734
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
147 else
3051
49727e9dcfde Polished Gauge Discharges in computed discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2734
diff changeset
148 logger.debug("GaugeDischargeState.computeAdvance(): facets 0");
2734
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
149 }
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
150
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
151 return res;
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
152 }
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
153 else if (artifact instanceof ChartArtifact) {
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
154 ChartArtifact chart = (ChartArtifact)artifact;
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
155 facets.add(new EmptyFacet());
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
156 return null;
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
157 }
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
158 return null;
89731cb8c385 More debugging of discharge curve issue.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2723
diff changeset
159 }
2723
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
160 }
5ce5abd173b9 Added skeleton for gauge discharge curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
161 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org