Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java @ 9176:1614cb14308f
Work on calculations for S-Info flood duration workflow
author | mschaefer |
---|---|
date | Mon, 25 Jun 2018 19:21:11 +0200 |
parents | f9bb5d0a6ff3 |
children | b4402594213b |
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; | |
13 | |
14 import org.apache.commons.lang.StringUtils; | |
15 import org.dive4elements.artifacts.CallContext; | |
9000 | 16 import org.dive4elements.river.artifacts.common.AbstractResultType; |
17 import org.dive4elements.river.artifacts.common.I18NStrings; | |
8948 | 18 import org.dive4elements.river.artifacts.resources.Resources; |
19 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.SoilKind; | |
20 import org.dive4elements.river.utils.Formatter; | |
21 import org.dive4elements.river.utils.RiverUtils; | |
22 | |
23 /** | |
24 * Result type for data that goes into {@link SInfoResultRow}s. | |
25 * | |
26 * @author Gernot Belger | |
27 */ | |
9000 | 28 public abstract class SInfoResultType extends AbstractResultType { |
8948 | 29 |
9006 | 30 private static final long serialVersionUID = 1L; |
31 | |
9000 | 32 private SInfoResultType(final String unit, final String csvHeader) { |
33 super(unit, csvHeader, csvHeader); | |
34 } | |
8948 | 35 |
9000 | 36 private SInfoResultType(final String unit, final String csvHeader, final String pdfHeader) { |
37 super(unit, csvHeader, pdfHeader); | |
38 } | |
8948 | 39 |
9145 | 40 public static final SInfoResultType customMultiRowColWaterlevel = new SInfoResultType(null, SInfoI18NStrings.CSV_WATERLEVEL_HEADER, |
41 "sinfo.export.flow_depth.pdf.header.waterlevel") { | |
42 private static final long serialVersionUID = 1L; | |
43 | |
44 @Override | |
45 public String exportValue(final CallContext context, final Object value) { | |
46 // TODO Auto-generated method stub | |
47 return null; | |
48 } | |
49 | |
50 @Override | |
51 protected NumberFormat createFormatter(final CallContext context) { | |
52 // TODO Auto-generated method stub | |
53 return null; | |
54 } | |
55 | |
56 }; | |
57 | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
58 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
|
59 "sinfo.export.flood_duration.pdf.header.discharge") { |
9145 | 60 private static final long serialVersionUID = 1L; |
61 | |
62 @Override | |
63 public String exportValue(final CallContext context, final Object value) { | |
64 final double doubleValue = asDouble(value); | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
65 return exportDoubleValue(context, doubleValue); |
9145 | 66 } |
67 | |
68 @Override | |
69 protected NumberFormat createFormatter(final CallContext context) { | |
70 return Formatter.getWaterlevelQ(context); | |
71 } | |
72 }; | |
73 | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
74 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
|
75 "sinfo.export.flood_duration.pdf.header.duration") { |
9145 | 76 private static final long serialVersionUID = 1L; |
77 | |
78 @Override | |
79 public String exportValue(final CallContext context, final Object value) { | |
80 final double doubleValue = asDouble(value); | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
81 return exportDoubleValue(context, doubleValue); |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
82 } |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
83 |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
84 @Override |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
85 protected NumberFormat createFormatter(final CallContext context) { |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
86 return Formatter.getIntegerFormatter(context); |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
87 } |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
88 }; |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
89 |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
90 public static final SInfoResultType mainValue1Duration = new SInfoResultType(null, "sinfo.export.main_value_1_duration.csv.header.duration", |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
91 "sinfo.export.main_value_1_duration.pdf.header.duration") { |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
92 private static final long serialVersionUID = 1L; |
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 @Override |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
95 public String exportValue(final CallContext context, final Object value) { |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
96 final double doubleValue = asDouble(value); |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
97 return exportDoubleValue(context, doubleValue); |
9145 | 98 } |
99 | |
100 @Override | |
101 protected NumberFormat createFormatter(final CallContext context) { | |
102 return Formatter.getIntegerFormatter(context); | |
103 } | |
104 }; | |
105 | |
9000 | 106 public static final SInfoResultType waterlevel = new SInfoResultType(null, SInfoI18NStrings.CSV_WATERLEVEL_HEADER, |
107 "sinfo.export.flow_depth.pdf.header.waterlevel") { | |
9006 | 108 private static final long serialVersionUID = 1L; |
109 | |
8948 | 110 @Override |
111 public String exportValue(final CallContext context, final Object value) { | |
112 final double doubleValue = asDouble(value); | |
113 return exportDoubleValue(context, doubleValue); | |
114 } | |
115 | |
116 @Override | |
117 protected NumberFormat createFormatter(final CallContext context) { | |
118 // REMARK: other modules use Formatter.getWaterlevelW(context) instead, but that format with a variable number of | |
119 // digits. | |
120 return Formatter.getFlowDepth(context); | |
121 } | |
9000 | 122 }; |
8948 | 123 |
9000 | 124 public static final SInfoResultType waterlevelLabel = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_LABEL_HEADER) { |
9006 | 125 private static final long serialVersionUID = 1L; |
126 | |
8948 | 127 @Override |
128 public String exportValue(final CallContext context, final Object value) { | |
129 return exportStringValue(value); | |
130 } | |
131 | |
132 @Override | |
133 protected NumberFormat createFormatter(final CallContext context) { | |
134 throw new UnsupportedOperationException(); | |
135 } | |
9000 | 136 }; |
8948 | 137 |
9145 | 138 public static final SInfoResultType infrastructuretype = new SInfoResultType(I18NStrings.UNIT_NONE, |
139 "sinfo.export.flood_duration.csv.header.infrastructure_type", "sinfo.export.flood_duration.pdf.header.infrastructure_type") { | |
140 private static final long serialVersionUID = 1L; | |
141 | |
142 @Override | |
143 public String exportValue(final CallContext context, final Object value) { | |
144 return exportStringValue(value); | |
145 } | |
146 | |
147 @Override | |
148 protected NumberFormat createFormatter(final CallContext context) { | |
149 throw new UnsupportedOperationException(); | |
150 } | |
151 }; | |
152 | |
9000 | 153 public static final SInfoResultType discharge = new SInfoResultType(I18NStrings.UNIT_CUBIC_M, SInfoI18NStrings.CSV_DISCHARGE_HEADER) { |
9006 | 154 private static final long serialVersionUID = 1L; |
155 | |
8948 | 156 @Override |
157 public String exportValue(final CallContext context, final Object value) { | |
158 final double doubleValue = asDouble(value); | |
159 final double roundedDischarge = RiverUtils.roundQ(doubleValue); | |
160 return exportDoubleValue(context, roundedDischarge); | |
161 } | |
162 | |
163 @Override | |
164 protected NumberFormat createFormatter(final CallContext context) { | |
165 return Formatter.getWaterlevelQ(context); | |
166 } | |
9000 | 167 }; |
8948 | 168 |
9000 | 169 public static final SInfoResultType meanBedHeight = new SInfoResultType(null, SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_HEADER, |
170 SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_HEADER_SHORT) { | |
9006 | 171 private static final long serialVersionUID = 1L; |
172 | |
8948 | 173 @Override |
174 public String exportValue(final CallContext context, final Object value) { | |
175 final double doubleValue = asDouble(value); | |
176 return exportDoubleValue(context, doubleValue); | |
177 } | |
178 | |
179 @Override | |
180 protected NumberFormat createFormatter(final CallContext context) { | |
181 return Formatter.getMeanBedHeight(context); | |
182 } | |
9000 | 183 }; |
8948 | 184 |
9000 | 185 public static final SInfoResultType soundingLabel = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_SOUNDING_HEADER) { |
9006 | 186 private static final long serialVersionUID = 1L; |
187 | |
8948 | 188 @Override |
189 public String exportValue(final CallContext context, final Object value) { | |
190 return exportStringValue(value); | |
191 } | |
192 | |
193 @Override | |
194 protected NumberFormat createFormatter(final CallContext context) { | |
195 throw new UnsupportedOperationException(); | |
196 } | |
9000 | 197 }; |
198 public static final SInfoResultType flowdepthDevelopmentPerYear = new SInfoResultType(I18NStrings.UNIT_CM_A, | |
199 SInfoI18NStrings.CSV_FLOWDEPTH_DEVELOPMENT_PER_YEAR_HEADER) { | |
9006 | 200 private static final long serialVersionUID = 1L; |
201 | |
9000 | 202 @Override |
203 public String exportValue(final CallContext context, final Object value) { | |
204 final double doubleValue = asDouble(value); | |
205 return exportDoubleValue(context, doubleValue); | |
206 } | |
8948 | 207 |
9000 | 208 @Override |
209 protected NumberFormat createFormatter(final CallContext context) { | |
210 return Formatter.getFlowDepthDevelopmentPerYear(context); | |
211 } | |
212 }; | |
213 | |
214 public static final SInfoResultType flowdepthmin = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_MIN_HEADER) { | |
9006 | 215 private static final long serialVersionUID = 1L; |
216 | |
8948 | 217 @Override |
218 public String exportValue(final CallContext context, final Object value) { | |
219 final double doubleValue = asDouble(value); | |
220 return exportDoubleValue(context, doubleValue); | |
221 } | |
222 | |
223 @Override | |
224 protected NumberFormat createFormatter(final CallContext context) { | |
225 return Formatter.getFlowDepth(context); | |
226 } | |
9000 | 227 }; |
8948 | 228 |
9000 | 229 public static final SInfoResultType flowdepthmax = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_MAX_HEADER) { |
9006 | 230 private static final long serialVersionUID = 1L; |
231 | |
8948 | 232 @Override |
233 public String exportValue(final CallContext context, final Object value) { | |
234 final double doubleValue = asDouble(value); | |
235 return exportDoubleValue(context, doubleValue); | |
236 } | |
237 | |
238 @Override | |
239 protected NumberFormat createFormatter(final CallContext context) { | |
240 return Formatter.getFlowDepth(context); | |
241 } | |
9000 | 242 }; |
8948 | 243 |
9145 | 244 public static final SInfoResultType riverside = new SInfoResultType(I18NStrings.UNIT_NONE, "sinfo.export.flood_duration.csv.header.riverside") { |
245 private static final long serialVersionUID = 1L; | |
246 | |
247 @Override | |
248 public String exportValue(final CallContext context, final Object value) { | |
249 return exportStringValue(value); | |
250 } | |
251 | |
252 @Override | |
253 protected NumberFormat createFormatter(final CallContext context) { | |
254 throw new UnsupportedOperationException(); | |
255 } | |
256 }; | |
257 | |
9000 | 258 public static final SInfoResultType gaugeLabel = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_GAUGE_HEADER) { |
9006 | 259 private static final long serialVersionUID = 1L; |
260 | |
8948 | 261 @Override |
262 public String exportValue(final CallContext context, final Object value) { | |
263 return exportStringValue(value); | |
264 } | |
265 | |
266 @Override | |
267 protected NumberFormat createFormatter(final CallContext context) { | |
268 throw new UnsupportedOperationException(); | |
269 } | |
9000 | 270 }; |
8948 | 271 |
9000 | 272 public static final SInfoResultType location = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_LOCATION_HEADER) { |
9006 | 273 private static final long serialVersionUID = 1L; |
274 | |
8948 | 275 @Override |
276 public String exportValue(final CallContext context, final Object value) { | |
277 return exportStringValue(value); | |
278 } | |
279 | |
280 @Override | |
281 protected NumberFormat createFormatter(final CallContext context) { | |
282 throw new UnsupportedOperationException(); | |
283 } | |
9000 | 284 }; |
8950
b0aeed4c97c1
Implemented chart output for sinfo flow depth min/max calculation
gernotbelger
parents:
8949
diff
changeset
|
285 |
9000 | 286 public static final SInfoResultType soilkind = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_TKHKIND_HEADER, |
287 "sinfo.export.tkh.pdf.header.tkhkind") { | |
9006 | 288 private static final long serialVersionUID = 1L; |
289 | |
8948 | 290 @Override |
291 public String exportValue(final CallContext context, final Object value) { | |
292 | |
293 if (value == null) | |
294 return StringUtils.EMPTY; | |
295 | |
296 final SoilKind kind = (SoilKind) value; | |
297 | |
298 final String key = SInfoI18NStrings.PREFIX_TKH_KIND + kind.name(); | |
299 return Resources.getMsg(context.getMeta(), key, key); | |
300 } | |
301 | |
302 @Override | |
303 protected NumberFormat createFormatter(final CallContext context) { | |
304 throw new UnsupportedOperationException(); | |
305 } | |
9000 | 306 }; |
8950
b0aeed4c97c1
Implemented chart output for sinfo flow depth min/max calculation
gernotbelger
parents:
8949
diff
changeset
|
307 |
9000 | 308 public static final SInfoResultType flowdepth = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_HEADER) { |
9006 | 309 private static final long serialVersionUID = 1L; |
310 | |
8951 | 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 } | |
8948 | 321 }; |
322 | |
9000 | 323 public static final SInfoResultType d50 = new SInfoResultType(null, null) { |
9006 | 324 private static final long serialVersionUID = 1L; |
325 | |
9000 | 326 @Override |
327 public String exportValue(final CallContext context, final Object value) { | |
328 final double doubleValue = asDouble(value); | |
329 return exportDoubleValue(context, doubleValue); | |
330 } | |
8948 | 331 |
9000 | 332 @Override |
333 protected NumberFormat createFormatter(final CallContext context) { | |
334 throw new UnsupportedOperationException(); | |
335 } | |
336 }; | |
8948 | 337 |
9000 | 338 public static final SInfoResultType velocity = new SInfoResultType(null, null) { |
9006 | 339 private static final long serialVersionUID = 1L; |
340 | |
9000 | 341 @Override |
342 public String exportValue(final CallContext context, final Object value) { | |
343 final double doubleValue = asDouble(value); | |
344 return exportDoubleValue(context, doubleValue); | |
345 } | |
8948 | 346 |
9000 | 347 @Override |
348 protected NumberFormat createFormatter(final CallContext context) { | |
349 throw new UnsupportedOperationException(); | |
350 } | |
351 }; | |
8948 | 352 |
9000 | 353 public static final SInfoResultType tau = new SInfoResultType(null, null) { |
9006 | 354 private static final long serialVersionUID = 1L; |
355 | |
9000 | 356 @Override |
357 public String exportValue(final CallContext context, final Object value) { | |
358 final double doubleValue = asDouble(value); | |
359 return exportDoubleValue(context, doubleValue); | |
360 } | |
8949
09e4a4909814
Distinguish between csv and pdf column headers
gernotbelger
parents:
8948
diff
changeset
|
361 |
9000 | 362 @Override |
363 protected NumberFormat createFormatter(final CallContext context) { | |
364 throw new UnsupportedOperationException(); | |
365 } | |
366 }; | |
367 | |
368 public static final SInfoResultType tkh = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_TKH_HEADER, SInfoI18NStrings.CSV_TKH_HEADER_SHORT) { | |
9006 | 369 private static final long serialVersionUID = 1L; |
370 | |
9000 | 371 @Override |
372 public String exportValue(final CallContext context, final Object value) { | |
373 final double doubleValue = asDouble(value); | |
374 return exportDoubleValue(context, doubleValue); | |
375 } | |
376 | |
377 @Override | |
378 protected NumberFormat createFormatter(final CallContext context) { | |
379 return Formatter.getTkh(context); | |
380 } | |
381 }; | |
382 | |
383 public static final SInfoResultType tkhup = new SInfoResultType(I18NStrings.UNIT_M, null) { | |
9006 | 384 private static final long serialVersionUID = 1L; |
385 | |
9000 | 386 @Override |
387 public String exportValue(final CallContext context, final Object value) { | |
388 final double doubleValue = asDouble(value); | |
389 return exportDoubleValue(context, doubleValue); | |
390 } | |
391 | |
392 @Override | |
393 protected NumberFormat createFormatter(final CallContext context) { | |
394 throw new UnsupportedOperationException(); | |
395 } | |
396 }; | |
397 | |
398 public static final SInfoResultType tkhdown = new SInfoResultType(I18NStrings.UNIT_M, null) { | |
9006 | 399 private static final long serialVersionUID = 1L; |
400 | |
9000 | 401 @Override |
402 public String exportValue(final CallContext context, final Object value) { | |
403 final double doubleValue = asDouble(value); | |
404 return exportDoubleValue(context, doubleValue); | |
405 } | |
406 | |
407 @Override | |
408 protected NumberFormat createFormatter(final CallContext context) { | |
409 throw new UnsupportedOperationException(); | |
410 } | |
411 }; | |
412 | |
413 public static final SInfoResultType flowdepthtkh = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTHTKH_HEADER) { | |
9006 | 414 private static final long serialVersionUID = 1L; |
415 | |
9000 | 416 @Override |
417 public String exportValue(final CallContext context, final Object value) { | |
418 final double doubleValue = asDouble(value); | |
419 return exportDoubleValue(context, doubleValue); | |
420 } | |
421 | |
422 @Override | |
423 protected NumberFormat createFormatter(final CallContext context) { | |
424 return Formatter.getFlowDepth(context); | |
425 } | |
426 }; | |
427 | |
9112
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
428 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
|
429 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
|
430 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
431 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
432 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
|
433 final double doubleValue = asDouble(value); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
434 return exportDoubleValue(context, doubleValue); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
435 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
436 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
437 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
438 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
|
439 return Formatter.getChannelWidth(context); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
440 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
441 }; |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
442 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
443 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
|
444 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
|
445 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
446 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
447 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
|
448 final double doubleValue = asDouble(value); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
449 return exportDoubleValue(context, doubleValue); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
450 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
451 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
452 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
453 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
|
454 return Formatter.getChannelDepth(context); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
455 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
456 }; |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
457 |
9000 | 458 public static final SInfoResultType flowdepthDevelopment = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_DEVELOPMENT_HEADER, |
459 SInfoI18NStrings.PDF_FLOWDEPTH_DEVELOPMENT_HEADER) { | |
9006 | 460 private static final long serialVersionUID = 1L; |
461 | |
9000 | 462 @Override |
463 public String exportValue(final CallContext context, final Object value) { | |
464 final double doubleValue = asDouble(value); | |
465 return exportDoubleValue(context, doubleValue); | |
466 } | |
467 | |
468 @Override | |
469 protected NumberFormat createFormatter(final CallContext context) { | |
470 return Formatter.getTkh(context); | |
471 } | |
472 }; | |
473 | |
474 public static final SInfoResultType depthDevelopmentPerYear = new SInfoResultType(I18NStrings.UNIT_CM_A, | |
475 SInfoI18NStrings.CSV_FLOWDEPTH_DEVELOPMENT_PER_YEAR_HEADER) { | |
9006 | 476 private static final long serialVersionUID = 1L; |
477 | |
9000 | 478 @Override |
479 public String exportValue(final CallContext context, final Object value) { | |
480 final double doubleValue = asDouble(value); | |
481 return exportDoubleValue(context, doubleValue); | |
482 } | |
483 | |
484 @Override | |
485 protected NumberFormat createFormatter(final CallContext context) { | |
486 return Formatter.getFlowDepthDevelopmentPerYear(context); | |
487 } | |
488 }; | |
489 public static final SInfoResultType waterlevelDifference = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_WATERLEVEL_DIFFERENCE_HEADER, | |
9109 | 490 "sinfo.export.csv.header.waterlevel.difference") { |
9006 | 491 private static final long serialVersionUID = 1L; |
492 | |
9000 | 493 @Override |
494 public String exportValue(final CallContext context, final Object value) { | |
495 final double doubleValue = asDouble(value); | |
496 return exportDoubleValue(context, doubleValue); | |
497 } | |
498 | |
499 @Override | |
500 protected NumberFormat createFormatter(final CallContext context) { | |
501 return Formatter.getTkh(context); | |
502 } | |
503 }; | |
504 public static final SInfoResultType bedHeightDifference = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_DIFFERENCE_HEADER, | |
9109 | 505 "sinfo.export.csv.header.mean_bed_height.difference") { |
9006 | 506 private static final long serialVersionUID = 1L; |
507 | |
9000 | 508 @Override |
509 public String exportValue(final CallContext context, final Object value) { | |
510 final double doubleValue = asDouble(value); | |
511 return exportDoubleValue(context, doubleValue); | |
512 } | |
513 | |
514 @Override | |
515 protected NumberFormat createFormatter(final CallContext context) { | |
516 return Formatter.getTkh(context); | |
517 } | |
518 }; | |
519 public static final SInfoResultType flowdepthCurrent = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_CURRENT_HEADER) { | |
9006 | 520 private static final long serialVersionUID = 1L; |
521 | |
9000 | 522 @Override |
523 public String exportValue(final CallContext context, final Object value) { | |
524 final double doubleValue = asDouble(value); | |
525 return exportDoubleValue(context, doubleValue); | |
526 } | |
527 | |
528 @Override | |
529 protected NumberFormat createFormatter(final CallContext context) { | |
530 return Formatter.getFlowDepth(context); | |
531 } | |
532 }; | |
533 public static final SInfoResultType flowdepthHistorical = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_HISTORICAL_HEADER) { | |
9006 | 534 private static final long serialVersionUID = 1L; |
535 | |
9000 | 536 @Override |
537 public String exportValue(final CallContext context, final Object value) { | |
538 final double doubleValue = asDouble(value); | |
539 return exportDoubleValue(context, doubleValue); | |
540 } | |
541 | |
542 @Override | |
543 protected NumberFormat createFormatter(final CallContext context) { | |
544 return Formatter.getFlowDepth(context); | |
545 } | |
546 }; | |
547 | |
9145 | 548 public static final SInfoResultType infrastructureHeightFloodDur = new SInfoResultType(I18NStrings.UNIT_M, |
549 "sinfo.export.flood_duration.csv.header.infrastructure.height", "sinfo.export.flood_duration.pdf.header.infrastructure.height") { | |
550 private static final long serialVersionUID = 1L; | |
551 | |
552 @Override | |
553 public String exportValue(final CallContext context, final Object value) { | |
554 final double doubleValue = asDouble(value); | |
555 return exportDoubleValue(context, doubleValue); | |
556 } | |
557 | |
558 @Override | |
559 protected NumberFormat createFormatter(final CallContext context) { | |
560 return Formatter.getInfrastructureHeight(context); | |
561 } | |
562 }; | |
563 | |
9115
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
564 public static final SInfoResultType infrastructureHeight = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_INFRASTRUCTURE_HEIGHT_HEADER) { |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
565 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
|
566 |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
567 @Override |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
568 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
|
569 final double doubleValue = asDouble(value); |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
570 return exportDoubleValue(context, doubleValue); |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
571 } |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
572 |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
573 @Override |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
574 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
|
575 return Formatter.getInfrastructureHeight(context); |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
576 } |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
577 }; |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
578 |
9117
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
579 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
|
580 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
|
581 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
582 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
583 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
|
584 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
|
585 return exportDoubleValue(context, doubleValue); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
586 } |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
587 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
588 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
589 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
|
590 return Formatter.getCollisionCount(context); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
591 } |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
592 }; |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
593 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
594 public static final SInfoResultType collisionGaugeW = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_COLLISION_GAUGEW_HEADER) { |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
595 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
|
596 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
597 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
598 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
|
599 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
|
600 return exportDoubleValue(context, doubleValue); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
601 } |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
602 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
603 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
604 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
|
605 return Formatter.getCollisionGaugeW(context); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
606 } |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
607 }; |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
608 |
9157
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
609 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
|
610 private static final long serialVersionUID = 1L; |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
611 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
612 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
613 public String exportValue(final CallContext context, final Object value) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
614 return exportStringValue(value); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
615 } |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
616 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
617 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
618 protected NumberFormat createFormatter(final CallContext context) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
619 throw new UnsupportedOperationException(); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
620 } |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
621 }; |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
622 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
623 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
|
624 private static final long serialVersionUID = 1L; |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
625 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
626 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
627 public String exportValue(final CallContext context, final Object value) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
628 return exportStringValue(value); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
629 } |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
630 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
631 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
632 protected NumberFormat createFormatter(final CallContext context) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
633 throw new UnsupportedOperationException(); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
634 } |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
635 }; |
8948 | 636 } |