Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java @ 9609:8232a3f5967b
#20 SinfoResultType
author | dnt_bjoernsen <d.tironi@bjoernsen.de> |
---|---|
date | Wed, 09 Oct 2019 15:43:39 +0200 |
parents | 8b457ca70512 |
children | d889ffe2fb05 |
rev | line source |
---|---|
8948 | 1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 package org.dive4elements.river.artifacts.sinfo.common; | |
11 | |
12 import java.text.NumberFormat; | |
9609 | 13 import java.text.ParseException; |
8948 | 14 |
15 import org.apache.commons.lang.StringUtils; | |
9490
e44c1a8b0c54
Fixed: rounding problems in iota/salix scenario calculation
mschaefer
parents:
9429
diff
changeset
|
16 import org.apache.log4j.Logger; |
8948 | 17 import org.dive4elements.artifacts.CallContext; |
9000 | 18 import org.dive4elements.river.artifacts.common.AbstractResultType; |
19 import org.dive4elements.river.artifacts.common.I18NStrings; | |
8948 | 20 import org.dive4elements.river.artifacts.resources.Resources; |
21 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.SoilKind; | |
9229
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
22 import org.dive4elements.river.model.Attribute.AttributeKey; |
8948 | 23 import org.dive4elements.river.utils.Formatter; |
24 import org.dive4elements.river.utils.RiverUtils; | |
25 | |
26 /** | |
27 * Result type for data that goes into {@link SInfoResultRow}s. | |
28 * | |
29 * @author Gernot Belger | |
30 */ | |
9000 | 31 public abstract class SInfoResultType extends AbstractResultType { |
8948 | 32 |
9006 | 33 private static final long serialVersionUID = 1L; |
34 | |
9490
e44c1a8b0c54
Fixed: rounding problems in iota/salix scenario calculation
mschaefer
parents:
9429
diff
changeset
|
35 protected static Logger log = Logger.getLogger(SInfoResultType.class); |
e44c1a8b0c54
Fixed: rounding problems in iota/salix scenario calculation
mschaefer
parents:
9429
diff
changeset
|
36 |
9429
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9318
diff
changeset
|
37 protected SInfoResultType(final String unit, final String csvHeader) { |
9000 | 38 super(unit, csvHeader, csvHeader); |
39 } | |
8948 | 40 |
9429
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9318
diff
changeset
|
41 protected SInfoResultType(final String unit, final String csvHeader, final String pdfHeader) { |
9000 | 42 super(unit, csvHeader, pdfHeader); |
43 } | |
8948 | 44 |
9145 | 45 public static final SInfoResultType customMultiRowColWaterlevel = new SInfoResultType(null, SInfoI18NStrings.CSV_WATERLEVEL_HEADER, |
46 "sinfo.export.flow_depth.pdf.header.waterlevel") { | |
47 private static final long serialVersionUID = 1L; | |
48 | |
49 @Override | |
50 public String exportValue(final CallContext context, final Object value) { | |
9205
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9202
diff
changeset
|
51 throw new UnsupportedOperationException(); |
9145 | 52 } |
53 | |
54 @Override | |
55 protected NumberFormat createFormatter(final CallContext context) { | |
9205
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9202
diff
changeset
|
56 throw new UnsupportedOperationException(); |
9145 | 57 } |
58 | |
59 }; | |
60 | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
61 public static final SInfoResultType floodDischarge = new SInfoResultType(I18NStrings.UNIT_CUBIC_M, "sinfo.export.flood_duration.csv.header.discharge", |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
62 "sinfo.export.flood_duration.pdf.header.discharge") { |
9145 | 63 private static final long serialVersionUID = 1L; |
64 | |
65 @Override | |
66 public String exportValue(final CallContext context, final Object value) { | |
67 final double doubleValue = asDouble(value); | |
9609 | 68 final String significant = Formatter.SIGINIFICANT_FORMATTER_3.format(doubleValue); |
69 try { | |
70 final Number significantD = Formatter.SIGINIFICANT_FORMATTER_3.parse(significant); | |
71 return exportDoubleValue(context, asDouble(significantD)); | |
72 } | |
73 catch (final ParseException e) { | |
74 e.printStackTrace(); | |
75 return ""; | |
76 } | |
9145 | 77 } |
78 | |
79 @Override | |
80 protected NumberFormat createFormatter(final CallContext context) { | |
9609 | 81 return Formatter.getFormatter(context, 0, 3); |
9145 | 82 } |
83 }; | |
84 | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
85 public static final SInfoResultType floodDuration = new SInfoResultType(null, "sinfo.export.flood_duration.csv.header.duration", |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
86 "sinfo.export.flood_duration.pdf.header.duration") { |
9145 | 87 private static final long serialVersionUID = 1L; |
88 | |
89 @Override | |
90 public String exportValue(final CallContext context, final Object value) { | |
91 final double doubleValue = asDouble(value); | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
92 return exportDoubleValue(context, doubleValue); |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
93 } |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
94 |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
95 @Override |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
96 protected NumberFormat createFormatter(final CallContext context) { |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
97 return Formatter.getIntegerFormatter(context); |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
98 } |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
99 }; |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
100 |
9000 | 101 public static final SInfoResultType waterlevel = new SInfoResultType(null, SInfoI18NStrings.CSV_WATERLEVEL_HEADER, |
102 "sinfo.export.flow_depth.pdf.header.waterlevel") { | |
9006 | 103 private static final long serialVersionUID = 1L; |
104 | |
8948 | 105 @Override |
106 public String exportValue(final CallContext context, final Object value) { | |
107 final double doubleValue = asDouble(value); | |
108 return exportDoubleValue(context, doubleValue); | |
109 } | |
110 | |
111 @Override | |
112 protected NumberFormat createFormatter(final CallContext context) { | |
113 // REMARK: other modules use Formatter.getWaterlevelW(context) instead, but that format with a variable number of | |
114 // digits. | |
115 return Formatter.getFlowDepth(context); | |
116 } | |
9000 | 117 }; |
8948 | 118 |
9609 | 119 // TODO: check, if it is being used correctly |
9318
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
120 public static final SInfoResultType infrastructuretype = new SInfoResultType(I18NStrings.UNIT_NONE, |
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
121 "sinfo.export.flood_duration.csv.header.infrastructure_type", "sinfo.export.flood_duration.pdf.header.infrastructure_type") { |
9006 | 122 private static final long serialVersionUID = 1L; |
123 | |
8948 | 124 @Override |
125 public String exportValue(final CallContext context, final Object value) { | |
126 return exportStringValue(value); | |
127 } | |
128 | |
129 @Override | |
130 protected NumberFormat createFormatter(final CallContext context) { | |
131 throw new UnsupportedOperationException(); | |
132 } | |
9000 | 133 }; |
9609 | 134 // |
135 public static final SInfoResultType infrastructurepart = new SInfoResultType(I18NStrings.UNIT_NONE, | |
136 "sinfo.export.flood_duration.csv.header.infrastructure_part", "sinfo.export.flood_duration.pdf.header.infrastructure_part") { | |
137 private static final long serialVersionUID = 1L; | |
138 | |
139 @Override | |
140 public String exportValue(final CallContext context, final Object value) { | |
141 return exportStringValue(value); | |
142 } | |
143 | |
144 @Override | |
145 protected NumberFormat createFormatter(final CallContext context) { | |
146 throw new UnsupportedOperationException(); | |
147 } | |
148 }; | |
8948 | 149 |
9318
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
150 public static final SInfoResultType dischargeLong = new SInfoResultType(I18NStrings.UNIT_CUBIC_M, "sinfo.export.collision.csv.header.discharge_long") { |
9145 | 151 private static final long serialVersionUID = 1L; |
152 | |
153 @Override | |
154 public String exportValue(final CallContext context, final Object value) { | |
9318
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
155 final double doubleValue = asDouble(value); |
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
156 final double roundedDischarge = RiverUtils.roundQ(doubleValue); |
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
157 return exportDoubleValue(context, roundedDischarge); |
9145 | 158 } |
159 | |
160 @Override | |
161 protected NumberFormat createFormatter(final CallContext context) { | |
9318
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
162 return Formatter.getWaterlevelQ(context); |
9145 | 163 } |
164 }; | |
165 | |
9000 | 166 public static final SInfoResultType discharge = new SInfoResultType(I18NStrings.UNIT_CUBIC_M, SInfoI18NStrings.CSV_DISCHARGE_HEADER) { |
9006 | 167 private static final long serialVersionUID = 1L; |
168 | |
8948 | 169 @Override |
170 public String exportValue(final CallContext context, final Object value) { | |
171 final double doubleValue = asDouble(value); | |
172 final double roundedDischarge = RiverUtils.roundQ(doubleValue); | |
173 return exportDoubleValue(context, roundedDischarge); | |
174 } | |
175 | |
176 @Override | |
177 protected NumberFormat createFormatter(final CallContext context) { | |
178 return Formatter.getWaterlevelQ(context); | |
179 } | |
9000 | 180 }; |
8948 | 181 |
9202
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
182 public static final SInfoResultType discharge1 = new SInfoResultType(I18NStrings.UNIT_CUBIC_M, "sinfo.flood_duration.header.mainvalue.1.q", |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
183 "sinfo.flood_duration.header.pdf.mainvalue.1.q") { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
184 private static final long serialVersionUID = 1L; |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
185 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
186 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
187 public String exportValue(final CallContext context, final Object value) { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
188 final double doubleValue = asDouble(value); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
189 final double roundedDischarge = RiverUtils.roundQ(doubleValue); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
190 return exportDoubleValue(context, roundedDischarge); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
191 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
192 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
193 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
194 protected NumberFormat createFormatter(final CallContext context) { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
195 return Formatter.getWaterlevelQ(context); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
196 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
197 }; |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
198 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
199 public static final SInfoResultType discharge2 = new SInfoResultType(I18NStrings.UNIT_CUBIC_M, "sinfo.flood_duration.header.mainvalue.2.q", |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
200 "sinfo.flood_duration.header.pdf.mainvalue.2.q") { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
201 private static final long serialVersionUID = 1L; |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
202 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
203 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
204 public String exportValue(final CallContext context, final Object value) { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
205 final double doubleValue = asDouble(value); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
206 final double roundedDischarge = RiverUtils.roundQ(doubleValue); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
207 return exportDoubleValue(context, roundedDischarge); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
208 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
209 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
210 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
211 protected NumberFormat createFormatter(final CallContext context) { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
212 return Formatter.getWaterlevelQ(context); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
213 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
214 }; |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
215 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
216 public static final SInfoResultType discharge3 = new SInfoResultType(I18NStrings.UNIT_CUBIC_M, "sinfo.flood_duration.header.mainvalue.3.q", |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
217 "sinfo.flood_duration.header.pdf.mainvalue.3.q") { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
218 private static final long serialVersionUID = 1L; |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
219 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
220 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
221 public String exportValue(final CallContext context, final Object value) { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
222 final double doubleValue = asDouble(value); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
223 final double roundedDischarge = RiverUtils.roundQ(doubleValue); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
224 return exportDoubleValue(context, roundedDischarge); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
225 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
226 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
227 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
228 protected NumberFormat createFormatter(final CallContext context) { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
229 return Formatter.getWaterlevelQ(context); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
230 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
231 }; |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
232 |
9609 | 233 public static final SInfoResultType maxBedHeight = new SInfoResultType(null, null, null) { |
234 private static final long serialVersionUID = 1L; | |
235 | |
236 @Override | |
237 public String exportValue(final CallContext context, final Object value) { | |
238 final double doubleValue = asDouble(value); | |
239 return exportDoubleValue(context, doubleValue); | |
240 } | |
241 | |
242 @Override | |
243 protected NumberFormat createFormatter(final CallContext context) { | |
244 return Formatter.getMeanBedHeight(context); | |
245 } | |
246 }; | |
247 | |
248 public static final SInfoResultType minBedHeight = new SInfoResultType(null, null, null) { | |
249 private static final long serialVersionUID = 1L; | |
250 | |
251 @Override | |
252 public String exportValue(final CallContext context, final Object value) { | |
253 final double doubleValue = asDouble(value); | |
254 return exportDoubleValue(context, doubleValue); | |
255 } | |
256 | |
257 @Override | |
258 protected NumberFormat createFormatter(final CallContext context) { | |
259 return Formatter.getMeanBedHeight(context); | |
260 } | |
261 }; | |
262 | |
9000 | 263 public static final SInfoResultType meanBedHeight = new SInfoResultType(null, SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_HEADER, |
264 SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_HEADER_SHORT) { | |
9006 | 265 private static final long serialVersionUID = 1L; |
266 | |
8948 | 267 @Override |
268 public String exportValue(final CallContext context, final Object value) { | |
269 final double doubleValue = asDouble(value); | |
270 return exportDoubleValue(context, doubleValue); | |
271 } | |
272 | |
273 @Override | |
274 protected NumberFormat createFormatter(final CallContext context) { | |
275 return Formatter.getMeanBedHeight(context); | |
276 } | |
9000 | 277 }; |
8948 | 278 |
9000 | 279 public static final SInfoResultType soundingLabel = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_SOUNDING_HEADER) { |
9006 | 280 private static final long serialVersionUID = 1L; |
281 | |
8948 | 282 @Override |
283 public String exportValue(final CallContext context, final Object value) { | |
284 return exportStringValue(value); | |
285 } | |
286 | |
287 @Override | |
288 protected NumberFormat createFormatter(final CallContext context) { | |
289 throw new UnsupportedOperationException(); | |
290 } | |
9000 | 291 }; |
292 public static final SInfoResultType flowdepthDevelopmentPerYear = new SInfoResultType(I18NStrings.UNIT_CM_A, | |
9287 | 293 SInfoI18NStrings.CSV_FLOWDEPTH_DEVELOPMENT_PER_YEAR_HEADER, "sinfo.export.pdf.header.flowdepth.development.per.year") { |
9006 | 294 private static final long serialVersionUID = 1L; |
295 | |
9000 | 296 @Override |
297 public String exportValue(final CallContext context, final Object value) { | |
298 final double doubleValue = asDouble(value); | |
299 return exportDoubleValue(context, doubleValue); | |
300 } | |
8948 | 301 |
9000 | 302 @Override |
303 protected NumberFormat createFormatter(final CallContext context) { | |
304 return Formatter.getFlowDepthDevelopmentPerYear(context); | |
305 } | |
306 }; | |
307 | |
308 public static final SInfoResultType flowdepthmin = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_MIN_HEADER) { | |
9006 | 309 private static final long serialVersionUID = 1L; |
310 | |
8948 | 311 @Override |
312 public String exportValue(final CallContext context, final Object value) { | |
313 final double doubleValue = asDouble(value); | |
314 return exportDoubleValue(context, doubleValue); | |
315 } | |
316 | |
317 @Override | |
318 protected NumberFormat createFormatter(final CallContext context) { | |
319 return Formatter.getFlowDepth(context); | |
320 } | |
9000 | 321 }; |
8948 | 322 |
9000 | 323 public static final SInfoResultType flowdepthmax = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_MAX_HEADER) { |
9006 | 324 private static final long serialVersionUID = 1L; |
325 | |
8948 | 326 @Override |
327 public String exportValue(final CallContext context, final Object value) { | |
328 final double doubleValue = asDouble(value); | |
329 return exportDoubleValue(context, doubleValue); | |
330 } | |
331 | |
332 @Override | |
333 protected NumberFormat createFormatter(final CallContext context) { | |
334 return Formatter.getFlowDepth(context); | |
335 } | |
9000 | 336 }; |
8948 | 337 |
9609 | 338 public static final SInfoResultType riverside = new SInfoResultType(I18NStrings.UNIT_NONE, "sinfo.export.flood_duration.csv.header.riverside", |
339 "sinfo.export.flood_duration.pdf.header.riverside") { | |
9145 | 340 private static final long serialVersionUID = 1L; |
341 | |
342 @Override | |
343 public String exportValue(final CallContext context, final Object value) { | |
9229
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
344 return localizeRiverside(context, (AttributeKey) value); |
9145 | 345 } |
346 | |
347 @Override | |
348 protected NumberFormat createFormatter(final CallContext context) { | |
349 throw new UnsupportedOperationException(); | |
350 } | |
351 }; | |
352 | |
9229
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
353 /** |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
354 * Returns the localized text of a riverside |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
355 * FIXME: Find a better place for this common method |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
356 */ |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
357 public static final String localizeRiverside(final CallContext context, final AttributeKey riverside) { |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
358 if (riverside == AttributeKey.LEFT) |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
359 return Resources.getMsg(context.getMeta(), "riverside.left"); |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
360 else if (riverside == AttributeKey.RIGHT) |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
361 return Resources.getMsg(context.getMeta(), "riverside.right"); |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
362 else |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
363 return "?"; |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
364 } |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
365 |
9000 | 366 public static final SInfoResultType soilkind = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_TKHKIND_HEADER, |
367 "sinfo.export.tkh.pdf.header.tkhkind") { | |
9006 | 368 private static final long serialVersionUID = 1L; |
369 | |
8948 | 370 @Override |
371 public String exportValue(final CallContext context, final Object value) { | |
372 | |
373 if (value == null) | |
374 return StringUtils.EMPTY; | |
375 | |
376 final SoilKind kind = (SoilKind) value; | |
377 | |
378 final String key = SInfoI18NStrings.PREFIX_TKH_KIND + kind.name(); | |
379 return Resources.getMsg(context.getMeta(), key, key); | |
380 } | |
381 | |
382 @Override | |
383 protected NumberFormat createFormatter(final CallContext context) { | |
384 throw new UnsupportedOperationException(); | |
385 } | |
9000 | 386 }; |
8950
b0aeed4c97c1
Implemented chart output for sinfo flow depth min/max calculation
gernotbelger
parents:
8949
diff
changeset
|
387 |
9000 | 388 public static final SInfoResultType flowdepth = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_HEADER) { |
9006 | 389 private static final long serialVersionUID = 1L; |
390 | |
8951 | 391 @Override |
392 public String exportValue(final CallContext context, final Object value) { | |
393 final double doubleValue = asDouble(value); | |
394 return exportDoubleValue(context, doubleValue); | |
395 } | |
396 | |
397 @Override | |
398 protected NumberFormat createFormatter(final CallContext context) { | |
399 return Formatter.getFlowDepth(context); | |
400 } | |
8948 | 401 }; |
402 | |
9000 | 403 public static final SInfoResultType d50 = new SInfoResultType(null, null) { |
9006 | 404 private static final long serialVersionUID = 1L; |
405 | |
9000 | 406 @Override |
407 public String exportValue(final CallContext context, final Object value) { | |
408 final double doubleValue = asDouble(value); | |
409 return exportDoubleValue(context, doubleValue); | |
410 } | |
8948 | 411 |
9000 | 412 @Override |
413 protected NumberFormat createFormatter(final CallContext context) { | |
414 throw new UnsupportedOperationException(); | |
415 } | |
416 }; | |
8948 | 417 |
9000 | 418 public static final SInfoResultType velocity = new SInfoResultType(null, null) { |
9006 | 419 private static final long serialVersionUID = 1L; |
420 | |
9000 | 421 @Override |
422 public String exportValue(final CallContext context, final Object value) { | |
423 final double doubleValue = asDouble(value); | |
424 return exportDoubleValue(context, doubleValue); | |
425 } | |
8948 | 426 |
9000 | 427 @Override |
428 protected NumberFormat createFormatter(final CallContext context) { | |
429 throw new UnsupportedOperationException(); | |
430 } | |
431 }; | |
8948 | 432 |
9000 | 433 public static final SInfoResultType tau = new SInfoResultType(null, null) { |
9006 | 434 private static final long serialVersionUID = 1L; |
435 | |
9000 | 436 @Override |
437 public String exportValue(final CallContext context, final Object value) { | |
438 final double doubleValue = asDouble(value); | |
439 return exportDoubleValue(context, doubleValue); | |
440 } | |
8949
09e4a4909814
Distinguish between csv and pdf column headers
gernotbelger
parents:
8948
diff
changeset
|
441 |
9000 | 442 @Override |
443 protected NumberFormat createFormatter(final CallContext context) { | |
444 throw new UnsupportedOperationException(); | |
445 } | |
446 }; | |
447 | |
448 public static final SInfoResultType tkh = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_TKH_HEADER, SInfoI18NStrings.CSV_TKH_HEADER_SHORT) { | |
9006 | 449 private static final long serialVersionUID = 1L; |
450 | |
9000 | 451 @Override |
452 public String exportValue(final CallContext context, final Object value) { | |
453 final double doubleValue = asDouble(value); | |
454 return exportDoubleValue(context, doubleValue); | |
455 } | |
456 | |
457 @Override | |
458 protected NumberFormat createFormatter(final CallContext context) { | |
459 return Formatter.getTkh(context); | |
460 } | |
461 }; | |
462 | |
463 public static final SInfoResultType tkhup = new SInfoResultType(I18NStrings.UNIT_M, null) { | |
9006 | 464 private static final long serialVersionUID = 1L; |
465 | |
9000 | 466 @Override |
467 public String exportValue(final CallContext context, final Object value) { | |
468 final double doubleValue = asDouble(value); | |
469 return exportDoubleValue(context, doubleValue); | |
470 } | |
471 | |
472 @Override | |
473 protected NumberFormat createFormatter(final CallContext context) { | |
474 throw new UnsupportedOperationException(); | |
475 } | |
476 }; | |
477 | |
478 public static final SInfoResultType tkhdown = new SInfoResultType(I18NStrings.UNIT_M, null) { | |
9006 | 479 private static final long serialVersionUID = 1L; |
480 | |
9000 | 481 @Override |
482 public String exportValue(final CallContext context, final Object value) { | |
483 final double doubleValue = asDouble(value); | |
484 return exportDoubleValue(context, doubleValue); | |
485 } | |
486 | |
487 @Override | |
488 protected NumberFormat createFormatter(final CallContext context) { | |
489 throw new UnsupportedOperationException(); | |
490 } | |
491 }; | |
492 | |
493 public static final SInfoResultType flowdepthtkh = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTHTKH_HEADER) { | |
9006 | 494 private static final long serialVersionUID = 1L; |
495 | |
9000 | 496 @Override |
497 public String exportValue(final CallContext context, final Object value) { | |
498 final double doubleValue = asDouble(value); | |
499 return exportDoubleValue(context, doubleValue); | |
500 } | |
501 | |
502 @Override | |
503 protected NumberFormat createFormatter(final CallContext context) { | |
504 return Formatter.getFlowDepth(context); | |
505 } | |
506 }; | |
507 | |
9112
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
508 public static final SInfoResultType channelWidth = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_CHANNEL_WIDTH_HEADER) { |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
509 private static final long serialVersionUID = 1L; |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
510 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
511 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
512 public String exportValue(final CallContext context, final Object value) { |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
513 final double doubleValue = asDouble(value); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
514 return exportDoubleValue(context, doubleValue); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
515 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
516 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
517 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
518 protected NumberFormat createFormatter(final CallContext context) { |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
519 return Formatter.getChannelWidth(context); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
520 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
521 }; |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
522 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
523 public static final SInfoResultType channelDepth = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_CHANNEL_DEPTH_HEADER) { |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
524 private static final long serialVersionUID = 1L; |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
525 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
526 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
527 public String exportValue(final CallContext context, final Object value) { |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
528 final double doubleValue = asDouble(value); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
529 return exportDoubleValue(context, doubleValue); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
530 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
531 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
532 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
533 protected NumberFormat createFormatter(final CallContext context) { |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
534 return Formatter.getChannelDepth(context); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
535 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
536 }; |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
537 |
9287 | 538 public static final SInfoResultType flowdepthDevelopment = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_FLOWDEPTH_DEVELOPMENT_HEADER, |
9000 | 539 SInfoI18NStrings.PDF_FLOWDEPTH_DEVELOPMENT_HEADER) { |
9006 | 540 private static final long serialVersionUID = 1L; |
541 | |
9000 | 542 @Override |
543 public String exportValue(final CallContext context, final Object value) { | |
544 final double doubleValue = asDouble(value); | |
545 return exportDoubleValue(context, doubleValue); | |
546 } | |
547 | |
548 @Override | |
549 protected NumberFormat createFormatter(final CallContext context) { | |
550 return Formatter.getTkh(context); | |
551 } | |
552 }; | |
553 | |
9287 | 554 public static final SInfoResultType waterlevelDifference = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_WATERLEVEL_DIFFERENCE_HEADER, |
555 SInfoI18NStrings.CSV_WATERLEVEL_DIFFERENCE_HEADER) { | |
9006 | 556 private static final long serialVersionUID = 1L; |
557 | |
9000 | 558 @Override |
559 public String exportValue(final CallContext context, final Object value) { | |
560 final double doubleValue = asDouble(value); | |
561 return exportDoubleValue(context, doubleValue); | |
562 } | |
563 | |
564 @Override | |
565 protected NumberFormat createFormatter(final CallContext context) { | |
566 return Formatter.getTkh(context); | |
567 } | |
568 }; | |
9287 | 569 public static final SInfoResultType bedHeightDifference = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_DIFFERENCE_HEADER, |
9109 | 570 "sinfo.export.csv.header.mean_bed_height.difference") { |
9006 | 571 private static final long serialVersionUID = 1L; |
572 | |
9000 | 573 @Override |
574 public String exportValue(final CallContext context, final Object value) { | |
575 final double doubleValue = asDouble(value); | |
576 return exportDoubleValue(context, doubleValue); | |
577 } | |
578 | |
579 @Override | |
580 protected NumberFormat createFormatter(final CallContext context) { | |
581 return Formatter.getTkh(context); | |
582 } | |
583 }; | |
584 public static final SInfoResultType flowdepthCurrent = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_CURRENT_HEADER) { | |
9006 | 585 private static final long serialVersionUID = 1L; |
586 | |
9000 | 587 @Override |
588 public String exportValue(final CallContext context, final Object value) { | |
589 final double doubleValue = asDouble(value); | |
590 return exportDoubleValue(context, doubleValue); | |
591 } | |
592 | |
593 @Override | |
594 protected NumberFormat createFormatter(final CallContext context) { | |
595 return Formatter.getFlowDepth(context); | |
596 } | |
597 }; | |
598 public static final SInfoResultType flowdepthHistorical = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_HISTORICAL_HEADER) { | |
9006 | 599 private static final long serialVersionUID = 1L; |
600 | |
9000 | 601 @Override |
602 public String exportValue(final CallContext context, final Object value) { | |
603 final double doubleValue = asDouble(value); | |
604 return exportDoubleValue(context, doubleValue); | |
605 } | |
606 | |
607 @Override | |
608 protected NumberFormat createFormatter(final CallContext context) { | |
609 return Formatter.getFlowDepth(context); | |
610 } | |
611 }; | |
612 | |
9202
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
613 public static final SInfoResultType infrastructureHeight = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_INFRASTRUCTURE_HEIGHT_HEADER, |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
614 SInfoI18NStrings.PDF_INFRASTRUCTURE_HEIGHT_HEADER) { |
9115
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
615 private static final long serialVersionUID = 1L; |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
616 |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
617 @Override |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
618 public String exportValue(final CallContext context, final Object value) { |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
619 final double doubleValue = asDouble(value); |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
620 return exportDoubleValue(context, doubleValue); |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
621 } |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
622 |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
623 @Override |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
624 protected NumberFormat createFormatter(final CallContext context) { |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
625 return Formatter.getInfrastructureHeight(context); |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
626 } |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
627 }; |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
628 |
9117
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
629 public static final SInfoResultType collisionCount = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_COLLISION_COUNT_HEADER) { |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
630 private static final long serialVersionUID = 1L; |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
631 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
632 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
633 public String exportValue(final CallContext context, final Object value) { |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
634 final double doubleValue = asDouble(value); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
635 return exportDoubleValue(context, doubleValue); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
636 } |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
637 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
638 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
639 protected NumberFormat createFormatter(final CallContext context) { |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
640 return Formatter.getCollisionCount(context); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
641 } |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
642 }; |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
643 |
9582 | 644 public static final SInfoResultType collisionGaugeW = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_COLLISION_GAUGEW_HEADER, |
645 "sinfo.export.pdf.header.collision.gaugew.with_unit") { | |
9117
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
646 private static final long serialVersionUID = 1L; |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
647 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
648 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
649 public String exportValue(final CallContext context, final Object value) { |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
650 final double doubleValue = asDouble(value); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
651 return exportDoubleValue(context, doubleValue); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
652 } |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
653 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
654 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
655 protected NumberFormat createFormatter(final CallContext context) { |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
656 return Formatter.getCollisionGaugeW(context); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
657 } |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
658 }; |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
659 |
9157
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
660 public static final SInfoResultType years = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_YEARS_HEADER) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
661 private static final long serialVersionUID = 1L; |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
662 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
663 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
664 public String exportValue(final CallContext context, final Object value) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
665 return exportStringValue(value); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
666 } |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
667 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
668 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
669 protected NumberFormat createFormatter(final CallContext context) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
670 throw new UnsupportedOperationException(); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
671 } |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
672 }; |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
673 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
674 public static final SInfoResultType dischargeZone = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_DISCHARGE_ZONE_HEADER) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
675 private static final long serialVersionUID = 1L; |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
676 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
677 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
678 public String exportValue(final CallContext context, final Object value) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
679 return exportStringValue(value); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
680 } |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
681 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
682 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
683 protected NumberFormat createFormatter(final CallContext context) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
684 throw new UnsupportedOperationException(); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
685 } |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
686 }; |
8948 | 687 } |