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