comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java @ 8950:b0aeed4c97c1

Implemented chart output for sinfo flow depth min/max calculation
author gernotbelger
date Thu, 15 Mar 2018 17:22:28 +0100
parents 09e4a4909814
children 322b0e6298ea
comparison
equal deleted inserted replaced
8949:09e4a4909814 8950:b0aeed4c97c1
82 protected NumberFormat createFormatter(final CallContext context) { 82 protected NumberFormat createFormatter(final CallContext context) {
83 return Formatter.getWaterlevelQ(context); 83 return Formatter.getWaterlevelQ(context);
84 } 84 }
85 }, 85 },
86 86
87 // FIXME: use pgetPdfHeader instead of getCsvHeader
88
89 meanBedHeight(null, SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_HEADER, SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_HEADER_SHORT) { 87 meanBedHeight(null, SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_HEADER, SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_HEADER_SHORT) {
90 @Override 88 @Override
91 public String exportValue(final CallContext context, final Object value) { 89 public String exportValue(final CallContext context, final Object value) {
92 final double doubleValue = asDouble(value); 90 final double doubleValue = asDouble(value);
93 return exportDoubleValue(context, doubleValue); 91 return exportDoubleValue(context, doubleValue);
158 @Override 156 @Override
159 protected NumberFormat createFormatter(final CallContext context) { 157 protected NumberFormat createFormatter(final CallContext context) {
160 throw new UnsupportedOperationException(); 158 throw new UnsupportedOperationException();
161 } 159 }
162 }, 160 },
161
163 soilkind(SInfoI18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_TKHKIND_HEADER) { 162 soilkind(SInfoI18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_TKHKIND_HEADER) {
164 @Override 163 @Override
165 public String exportValue(final CallContext context, final Object value) { 164 public String exportValue(final CallContext context, final Object value) {
166 165
167 if (value == null) 166 if (value == null)
176 @Override 175 @Override
177 protected NumberFormat createFormatter(final CallContext context) { 176 protected NumberFormat createFormatter(final CallContext context) {
178 throw new UnsupportedOperationException(); 177 throw new UnsupportedOperationException();
179 } 178 }
180 }, 179 },
180
181 flowdepth(SInfoI18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_HEADER) { 181 flowdepth(SInfoI18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_HEADER) {
182 @Override 182 @Override
183 public String exportValue(final CallContext context, final Object value) { 183 public String exportValue(final CallContext context, final Object value) {
184 final double doubleValue = asDouble(value); 184 final double doubleValue = asDouble(value);
185 return exportDoubleValue(context, doubleValue); 185 return exportDoubleValue(context, doubleValue);
188 @Override 188 @Override
189 protected NumberFormat createFormatter(final CallContext context) { 189 protected NumberFormat createFormatter(final CallContext context) {
190 return Formatter.getFlowDepth(context); 190 return Formatter.getFlowDepth(context);
191 } 191 }
192 }, 192 },
193
193 d50(null, null) { 194 d50(null, null) {
194 @Override 195 @Override
195 public String exportValue(final CallContext context, final Object value) { 196 public String exportValue(final CallContext context, final Object value) {
196 final double doubleValue = asDouble(value); 197 final double doubleValue = asDouble(value);
197 return exportDoubleValue(context, doubleValue); 198 return exportDoubleValue(context, doubleValue);
200 @Override 201 @Override
201 protected NumberFormat createFormatter(final CallContext context) { 202 protected NumberFormat createFormatter(final CallContext context) {
202 throw new UnsupportedOperationException(); 203 throw new UnsupportedOperationException();
203 } 204 }
204 }, 205 },
206
205 velocity(null, null) { 207 velocity(null, null) {
206 @Override 208 @Override
207 public String exportValue(final CallContext context, final Object value) { 209 public String exportValue(final CallContext context, final Object value) {
208 final double doubleValue = asDouble(value); 210 final double doubleValue = asDouble(value);
209 return exportDoubleValue(context, doubleValue); 211 return exportDoubleValue(context, doubleValue);
212 @Override 214 @Override
213 protected NumberFormat createFormatter(final CallContext context) { 215 protected NumberFormat createFormatter(final CallContext context) {
214 throw new UnsupportedOperationException(); 216 throw new UnsupportedOperationException();
215 } 217 }
216 }, 218 },
219
217 tau(null, null) { 220 tau(null, null) {
218 @Override 221 @Override
219 public String exportValue(final CallContext context, final Object value) { 222 public String exportValue(final CallContext context, final Object value) {
220 final double doubleValue = asDouble(value); 223 final double doubleValue = asDouble(value);
221 return exportDoubleValue(context, doubleValue); 224 return exportDoubleValue(context, doubleValue);
224 @Override 227 @Override
225 protected NumberFormat createFormatter(final CallContext context) { 228 protected NumberFormat createFormatter(final CallContext context) {
226 throw new UnsupportedOperationException(); 229 throw new UnsupportedOperationException();
227 } 230 }
228 }, 231 },
232
229 tkh(SInfoI18NStrings.UNIT_CM, SInfoI18NStrings.CSV_TKH_HEADER, SInfoI18NStrings.CSV_TKH_HEADER_SHORT) { 233 tkh(SInfoI18NStrings.UNIT_CM, SInfoI18NStrings.CSV_TKH_HEADER, SInfoI18NStrings.CSV_TKH_HEADER_SHORT) {
230 @Override 234 @Override
231 public String exportValue(final CallContext context, final Object value) { 235 public String exportValue(final CallContext context, final Object value) {
232 final double doubleValue = asDouble(value); 236 final double doubleValue = asDouble(value);
233 return exportDoubleValue(context, doubleValue); 237 return exportDoubleValue(context, doubleValue);
236 @Override 240 @Override
237 protected NumberFormat createFormatter(final CallContext context) { 241 protected NumberFormat createFormatter(final CallContext context) {
238 return Formatter.getTkh(context); 242 return Formatter.getTkh(context);
239 } 243 }
240 }, 244 },
245
241 tkhup(SInfoI18NStrings.UNIT_CM, null) { 246 tkhup(SInfoI18NStrings.UNIT_CM, null) {
242 @Override 247 @Override
243 public String exportValue(final CallContext context, final Object value) { 248 public String exportValue(final CallContext context, final Object value) {
244 final double doubleValue = asDouble(value); 249 final double doubleValue = asDouble(value);
245 return exportDoubleValue(context, doubleValue); 250 return exportDoubleValue(context, doubleValue);
248 @Override 253 @Override
249 protected NumberFormat createFormatter(final CallContext context) { 254 protected NumberFormat createFormatter(final CallContext context) {
250 throw new UnsupportedOperationException(); 255 throw new UnsupportedOperationException();
251 } 256 }
252 }, 257 },
258
253 tkhdown(SInfoI18NStrings.UNIT_CM, null) { 259 tkhdown(SInfoI18NStrings.UNIT_CM, null) {
254 @Override 260 @Override
255 public String exportValue(final CallContext context, final Object value) { 261 public String exportValue(final CallContext context, final Object value) {
256 final double doubleValue = asDouble(value); 262 final double doubleValue = asDouble(value);
257 return exportDoubleValue(context, doubleValue); 263 return exportDoubleValue(context, doubleValue);
260 @Override 266 @Override
261 protected NumberFormat createFormatter(final CallContext context) { 267 protected NumberFormat createFormatter(final CallContext context) {
262 throw new UnsupportedOperationException(); 268 throw new UnsupportedOperationException();
263 } 269 }
264 }, 270 },
271
265 flowdepthtkh(SInfoI18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTHTKH_HEADER) { 272 flowdepthtkh(SInfoI18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTHTKH_HEADER) {
266 @Override 273 @Override
267 public String exportValue(final CallContext context, final Object value) { 274 public String exportValue(final CallContext context, final Object value) {
268 final double doubleValue = asDouble(value); 275 final double doubleValue = asDouble(value);
269 return exportDoubleValue(context, doubleValue); 276 return exportDoubleValue(context, doubleValue);
340 347
341 public final String getCsvHeader() { 348 public final String getCsvHeader() {
342 return this.csvHeader; 349 return this.csvHeader;
343 } 350 }
344 351
345 public String getPdfHeader(final CallMeta meta) { 352 public final String getPdfHeader(final CallMeta meta) {
346 return Resources.getMsg(meta, this.pdfHeader, this.pdfHeader); 353 return Resources.getMsg(meta, this.pdfHeader, this.pdfHeader);
347 } 354 }
348 355
349 public final String getUnit() { 356 public final String getUnit() {
350 return this.unit; 357 return this.unit;

http://dive4elements.wald.intevation.org