Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java @ 9490:e44c1a8b0c54
Fixed: rounding problems in iota/salix scenario calculation
author | mschaefer |
---|---|
date | Wed, 19 Sep 2018 16:21:08 +0200 |
parents | bd5f5d2220fa |
children | d7d22ea8573d |
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; | |
9490
e44c1a8b0c54
Fixed: rounding problems in iota/salix scenario calculation
mschaefer
parents:
9429
diff
changeset
|
15 import org.apache.log4j.Logger; |
8948 | 16 import org.dive4elements.artifacts.CallContext; |
9000 | 17 import org.dive4elements.river.artifacts.common.AbstractResultType; |
18 import org.dive4elements.river.artifacts.common.I18NStrings; | |
8948 | 19 import org.dive4elements.river.artifacts.resources.Resources; |
20 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.SoilKind; | |
9229
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
21 import org.dive4elements.river.model.Attribute.AttributeKey; |
8948 | 22 import org.dive4elements.river.utils.Formatter; |
23 import org.dive4elements.river.utils.RiverUtils; | |
24 | |
25 /** | |
26 * Result type for data that goes into {@link SInfoResultRow}s. | |
27 * | |
28 * @author Gernot Belger | |
29 */ | |
9000 | 30 public abstract class SInfoResultType extends AbstractResultType { |
8948 | 31 |
9006 | 32 private static final long serialVersionUID = 1L; |
33 | |
9490
e44c1a8b0c54
Fixed: rounding problems in iota/salix scenario calculation
mschaefer
parents:
9429
diff
changeset
|
34 protected static Logger log = Logger.getLogger(SInfoResultType.class); |
e44c1a8b0c54
Fixed: rounding problems in iota/salix scenario calculation
mschaefer
parents:
9429
diff
changeset
|
35 |
9429
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9318
diff
changeset
|
36 protected SInfoResultType(final String unit, final String csvHeader) { |
9000 | 37 super(unit, csvHeader, csvHeader); |
38 } | |
8948 | 39 |
9429
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9318
diff
changeset
|
40 protected SInfoResultType(final String unit, final String csvHeader, final String pdfHeader) { |
9000 | 41 super(unit, csvHeader, pdfHeader); |
42 } | |
8948 | 43 |
9145 | 44 public static final SInfoResultType customMultiRowColWaterlevel = new SInfoResultType(null, SInfoI18NStrings.CSV_WATERLEVEL_HEADER, |
45 "sinfo.export.flow_depth.pdf.header.waterlevel") { | |
46 private static final long serialVersionUID = 1L; | |
47 | |
48 @Override | |
49 public String exportValue(final CallContext context, final Object value) { | |
9205
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9202
diff
changeset
|
50 throw new UnsupportedOperationException(); |
9145 | 51 } |
52 | |
53 @Override | |
54 protected NumberFormat createFormatter(final CallContext context) { | |
9205
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9202
diff
changeset
|
55 throw new UnsupportedOperationException(); |
9145 | 56 } |
57 | |
58 }; | |
59 | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
60 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
|
61 "sinfo.export.flood_duration.pdf.header.discharge") { |
9145 | 62 private static final long serialVersionUID = 1L; |
63 | |
64 @Override | |
65 public String exportValue(final CallContext context, final Object value) { | |
66 final double doubleValue = asDouble(value); | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
67 return exportDoubleValue(context, doubleValue); |
9145 | 68 } |
69 | |
70 @Override | |
71 protected NumberFormat createFormatter(final CallContext context) { | |
72 return Formatter.getWaterlevelQ(context); | |
73 } | |
74 }; | |
75 | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
76 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
|
77 "sinfo.export.flood_duration.pdf.header.duration") { |
9145 | 78 private static final long serialVersionUID = 1L; |
79 | |
80 @Override | |
81 public String exportValue(final CallContext context, final Object value) { | |
82 final double doubleValue = asDouble(value); | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
83 return exportDoubleValue(context, doubleValue); |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
84 } |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
85 |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
86 @Override |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
87 protected NumberFormat createFormatter(final CallContext context) { |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
88 return Formatter.getIntegerFormatter(context); |
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 }; |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
91 |
9000 | 92 public static final SInfoResultType waterlevel = new SInfoResultType(null, SInfoI18NStrings.CSV_WATERLEVEL_HEADER, |
93 "sinfo.export.flow_depth.pdf.header.waterlevel") { | |
9006 | 94 private static final long serialVersionUID = 1L; |
95 | |
8948 | 96 @Override |
97 public String exportValue(final CallContext context, final Object value) { | |
98 final double doubleValue = asDouble(value); | |
99 return exportDoubleValue(context, doubleValue); | |
100 } | |
101 | |
102 @Override | |
103 protected NumberFormat createFormatter(final CallContext context) { | |
104 // REMARK: other modules use Formatter.getWaterlevelW(context) instead, but that format with a variable number of | |
105 // digits. | |
106 return Formatter.getFlowDepth(context); | |
107 } | |
9000 | 108 }; |
8948 | 109 |
9318
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
110 public static final SInfoResultType infrastructuretype = new SInfoResultType(I18NStrings.UNIT_NONE, |
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
111 "sinfo.export.flood_duration.csv.header.infrastructure_type", "sinfo.export.flood_duration.pdf.header.infrastructure_type") { |
9006 | 112 private static final long serialVersionUID = 1L; |
113 | |
8948 | 114 @Override |
115 public String exportValue(final CallContext context, final Object value) { | |
116 return exportStringValue(value); | |
117 } | |
118 | |
119 @Override | |
120 protected NumberFormat createFormatter(final CallContext context) { | |
121 throw new UnsupportedOperationException(); | |
122 } | |
9000 | 123 }; |
8948 | 124 |
9318
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
125 public static final SInfoResultType dischargeLong = new SInfoResultType(I18NStrings.UNIT_CUBIC_M, "sinfo.export.collision.csv.header.discharge_long") { |
9145 | 126 private static final long serialVersionUID = 1L; |
127 | |
128 @Override | |
129 public String exportValue(final CallContext context, final Object value) { | |
9318
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
130 final double doubleValue = asDouble(value); |
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
131 final double roundedDischarge = RiverUtils.roundQ(doubleValue); |
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
132 return exportDoubleValue(context, roundedDischarge); |
9145 | 133 } |
134 | |
135 @Override | |
136 protected NumberFormat createFormatter(final CallContext context) { | |
9318
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
137 return Formatter.getWaterlevelQ(context); |
9145 | 138 } |
139 }; | |
140 | |
9000 | 141 public static final SInfoResultType discharge = new SInfoResultType(I18NStrings.UNIT_CUBIC_M, SInfoI18NStrings.CSV_DISCHARGE_HEADER) { |
9006 | 142 private static final long serialVersionUID = 1L; |
143 | |
8948 | 144 @Override |
145 public String exportValue(final CallContext context, final Object value) { | |
146 final double doubleValue = asDouble(value); | |
147 final double roundedDischarge = RiverUtils.roundQ(doubleValue); | |
148 return exportDoubleValue(context, roundedDischarge); | |
149 } | |
150 | |
151 @Override | |
152 protected NumberFormat createFormatter(final CallContext context) { | |
153 return Formatter.getWaterlevelQ(context); | |
154 } | |
9000 | 155 }; |
8948 | 156 |
9202
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
157 public static final SInfoResultType discharge1 = new SInfoResultType(I18NStrings.UNIT_CUBIC_M, "sinfo.flood_duration.header.mainvalue.1.q", |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
158 "sinfo.flood_duration.header.pdf.mainvalue.1.q") { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
159 private static final long serialVersionUID = 1L; |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
160 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
161 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
162 public String exportValue(final CallContext context, final Object value) { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
163 final double doubleValue = asDouble(value); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
164 final double roundedDischarge = RiverUtils.roundQ(doubleValue); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
165 return exportDoubleValue(context, roundedDischarge); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
166 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
167 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
168 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
169 protected NumberFormat createFormatter(final CallContext context) { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
170 return Formatter.getWaterlevelQ(context); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
171 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
172 }; |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
173 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
174 public static final SInfoResultType discharge2 = new SInfoResultType(I18NStrings.UNIT_CUBIC_M, "sinfo.flood_duration.header.mainvalue.2.q", |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
175 "sinfo.flood_duration.header.pdf.mainvalue.2.q") { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
176 private static final long serialVersionUID = 1L; |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
177 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
178 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
179 public String exportValue(final CallContext context, final Object value) { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
180 final double doubleValue = asDouble(value); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
181 final double roundedDischarge = RiverUtils.roundQ(doubleValue); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
182 return exportDoubleValue(context, roundedDischarge); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
183 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
184 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
185 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
186 protected NumberFormat createFormatter(final CallContext context) { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
187 return Formatter.getWaterlevelQ(context); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
188 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
189 }; |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
190 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
191 public static final SInfoResultType discharge3 = new SInfoResultType(I18NStrings.UNIT_CUBIC_M, "sinfo.flood_duration.header.mainvalue.3.q", |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
192 "sinfo.flood_duration.header.pdf.mainvalue.3.q") { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
193 private static final long serialVersionUID = 1L; |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
194 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
195 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
196 public String exportValue(final CallContext context, final Object value) { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
197 final double doubleValue = asDouble(value); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
198 final double roundedDischarge = RiverUtils.roundQ(doubleValue); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
199 return exportDoubleValue(context, roundedDischarge); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
200 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
201 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
202 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
203 protected NumberFormat createFormatter(final CallContext context) { |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
204 return Formatter.getWaterlevelQ(context); |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
205 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
206 }; |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
207 |
9000 | 208 public static final SInfoResultType meanBedHeight = new SInfoResultType(null, SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_HEADER, |
209 SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_HEADER_SHORT) { | |
9006 | 210 private static final long serialVersionUID = 1L; |
211 | |
8948 | 212 @Override |
213 public String exportValue(final CallContext context, final Object value) { | |
214 final double doubleValue = asDouble(value); | |
9490
e44c1a8b0c54
Fixed: rounding problems in iota/salix scenario calculation
mschaefer
parents:
9429
diff
changeset
|
215 log.trace(String.format("meanBedHeight.exportValue value: %f doubleValue: %f formatted to: %s", value, doubleValue, |
e44c1a8b0c54
Fixed: rounding problems in iota/salix scenario calculation
mschaefer
parents:
9429
diff
changeset
|
216 exportDoubleValue(context, doubleValue))); |
8948 | 217 return exportDoubleValue(context, doubleValue); |
218 } | |
219 | |
220 @Override | |
221 protected NumberFormat createFormatter(final CallContext context) { | |
222 return Formatter.getMeanBedHeight(context); | |
223 } | |
9000 | 224 }; |
8948 | 225 |
9000 | 226 public static final SInfoResultType soundingLabel = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_SOUNDING_HEADER) { |
9006 | 227 private static final long serialVersionUID = 1L; |
228 | |
8948 | 229 @Override |
230 public String exportValue(final CallContext context, final Object value) { | |
231 return exportStringValue(value); | |
232 } | |
233 | |
234 @Override | |
235 protected NumberFormat createFormatter(final CallContext context) { | |
236 throw new UnsupportedOperationException(); | |
237 } | |
9000 | 238 }; |
239 public static final SInfoResultType flowdepthDevelopmentPerYear = new SInfoResultType(I18NStrings.UNIT_CM_A, | |
9287 | 240 SInfoI18NStrings.CSV_FLOWDEPTH_DEVELOPMENT_PER_YEAR_HEADER, "sinfo.export.pdf.header.flowdepth.development.per.year") { |
9006 | 241 private static final long serialVersionUID = 1L; |
242 | |
9000 | 243 @Override |
244 public String exportValue(final CallContext context, final Object value) { | |
245 final double doubleValue = asDouble(value); | |
246 return exportDoubleValue(context, doubleValue); | |
247 } | |
8948 | 248 |
9000 | 249 @Override |
250 protected NumberFormat createFormatter(final CallContext context) { | |
251 return Formatter.getFlowDepthDevelopmentPerYear(context); | |
252 } | |
253 }; | |
254 | |
255 public static final SInfoResultType flowdepthmin = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_MIN_HEADER) { | |
9006 | 256 private static final long serialVersionUID = 1L; |
257 | |
8948 | 258 @Override |
259 public String exportValue(final CallContext context, final Object value) { | |
260 final double doubleValue = asDouble(value); | |
261 return exportDoubleValue(context, doubleValue); | |
262 } | |
263 | |
264 @Override | |
265 protected NumberFormat createFormatter(final CallContext context) { | |
266 return Formatter.getFlowDepth(context); | |
267 } | |
9000 | 268 }; |
8948 | 269 |
9000 | 270 public static final SInfoResultType flowdepthmax = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_MAX_HEADER) { |
9006 | 271 private static final long serialVersionUID = 1L; |
272 | |
8948 | 273 @Override |
274 public String exportValue(final CallContext context, final Object value) { | |
275 final double doubleValue = asDouble(value); | |
276 return exportDoubleValue(context, doubleValue); | |
277 } | |
278 | |
279 @Override | |
280 protected NumberFormat createFormatter(final CallContext context) { | |
281 return Formatter.getFlowDepth(context); | |
282 } | |
9000 | 283 }; |
8948 | 284 |
9145 | 285 public static final SInfoResultType riverside = new SInfoResultType(I18NStrings.UNIT_NONE, "sinfo.export.flood_duration.csv.header.riverside") { |
286 private static final long serialVersionUID = 1L; | |
287 | |
288 @Override | |
289 public String exportValue(final CallContext context, final Object value) { | |
9229
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
290 return localizeRiverside(context, (AttributeKey) value); |
9145 | 291 } |
292 | |
293 @Override | |
294 protected NumberFormat createFormatter(final CallContext context) { | |
295 throw new UnsupportedOperationException(); | |
296 } | |
297 }; | |
298 | |
9229
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
299 /** |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
300 * Returns the localized text of a riverside |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
301 * FIXME: Find a better place for this common method |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
302 */ |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
303 public static final String localizeRiverside(final CallContext context, final AttributeKey riverside) { |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
304 if (riverside == AttributeKey.LEFT) |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
305 return Resources.getMsg(context.getMeta(), "riverside.left"); |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
306 else if (riverside == AttributeKey.RIGHT) |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
307 return Resources.getMsg(context.getMeta(), "riverside.right"); |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
308 else |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
309 return "?"; |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
310 } |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
311 |
9000 | 312 public static final SInfoResultType soilkind = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_TKHKIND_HEADER, |
313 "sinfo.export.tkh.pdf.header.tkhkind") { | |
9006 | 314 private static final long serialVersionUID = 1L; |
315 | |
8948 | 316 @Override |
317 public String exportValue(final CallContext context, final Object value) { | |
318 | |
319 if (value == null) | |
320 return StringUtils.EMPTY; | |
321 | |
322 final SoilKind kind = (SoilKind) value; | |
323 | |
324 final String key = SInfoI18NStrings.PREFIX_TKH_KIND + kind.name(); | |
325 return Resources.getMsg(context.getMeta(), key, key); | |
326 } | |
327 | |
328 @Override | |
329 protected NumberFormat createFormatter(final CallContext context) { | |
330 throw new UnsupportedOperationException(); | |
331 } | |
9000 | 332 }; |
8950
b0aeed4c97c1
Implemented chart output for sinfo flow depth min/max calculation
gernotbelger
parents:
8949
diff
changeset
|
333 |
9000 | 334 public static final SInfoResultType flowdepth = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_HEADER) { |
9006 | 335 private static final long serialVersionUID = 1L; |
336 | |
8951 | 337 @Override |
338 public String exportValue(final CallContext context, final Object value) { | |
339 final double doubleValue = asDouble(value); | |
340 return exportDoubleValue(context, doubleValue); | |
341 } | |
342 | |
343 @Override | |
344 protected NumberFormat createFormatter(final CallContext context) { | |
345 return Formatter.getFlowDepth(context); | |
346 } | |
8948 | 347 }; |
348 | |
9000 | 349 public static final SInfoResultType d50 = 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 } | |
8948 | 357 |
9000 | 358 @Override |
359 protected NumberFormat createFormatter(final CallContext context) { | |
360 throw new UnsupportedOperationException(); | |
361 } | |
362 }; | |
8948 | 363 |
9000 | 364 public static final SInfoResultType velocity = new SInfoResultType(null, null) { |
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 } | |
8948 | 372 |
9000 | 373 @Override |
374 protected NumberFormat createFormatter(final CallContext context) { | |
375 throw new UnsupportedOperationException(); | |
376 } | |
377 }; | |
8948 | 378 |
9000 | 379 public static final SInfoResultType tau = new SInfoResultType(null, 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 } | |
8949
09e4a4909814
Distinguish between csv and pdf column headers
gernotbelger
parents:
8948
diff
changeset
|
387 |
9000 | 388 @Override |
389 protected NumberFormat createFormatter(final CallContext context) { | |
390 throw new UnsupportedOperationException(); | |
391 } | |
392 }; | |
393 | |
394 public static final SInfoResultType tkh = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_TKH_HEADER, SInfoI18NStrings.CSV_TKH_HEADER_SHORT) { | |
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 return Formatter.getTkh(context); | |
406 } | |
407 }; | |
408 | |
409 public static final SInfoResultType tkhup = new SInfoResultType(I18NStrings.UNIT_M, null) { | |
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 throw new UnsupportedOperationException(); | |
421 } | |
422 }; | |
423 | |
424 public static final SInfoResultType tkhdown = new SInfoResultType(I18NStrings.UNIT_M, null) { | |
9006 | 425 private static final long serialVersionUID = 1L; |
426 | |
9000 | 427 @Override |
428 public String exportValue(final CallContext context, final Object value) { | |
429 final double doubleValue = asDouble(value); | |
430 return exportDoubleValue(context, doubleValue); | |
431 } | |
432 | |
433 @Override | |
434 protected NumberFormat createFormatter(final CallContext context) { | |
435 throw new UnsupportedOperationException(); | |
436 } | |
437 }; | |
438 | |
439 public static final SInfoResultType flowdepthtkh = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTHTKH_HEADER) { | |
9006 | 440 private static final long serialVersionUID = 1L; |
441 | |
9000 | 442 @Override |
443 public String exportValue(final CallContext context, final Object value) { | |
444 final double doubleValue = asDouble(value); | |
445 return exportDoubleValue(context, doubleValue); | |
446 } | |
447 | |
448 @Override | |
449 protected NumberFormat createFormatter(final CallContext context) { | |
450 return Formatter.getFlowDepth(context); | |
451 } | |
452 }; | |
453 | |
9112
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
454 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
|
455 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
|
456 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
457 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
458 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
|
459 final double doubleValue = asDouble(value); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
460 return exportDoubleValue(context, doubleValue); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
461 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
462 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
463 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
464 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
|
465 return Formatter.getChannelWidth(context); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
466 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
467 }; |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
468 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
469 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
|
470 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
|
471 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
472 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
473 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
|
474 final double doubleValue = asDouble(value); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
475 return exportDoubleValue(context, doubleValue); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
476 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
477 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
478 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
479 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
|
480 return Formatter.getChannelDepth(context); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
481 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
482 }; |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
483 |
9287 | 484 public static final SInfoResultType flowdepthDevelopment = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_FLOWDEPTH_DEVELOPMENT_HEADER, |
9000 | 485 SInfoI18NStrings.PDF_FLOWDEPTH_DEVELOPMENT_HEADER) { |
9006 | 486 private static final long serialVersionUID = 1L; |
487 | |
9000 | 488 @Override |
489 public String exportValue(final CallContext context, final Object value) { | |
490 final double doubleValue = asDouble(value); | |
491 return exportDoubleValue(context, doubleValue); | |
492 } | |
493 | |
494 @Override | |
495 protected NumberFormat createFormatter(final CallContext context) { | |
496 return Formatter.getTkh(context); | |
497 } | |
498 }; | |
499 | |
9287 | 500 public static final SInfoResultType waterlevelDifference = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_WATERLEVEL_DIFFERENCE_HEADER, |
501 SInfoI18NStrings.CSV_WATERLEVEL_DIFFERENCE_HEADER) { | |
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 }; | |
9287 | 515 public static final SInfoResultType bedHeightDifference = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_DIFFERENCE_HEADER, |
9109 | 516 "sinfo.export.csv.header.mean_bed_height.difference") { |
9006 | 517 private static final long serialVersionUID = 1L; |
518 | |
9000 | 519 @Override |
520 public String exportValue(final CallContext context, final Object value) { | |
521 final double doubleValue = asDouble(value); | |
522 return exportDoubleValue(context, doubleValue); | |
523 } | |
524 | |
525 @Override | |
526 protected NumberFormat createFormatter(final CallContext context) { | |
527 return Formatter.getTkh(context); | |
528 } | |
529 }; | |
530 public static final SInfoResultType flowdepthCurrent = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_CURRENT_HEADER) { | |
9006 | 531 private static final long serialVersionUID = 1L; |
532 | |
9000 | 533 @Override |
534 public String exportValue(final CallContext context, final Object value) { | |
535 final double doubleValue = asDouble(value); | |
536 return exportDoubleValue(context, doubleValue); | |
537 } | |
538 | |
539 @Override | |
540 protected NumberFormat createFormatter(final CallContext context) { | |
541 return Formatter.getFlowDepth(context); | |
542 } | |
543 }; | |
544 public static final SInfoResultType flowdepthHistorical = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_HISTORICAL_HEADER) { | |
9006 | 545 private static final long serialVersionUID = 1L; |
546 | |
9000 | 547 @Override |
548 public String exportValue(final CallContext context, final Object value) { | |
549 final double doubleValue = asDouble(value); | |
550 return exportDoubleValue(context, doubleValue); | |
551 } | |
552 | |
553 @Override | |
554 protected NumberFormat createFormatter(final CallContext context) { | |
555 return Formatter.getFlowDepth(context); | |
556 } | |
557 }; | |
558 | |
9202
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
559 public static final SInfoResultType infrastructureHeight = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_INFRASTRUCTURE_HEIGHT_HEADER, |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
560 SInfoI18NStrings.PDF_INFRASTRUCTURE_HEIGHT_HEADER) { |
9115
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 } |