Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/BunduResultType.java @ 9535:3fa8551c3d1b
Fixed error in bundu bzws missing volume calculation for mean bed height;
added various additional output columns (field bed height, field flow depth etc.)
author | mschaefer |
---|---|
date | Fri, 12 Oct 2018 18:49:38 +0200 |
parents | 7228bd10a8cc |
children | b9c87bbff6a4 |
comparison
equal
deleted
inserted
replaced
9534:b380a5693514 | 9535:3fa8551c3d1b |
---|---|
12 import java.text.NumberFormat; | 12 import java.text.NumberFormat; |
13 | 13 |
14 import org.dive4elements.artifacts.CallContext; | 14 import org.dive4elements.artifacts.CallContext; |
15 import org.dive4elements.river.artifacts.common.AbstractResultType; | 15 import org.dive4elements.river.artifacts.common.AbstractResultType; |
16 import org.dive4elements.river.artifacts.common.I18NStrings; | 16 import org.dive4elements.river.artifacts.common.I18NStrings; |
17 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultType; | |
17 import org.dive4elements.river.utils.Formatter; | 18 import org.dive4elements.river.utils.Formatter; |
18 | 19 |
19 /** | 20 /** |
20 * @author Domenico Nardi Tironi | 21 * @author Domenico Nardi Tironi |
21 * | 22 * |
238 protected NumberFormat createFormatter(final CallContext context) { | 239 protected NumberFormat createFormatter(final CallContext context) { |
239 return Formatter.getDensityFormat(context); | 240 return Formatter.getDensityFormat(context); |
240 } | 241 } |
241 }; | 242 }; |
242 | 243 |
244 public static final SInfoResultType heightMeanBed = new SInfoResultType(null, "bundu.export.bezugswst.csv.meta.miss.height.mean_bed") { | |
245 private static final long serialVersionUID = 1L; | |
246 | |
247 @Override | |
248 public String exportValue(final CallContext context, final Object value) { | |
249 final double doubleValue = asDouble(value); | |
250 return exportDoubleValue(context, doubleValue); | |
251 } | |
252 | |
253 @Override | |
254 protected NumberFormat createFormatter(final CallContext context) { | |
255 return Formatter.getMeanBedHeight(context); | |
256 } | |
257 }; | |
258 | |
259 public static final SInfoResultType flowdepthMeanBed = new SInfoResultType(I18NStrings.UNIT_M, "bundu.export.bezugswst.csv.meta.miss.flowdepth.mean_bed") { | |
260 private static final long serialVersionUID = 1L; | |
261 | |
262 @Override | |
263 public String exportValue(final CallContext context, final Object value) { | |
264 final double doubleValue = asDouble(value); | |
265 return exportDoubleValue(context, doubleValue); | |
266 } | |
267 | |
268 @Override | |
269 protected NumberFormat createFormatter(final CallContext context) { | |
270 return Formatter.getFlowDepth(context); | |
271 } | |
272 }; | |
273 | |
243 public static final BunduResultType missDepthMeanBed = new BunduResultType(I18NStrings.UNIT_NONE, null) { | 274 public static final BunduResultType missDepthMeanBed = new BunduResultType(I18NStrings.UNIT_NONE, null) { |
244 | 275 |
245 private static final long serialVersionUID = 1L; | 276 private static final long serialVersionUID = 1L; |
246 | 277 |
247 @Override | 278 @Override |
317 return exportDoubleValue(context, doubleValue); | 348 return exportDoubleValue(context, doubleValue); |
318 } | 349 } |
319 | 350 |
320 @Override | 351 @Override |
321 protected NumberFormat createFormatter(final CallContext context) { | 352 protected NumberFormat createFormatter(final CallContext context) { |
353 return Formatter.getMeanBedHeight(context); | |
354 } | |
355 }; | |
356 | |
357 /** | |
358 * List of depth values of the 10 fields of a cross section | |
359 */ | |
360 public static final BunduResultType depthFields = new BunduResultType(I18NStrings.UNIT_NONE, null) { | |
361 | |
362 private static final long serialVersionUID = 1L; | |
363 | |
364 @Override | |
365 public String exportValue(final CallContext context, final Object value) { | |
366 final double doubleValue = asDouble(value); | |
367 return exportDoubleValue(context, doubleValue); | |
368 } | |
369 | |
370 @Override | |
371 protected NumberFormat createFormatter(final CallContext context) { | |
372 return Formatter.getFlowDepth(context); | |
373 } | |
374 }; | |
375 | |
376 /** | |
377 * List of missing depth values of the 10 fields of a cross section | |
378 */ | |
379 public static final BunduResultType missDepthFields = new BunduResultType(I18NStrings.UNIT_NONE, null) { | |
380 | |
381 private static final long serialVersionUID = 1L; | |
382 | |
383 @Override | |
384 public String exportValue(final CallContext context, final Object value) { | |
385 final double doubleValue = asDouble(value); | |
386 return exportDoubleValue(context, doubleValue); | |
387 } | |
388 | |
389 @Override | |
390 protected NumberFormat createFormatter(final CallContext context) { | |
322 throw new UnsupportedOperationException(); | 391 throw new UnsupportedOperationException(); |
323 } | 392 } |
324 }; | 393 }; |
325 | 394 |
326 /** | 395 /** |
327 * List of depth values of the 10 fields of a cross section | 396 * List of missing width values of the 10 fields of a cross section |
328 */ | 397 */ |
329 public static final BunduResultType depthFields = new BunduResultType(I18NStrings.UNIT_NONE, null) { | 398 public static final BunduResultType missWidthFields = new BunduResultType(I18NStrings.UNIT_NONE, null) { |
330 | 399 |
331 private static final long serialVersionUID = 1L; | 400 private static final long serialVersionUID = 1L; |
332 | 401 |
333 @Override | 402 @Override |
334 public String exportValue(final CallContext context, final Object value) { | 403 public String exportValue(final CallContext context, final Object value) { |
341 throw new UnsupportedOperationException(); | 410 throw new UnsupportedOperationException(); |
342 } | 411 } |
343 }; | 412 }; |
344 | 413 |
345 /** | 414 /** |
346 * List of missing depth values of the 10 fields of a cross section | 415 * List of missing area values of the 10 fields of a cross section |
347 */ | 416 */ |
348 public static final BunduResultType missDepthFields = new BunduResultType(I18NStrings.UNIT_NONE, null) { | 417 public static final BunduResultType missAreaFields = new BunduResultType(I18NStrings.UNIT_NONE, null) { |
349 | 418 |
350 private static final long serialVersionUID = 1L; | 419 private static final long serialVersionUID = 1L; |
351 | 420 |
352 @Override | 421 @Override |
353 public String exportValue(final CallContext context, final Object value) { | 422 public String exportValue(final CallContext context, final Object value) { |
360 throw new UnsupportedOperationException(); | 429 throw new UnsupportedOperationException(); |
361 } | 430 } |
362 }; | 431 }; |
363 | 432 |
364 /** | 433 /** |
365 * List of missing width values of the 10 fields of a cross section | |
366 */ | |
367 public static final BunduResultType missWidthFields = new BunduResultType(I18NStrings.UNIT_NONE, null) { | |
368 | |
369 private static final long serialVersionUID = 1L; | |
370 | |
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 throw new UnsupportedOperationException(); | |
380 } | |
381 }; | |
382 | |
383 /** | |
384 * List of missing area values of the 10 fields of a cross section | |
385 */ | |
386 public static final BunduResultType missAreaFields = new BunduResultType(I18NStrings.UNIT_NONE, null) { | |
387 | |
388 private static final long serialVersionUID = 1L; | |
389 | |
390 @Override | |
391 public String exportValue(final CallContext context, final Object value) { | |
392 final double doubleValue = asDouble(value); | |
393 return exportDoubleValue(context, doubleValue); | |
394 } | |
395 | |
396 @Override | |
397 protected NumberFormat createFormatter(final CallContext context) { | |
398 throw new UnsupportedOperationException(); | |
399 } | |
400 }; | |
401 | |
402 /** | |
403 * List of volume values of the 10 fields of a cross section | 434 * List of volume values of the 10 fields of a cross section |
404 */ | 435 */ |
405 public static final BunduResultType missVolumeFields = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.export.bezugswst.csv.meta.miss.volume.field") { | 436 public static final BunduResultType missVolumeFields = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.export.bezugswst.csv.meta.miss.volume.field") { |
406 | 437 |
407 private static final long serialVersionUID = 1L; | 438 private static final long serialVersionUID = 1L; |