Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/BunduResultType.java @ 9444:ecadc9ed0ba0
Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
author | mschaefer |
---|---|
date | Tue, 21 Aug 2018 13:41:18 +0200 |
parents | d194c5b24bf8 |
children | e60584f2a531 |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/BunduResultType.java Mon Aug 20 18:50:33 2018 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/BunduResultType.java Tue Aug 21 13:41:18 2018 +0200 @@ -239,7 +239,47 @@ } }; - // RESULT TYPE FIELDS + /** + * List of bed height values of the 10 fields of a cross section + */ + public static final BunduResultType bedHeightFields = new BunduResultType(null, null) { + + private static final long serialVersionUID = 1L; + + @Override + public String exportValue(final CallContext context, final Object value) { + final double doubleValue = asDouble(value); + return exportDoubleValue(context, doubleValue); + } + + @Override + protected NumberFormat createFormatter(final CallContext context) { + throw new UnsupportedOperationException(); + } + }; + + /** + * List of depth values of the 10 fields of a cross section + */ + public static final BunduResultType depthFields = new BunduResultType(I18NStrings.UNIT_NONE, null) { + + private static final long serialVersionUID = 1L; + + @Override + public String exportValue(final CallContext context, final Object value) { + final double doubleValue = asDouble(value); + return exportDoubleValue(context, doubleValue); + } + + @Override + protected NumberFormat createFormatter(final CallContext context) { + throw new UnsupportedOperationException(); + } + }; + + /** + * List of volume values of the 10 fields of a cross section + */ public static final BunduResultType missVolumeFields = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.export.bezugswst.csv.meta.miss.volume.field") { private static final long serialVersionUID = 1L; @@ -256,7 +296,10 @@ } }; - public static final BunduResultType missMassfields = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.export.bezugswst.csv.meta.miss.mass.field") { + /** + * List of mass values of the 10 fields of a cross section + */ + public static final BunduResultType missMassFields = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.export.bezugswst.csv.meta.miss.mass.field") { private static final long serialVersionUID = 1L; @@ -272,16 +315,35 @@ } }; - public static final BunduResultType missStationRange = new BunduResultType(I18NStrings.UNIT_KM, I18NStrings.CSV_KM_HEADER) { + public static final BunduResultType missStationRangeFrom = new BunduResultType(I18NStrings.UNIT_KM, "bundu.export.bezugswst.csv.meta.miss.mass.km_from") { + + private static final long serialVersionUID = 1L; + @Override public String exportValue(final CallContext context, final Object value) { - return exportStringValue(value); + final double doubleValue = asDouble(value); + return exportDoubleValue(context, doubleValue); } @Override protected NumberFormat createFormatter(final CallContext context) { - throw new UnsupportedOperationException(); + return Formatter.getWaterlevelKM(context); } }; + public static final BunduResultType missStationRangeTo = new BunduResultType(I18NStrings.UNIT_KM, "bundu.export.bezugswst.csv.meta.miss.mass.km_to") { + + private static final long serialVersionUID = 1L; + + @Override + public String exportValue(final CallContext context, final Object value) { + final double doubleValue = asDouble(value); + return exportDoubleValue(context, doubleValue); + } + + @Override + protected NumberFormat createFormatter(final CallContext context) { + return Formatter.getWaterlevelKM(context); + } + }; } \ No newline at end of file