Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java @ 9582:8b457ca70512
Punkt 8.1 Grundberührungen Header
author | gernotbelger |
---|---|
date | Wed, 09 Jan 2019 14:47:21 +0100 |
parents | 83e6acdf8fc6 |
children | 8232a3f5967b |
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); | |
215 return exportDoubleValue(context, doubleValue); | |
216 } | |
217 | |
218 @Override | |
219 protected NumberFormat createFormatter(final CallContext context) { | |
220 return Formatter.getMeanBedHeight(context); | |
221 } | |
9000 | 222 }; |
8948 | 223 |
9000 | 224 public static final SInfoResultType soundingLabel = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_SOUNDING_HEADER) { |
9006 | 225 private static final long serialVersionUID = 1L; |
226 | |
8948 | 227 @Override |
228 public String exportValue(final CallContext context, final Object value) { | |
229 return exportStringValue(value); | |
230 } | |
231 | |
232 @Override | |
233 protected NumberFormat createFormatter(final CallContext context) { | |
234 throw new UnsupportedOperationException(); | |
235 } | |
9000 | 236 }; |
237 public static final SInfoResultType flowdepthDevelopmentPerYear = new SInfoResultType(I18NStrings.UNIT_CM_A, | |
9287 | 238 SInfoI18NStrings.CSV_FLOWDEPTH_DEVELOPMENT_PER_YEAR_HEADER, "sinfo.export.pdf.header.flowdepth.development.per.year") { |
9006 | 239 private static final long serialVersionUID = 1L; |
240 | |
9000 | 241 @Override |
242 public String exportValue(final CallContext context, final Object value) { | |
243 final double doubleValue = asDouble(value); | |
244 return exportDoubleValue(context, doubleValue); | |
245 } | |
8948 | 246 |
9000 | 247 @Override |
248 protected NumberFormat createFormatter(final CallContext context) { | |
249 return Formatter.getFlowDepthDevelopmentPerYear(context); | |
250 } | |
251 }; | |
252 | |
253 public static final SInfoResultType flowdepthmin = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_MIN_HEADER) { | |
9006 | 254 private static final long serialVersionUID = 1L; |
255 | |
8948 | 256 @Override |
257 public String exportValue(final CallContext context, final Object value) { | |
258 final double doubleValue = asDouble(value); | |
259 return exportDoubleValue(context, doubleValue); | |
260 } | |
261 | |
262 @Override | |
263 protected NumberFormat createFormatter(final CallContext context) { | |
264 return Formatter.getFlowDepth(context); | |
265 } | |
9000 | 266 }; |
8948 | 267 |
9000 | 268 public static final SInfoResultType flowdepthmax = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_MAX_HEADER) { |
9006 | 269 private static final long serialVersionUID = 1L; |
270 | |
8948 | 271 @Override |
272 public String exportValue(final CallContext context, final Object value) { | |
273 final double doubleValue = asDouble(value); | |
274 return exportDoubleValue(context, doubleValue); | |
275 } | |
276 | |
277 @Override | |
278 protected NumberFormat createFormatter(final CallContext context) { | |
279 return Formatter.getFlowDepth(context); | |
280 } | |
9000 | 281 }; |
8948 | 282 |
9145 | 283 public static final SInfoResultType riverside = new SInfoResultType(I18NStrings.UNIT_NONE, "sinfo.export.flood_duration.csv.header.riverside") { |
284 private static final long serialVersionUID = 1L; | |
285 | |
286 @Override | |
287 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
|
288 return localizeRiverside(context, (AttributeKey) value); |
9145 | 289 } |
290 | |
291 @Override | |
292 protected NumberFormat createFormatter(final CallContext context) { | |
293 throw new UnsupportedOperationException(); | |
294 } | |
295 }; | |
296 | |
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
|
297 /** |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
298 * 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
|
299 * 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
|
300 */ |
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 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
|
302 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
|
303 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
|
304 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
|
305 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
|
306 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
|
307 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
|
308 } |
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 |
9000 | 310 public static final SInfoResultType soilkind = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_TKHKIND_HEADER, |
311 "sinfo.export.tkh.pdf.header.tkhkind") { | |
9006 | 312 private static final long serialVersionUID = 1L; |
313 | |
8948 | 314 @Override |
315 public String exportValue(final CallContext context, final Object value) { | |
316 | |
317 if (value == null) | |
318 return StringUtils.EMPTY; | |
319 | |
320 final SoilKind kind = (SoilKind) value; | |
321 | |
322 final String key = SInfoI18NStrings.PREFIX_TKH_KIND + kind.name(); | |
323 return Resources.getMsg(context.getMeta(), key, key); | |
324 } | |
325 | |
326 @Override | |
327 protected NumberFormat createFormatter(final CallContext context) { | |
328 throw new UnsupportedOperationException(); | |
329 } | |
9000 | 330 }; |
8950
b0aeed4c97c1
Implemented chart output for sinfo flow depth min/max calculation
gernotbelger
parents:
8949
diff
changeset
|
331 |
9000 | 332 public static final SInfoResultType flowdepth = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_HEADER) { |
9006 | 333 private static final long serialVersionUID = 1L; |
334 | |
8951 | 335 @Override |
336 public String exportValue(final CallContext context, final Object value) { | |
337 final double doubleValue = asDouble(value); | |
338 return exportDoubleValue(context, doubleValue); | |
339 } | |
340 | |
341 @Override | |
342 protected NumberFormat createFormatter(final CallContext context) { | |
343 return Formatter.getFlowDepth(context); | |
344 } | |
8948 | 345 }; |
346 | |
9000 | 347 public static final SInfoResultType d50 = new SInfoResultType(null, null) { |
9006 | 348 private static final long serialVersionUID = 1L; |
349 | |
9000 | 350 @Override |
351 public String exportValue(final CallContext context, final Object value) { | |
352 final double doubleValue = asDouble(value); | |
353 return exportDoubleValue(context, doubleValue); | |
354 } | |
8948 | 355 |
9000 | 356 @Override |
357 protected NumberFormat createFormatter(final CallContext context) { | |
358 throw new UnsupportedOperationException(); | |
359 } | |
360 }; | |
8948 | 361 |
9000 | 362 public static final SInfoResultType velocity = new SInfoResultType(null, null) { |
9006 | 363 private static final long serialVersionUID = 1L; |
364 | |
9000 | 365 @Override |
366 public String exportValue(final CallContext context, final Object value) { | |
367 final double doubleValue = asDouble(value); | |
368 return exportDoubleValue(context, doubleValue); | |
369 } | |
8948 | 370 |
9000 | 371 @Override |
372 protected NumberFormat createFormatter(final CallContext context) { | |
373 throw new UnsupportedOperationException(); | |
374 } | |
375 }; | |
8948 | 376 |
9000 | 377 public static final SInfoResultType tau = new SInfoResultType(null, null) { |
9006 | 378 private static final long serialVersionUID = 1L; |
379 | |
9000 | 380 @Override |
381 public String exportValue(final CallContext context, final Object value) { | |
382 final double doubleValue = asDouble(value); | |
383 return exportDoubleValue(context, doubleValue); | |
384 } | |
8949
09e4a4909814
Distinguish between csv and pdf column headers
gernotbelger
parents:
8948
diff
changeset
|
385 |
9000 | 386 @Override |
387 protected NumberFormat createFormatter(final CallContext context) { | |
388 throw new UnsupportedOperationException(); | |
389 } | |
390 }; | |
391 | |
392 public static final SInfoResultType tkh = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_TKH_HEADER, SInfoI18NStrings.CSV_TKH_HEADER_SHORT) { | |
9006 | 393 private static final long serialVersionUID = 1L; |
394 | |
9000 | 395 @Override |
396 public String exportValue(final CallContext context, final Object value) { | |
397 final double doubleValue = asDouble(value); | |
398 return exportDoubleValue(context, doubleValue); | |
399 } | |
400 | |
401 @Override | |
402 protected NumberFormat createFormatter(final CallContext context) { | |
403 return Formatter.getTkh(context); | |
404 } | |
405 }; | |
406 | |
407 public static final SInfoResultType tkhup = new SInfoResultType(I18NStrings.UNIT_M, null) { | |
9006 | 408 private static final long serialVersionUID = 1L; |
409 | |
9000 | 410 @Override |
411 public String exportValue(final CallContext context, final Object value) { | |
412 final double doubleValue = asDouble(value); | |
413 return exportDoubleValue(context, doubleValue); | |
414 } | |
415 | |
416 @Override | |
417 protected NumberFormat createFormatter(final CallContext context) { | |
418 throw new UnsupportedOperationException(); | |
419 } | |
420 }; | |
421 | |
422 public static final SInfoResultType tkhdown = new SInfoResultType(I18NStrings.UNIT_M, null) { | |
9006 | 423 private static final long serialVersionUID = 1L; |
424 | |
9000 | 425 @Override |
426 public String exportValue(final CallContext context, final Object value) { | |
427 final double doubleValue = asDouble(value); | |
428 return exportDoubleValue(context, doubleValue); | |
429 } | |
430 | |
431 @Override | |
432 protected NumberFormat createFormatter(final CallContext context) { | |
433 throw new UnsupportedOperationException(); | |
434 } | |
435 }; | |
436 | |
437 public static final SInfoResultType flowdepthtkh = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTHTKH_HEADER) { | |
9006 | 438 private static final long serialVersionUID = 1L; |
439 | |
9000 | 440 @Override |
441 public String exportValue(final CallContext context, final Object value) { | |
442 final double doubleValue = asDouble(value); | |
443 return exportDoubleValue(context, doubleValue); | |
444 } | |
445 | |
446 @Override | |
447 protected NumberFormat createFormatter(final CallContext context) { | |
448 return Formatter.getFlowDepth(context); | |
449 } | |
450 }; | |
451 | |
9112
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
452 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
|
453 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
|
454 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
455 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
456 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
|
457 final double doubleValue = asDouble(value); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
458 return exportDoubleValue(context, doubleValue); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
459 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
460 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
461 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
462 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
|
463 return Formatter.getChannelWidth(context); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
464 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
465 }; |
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 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
|
468 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
|
469 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
470 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
471 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
|
472 final double doubleValue = asDouble(value); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
473 return exportDoubleValue(context, doubleValue); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
474 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
475 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
476 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
477 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
|
478 return Formatter.getChannelDepth(context); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
479 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
480 }; |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
481 |
9287 | 482 public static final SInfoResultType flowdepthDevelopment = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_FLOWDEPTH_DEVELOPMENT_HEADER, |
9000 | 483 SInfoI18NStrings.PDF_FLOWDEPTH_DEVELOPMENT_HEADER) { |
9006 | 484 private static final long serialVersionUID = 1L; |
485 | |
9000 | 486 @Override |
487 public String exportValue(final CallContext context, final Object value) { | |
488 final double doubleValue = asDouble(value); | |
489 return exportDoubleValue(context, doubleValue); | |
490 } | |
491 | |
492 @Override | |
493 protected NumberFormat createFormatter(final CallContext context) { | |
494 return Formatter.getTkh(context); | |
495 } | |
496 }; | |
497 | |
9287 | 498 public static final SInfoResultType waterlevelDifference = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_WATERLEVEL_DIFFERENCE_HEADER, |
499 SInfoI18NStrings.CSV_WATERLEVEL_DIFFERENCE_HEADER) { | |
9006 | 500 private static final long serialVersionUID = 1L; |
501 | |
9000 | 502 @Override |
503 public String exportValue(final CallContext context, final Object value) { | |
504 final double doubleValue = asDouble(value); | |
505 return exportDoubleValue(context, doubleValue); | |
506 } | |
507 | |
508 @Override | |
509 protected NumberFormat createFormatter(final CallContext context) { | |
510 return Formatter.getTkh(context); | |
511 } | |
512 }; | |
9287 | 513 public static final SInfoResultType bedHeightDifference = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_DIFFERENCE_HEADER, |
9109 | 514 "sinfo.export.csv.header.mean_bed_height.difference") { |
9006 | 515 private static final long serialVersionUID = 1L; |
516 | |
9000 | 517 @Override |
518 public String exportValue(final CallContext context, final Object value) { | |
519 final double doubleValue = asDouble(value); | |
520 return exportDoubleValue(context, doubleValue); | |
521 } | |
522 | |
523 @Override | |
524 protected NumberFormat createFormatter(final CallContext context) { | |
525 return Formatter.getTkh(context); | |
526 } | |
527 }; | |
528 public static final SInfoResultType flowdepthCurrent = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_CURRENT_HEADER) { | |
9006 | 529 private static final long serialVersionUID = 1L; |
530 | |
9000 | 531 @Override |
532 public String exportValue(final CallContext context, final Object value) { | |
533 final double doubleValue = asDouble(value); | |
534 return exportDoubleValue(context, doubleValue); | |
535 } | |
536 | |
537 @Override | |
538 protected NumberFormat createFormatter(final CallContext context) { | |
539 return Formatter.getFlowDepth(context); | |
540 } | |
541 }; | |
542 public static final SInfoResultType flowdepthHistorical = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_HISTORICAL_HEADER) { | |
9006 | 543 private static final long serialVersionUID = 1L; |
544 | |
9000 | 545 @Override |
546 public String exportValue(final CallContext context, final Object value) { | |
547 final double doubleValue = asDouble(value); | |
548 return exportDoubleValue(context, doubleValue); | |
549 } | |
550 | |
551 @Override | |
552 protected NumberFormat createFormatter(final CallContext context) { | |
553 return Formatter.getFlowDepth(context); | |
554 } | |
555 }; | |
556 | |
9202
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
557 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
|
558 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
|
559 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
|
560 |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
561 @Override |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
562 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
|
563 final double doubleValue = asDouble(value); |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
564 return exportDoubleValue(context, doubleValue); |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
565 } |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
566 |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
567 @Override |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
568 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
|
569 return Formatter.getInfrastructureHeight(context); |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
570 } |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
571 }; |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
572 |
9117
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
573 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
|
574 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
|
575 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
576 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
577 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
|
578 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
|
579 return exportDoubleValue(context, doubleValue); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
580 } |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
581 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
582 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
583 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
|
584 return Formatter.getCollisionCount(context); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
585 } |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
586 }; |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
587 |
9582 | 588 public static final SInfoResultType collisionGaugeW = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_COLLISION_GAUGEW_HEADER, |
589 "sinfo.export.pdf.header.collision.gaugew.with_unit") { | |
9117
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
590 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
|
591 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
592 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
593 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
|
594 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
|
595 return exportDoubleValue(context, doubleValue); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
596 } |
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 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
599 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
|
600 return Formatter.getCollisionGaugeW(context); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
601 } |
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 |
9157
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
604 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
|
605 private static final long serialVersionUID = 1L; |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
606 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
607 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
608 public String exportValue(final CallContext context, final Object value) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
609 return exportStringValue(value); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
610 } |
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 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
613 protected NumberFormat createFormatter(final CallContext context) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
614 throw new UnsupportedOperationException(); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
615 } |
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 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
|
619 private static final long serialVersionUID = 1L; |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
620 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
621 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
622 public String exportValue(final CallContext context, final Object value) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
623 return exportStringValue(value); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
624 } |
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 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
627 protected NumberFormat createFormatter(final CallContext context) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
628 throw new UnsupportedOperationException(); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
629 } |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
630 }; |
8948 | 631 } |