Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java @ 9614:d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
author | mschaefer |
---|---|
date | Wed, 09 Oct 2019 19:17:06 +0200 |
parents | 8232a3f5967b |
children |
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; | |
9609 | 13 import java.text.ParseException; |
8948 | 14 |
15 import org.apache.commons.lang.StringUtils; | |
9490
e44c1a8b0c54
Fixed: rounding problems in iota/salix scenario calculation
mschaefer
parents:
9429
diff
changeset
|
16 import org.apache.log4j.Logger; |
8948 | 17 import org.dive4elements.artifacts.CallContext; |
9000 | 18 import org.dive4elements.river.artifacts.common.AbstractResultType; |
19 import org.dive4elements.river.artifacts.common.I18NStrings; | |
8948 | 20 import org.dive4elements.river.artifacts.resources.Resources; |
21 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
|
22 import org.dive4elements.river.model.Attribute.AttributeKey; |
8948 | 23 import org.dive4elements.river.utils.Formatter; |
24 import org.dive4elements.river.utils.RiverUtils; | |
25 | |
26 /** | |
27 * Result type for data that goes into {@link SInfoResultRow}s. | |
28 * | |
29 * @author Gernot Belger | |
30 */ | |
9000 | 31 public abstract class SInfoResultType extends AbstractResultType { |
8948 | 32 |
9006 | 33 private static final long serialVersionUID = 1L; |
34 | |
9490
e44c1a8b0c54
Fixed: rounding problems in iota/salix scenario calculation
mschaefer
parents:
9429
diff
changeset
|
35 protected static Logger log = Logger.getLogger(SInfoResultType.class); |
e44c1a8b0c54
Fixed: rounding problems in iota/salix scenario calculation
mschaefer
parents:
9429
diff
changeset
|
36 |
9429
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9318
diff
changeset
|
37 protected SInfoResultType(final String unit, final String csvHeader) { |
9000 | 38 super(unit, csvHeader, csvHeader); |
39 } | |
8948 | 40 |
9429
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9318
diff
changeset
|
41 protected SInfoResultType(final String unit, final String csvHeader, final String pdfHeader) { |
9000 | 42 super(unit, csvHeader, pdfHeader); |
43 } | |
8948 | 44 |
9145 | 45 public static final SInfoResultType customMultiRowColWaterlevel = new SInfoResultType(null, SInfoI18NStrings.CSV_WATERLEVEL_HEADER, |
46 "sinfo.export.flow_depth.pdf.header.waterlevel") { | |
47 private static final long serialVersionUID = 1L; | |
48 | |
49 @Override | |
50 public String exportValue(final CallContext context, final Object value) { | |
9205
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9202
diff
changeset
|
51 throw new UnsupportedOperationException(); |
9145 | 52 } |
53 | |
54 @Override | |
55 protected NumberFormat createFormatter(final CallContext context) { | |
9205
3dae6b78e1da
inundationDuration/floodDuration multiple columns+chartLines refactoring
gernotbelger
parents:
9202
diff
changeset
|
56 throw new UnsupportedOperationException(); |
9145 | 57 } |
58 | |
59 }; | |
60 | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
61 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
|
62 "sinfo.export.flood_duration.pdf.header.discharge") { |
9145 | 63 private static final long serialVersionUID = 1L; |
64 | |
65 @Override | |
66 public String exportValue(final CallContext context, final Object value) { | |
67 final double doubleValue = asDouble(value); | |
9609 | 68 final String significant = Formatter.SIGINIFICANT_FORMATTER_3.format(doubleValue); |
69 try { | |
70 final Number significantD = Formatter.SIGINIFICANT_FORMATTER_3.parse(significant); | |
71 return exportDoubleValue(context, asDouble(significantD)); | |
72 } | |
73 catch (final ParseException e) { | |
74 e.printStackTrace(); | |
75 return ""; | |
76 } | |
9145 | 77 } |
78 | |
79 @Override | |
80 protected NumberFormat createFormatter(final CallContext context) { | |
9609 | 81 return Formatter.getFormatter(context, 0, 3); |
9145 | 82 } |
83 }; | |
84 | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
85 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
|
86 "sinfo.export.flood_duration.pdf.header.duration") { |
9145 | 87 private static final long serialVersionUID = 1L; |
88 | |
89 @Override | |
90 public String exportValue(final CallContext context, final Object value) { | |
91 final double doubleValue = asDouble(value); | |
9176
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
92 return exportDoubleValue(context, doubleValue); |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
93 } |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
94 |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
95 @Override |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
96 protected NumberFormat createFormatter(final CallContext context) { |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
97 return Formatter.getIntegerFormatter(context); |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
98 } |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
99 }; |
1614cb14308f
Work on calculations for S-Info flood duration workflow
mschaefer
parents:
9157
diff
changeset
|
100 |
9000 | 101 public static final SInfoResultType waterlevel = new SInfoResultType(null, SInfoI18NStrings.CSV_WATERLEVEL_HEADER, |
102 "sinfo.export.flow_depth.pdf.header.waterlevel") { | |
9006 | 103 private static final long serialVersionUID = 1L; |
104 | |
8948 | 105 @Override |
106 public String exportValue(final CallContext context, final Object value) { | |
107 final double doubleValue = asDouble(value); | |
108 return exportDoubleValue(context, doubleValue); | |
109 } | |
110 | |
111 @Override | |
112 protected NumberFormat createFormatter(final CallContext context) { | |
113 // REMARK: other modules use Formatter.getWaterlevelW(context) instead, but that format with a variable number of | |
114 // digits. | |
115 return Formatter.getFlowDepth(context); | |
116 } | |
9000 | 117 }; |
8948 | 118 |
9609 | 119 // TODO: check, if it is being used correctly |
9614
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
120 public static final SInfoResultType infrastructuregroup = new SInfoResultType(I18NStrings.UNIT_NONE, |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
121 "sinfo.export.flood_duration.csv.header.infrastructure_group", "sinfo.export.flood_duration.pdf.header.infrastructure_group") { |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
122 private static final long serialVersionUID = 1L; |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
123 |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
124 @Override |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
125 public String exportValue(final CallContext context, final Object value) { |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
126 return exportStringValue(value); |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
127 } |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
128 |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
129 @Override |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
130 protected NumberFormat createFormatter(final CallContext context) { |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
131 throw new UnsupportedOperationException(); |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
132 } |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
133 }; |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
134 // |
9318
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
135 public static final SInfoResultType infrastructuretype = new SInfoResultType(I18NStrings.UNIT_NONE, |
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
136 "sinfo.export.flood_duration.csv.header.infrastructure_type", "sinfo.export.flood_duration.pdf.header.infrastructure_type") { |
9006 | 137 private static final long serialVersionUID = 1L; |
138 | |
8948 | 139 @Override |
140 public String exportValue(final CallContext context, final Object value) { | |
141 return exportStringValue(value); | |
142 } | |
143 | |
144 @Override | |
145 protected NumberFormat createFormatter(final CallContext context) { | |
146 throw new UnsupportedOperationException(); | |
147 } | |
9000 | 148 }; |
9609 | 149 |
9614
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
150 /** |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
151 * Gets the label of the type and bank location of an infrastructure |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
152 */ |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
153 public static final String getInfrastructureLabel(final CallContext context, final String group, final String type, final AttributeKey riverside) { |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
154 return group + " - " + type + " (" + localizeRiverside(context, riverside) + ")"; |
d889ffe2fb05
Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
mschaefer
parents:
9609
diff
changeset
|
155 } |
8948 | 156 |
9318
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
157 public static final SInfoResultType dischargeLong = new SInfoResultType(I18NStrings.UNIT_CUBIC_M, "sinfo.export.collision.csv.header.discharge_long") { |
9145 | 158 private static final long serialVersionUID = 1L; |
159 | |
160 @Override | |
161 public String exportValue(final CallContext context, final Object value) { | |
9318
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
162 final double doubleValue = asDouble(value); |
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
163 final double roundedDischarge = RiverUtils.roundQ(doubleValue); |
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
164 return exportDoubleValue(context, roundedDischarge); |
9145 | 165 } |
166 | |
167 @Override | |
168 protected NumberFormat createFormatter(final CallContext context) { | |
9318
7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
gernotbelger
parents:
9312
diff
changeset
|
169 return Formatter.getWaterlevelQ(context); |
9145 | 170 } |
171 }; | |
172 | |
9000 | 173 public static final SInfoResultType discharge = new SInfoResultType(I18NStrings.UNIT_CUBIC_M, SInfoI18NStrings.CSV_DISCHARGE_HEADER) { |
9006 | 174 private static final long serialVersionUID = 1L; |
175 | |
8948 | 176 @Override |
177 public String exportValue(final CallContext context, final Object value) { | |
178 final double doubleValue = asDouble(value); | |
179 final double roundedDischarge = RiverUtils.roundQ(doubleValue); | |
180 return exportDoubleValue(context, roundedDischarge); | |
181 } | |
182 | |
183 @Override | |
184 protected NumberFormat createFormatter(final CallContext context) { | |
185 return Formatter.getWaterlevelQ(context); | |
186 } | |
9000 | 187 }; |
8948 | 188 |
9202
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
189 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
|
190 "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
|
191 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
|
192 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
193 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
194 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
|
195 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
|
196 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
|
197 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
|
198 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
199 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
200 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
201 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
|
202 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
|
203 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
204 }; |
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 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
|
207 "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
|
208 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
|
209 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
210 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
211 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
|
212 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
|
213 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
|
214 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
|
215 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
216 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
217 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
218 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
|
219 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
|
220 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
221 }; |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
222 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
223 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
|
224 "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
|
225 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
|
226 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
227 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
228 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
|
229 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
|
230 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
|
231 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
|
232 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
233 |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
234 @Override |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
235 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
|
236 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
|
237 } |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
238 }; |
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
239 |
9609 | 240 public static final SInfoResultType maxBedHeight = new SInfoResultType(null, null, null) { |
241 private static final long serialVersionUID = 1L; | |
242 | |
243 @Override | |
244 public String exportValue(final CallContext context, final Object value) { | |
245 final double doubleValue = asDouble(value); | |
246 return exportDoubleValue(context, doubleValue); | |
247 } | |
248 | |
249 @Override | |
250 protected NumberFormat createFormatter(final CallContext context) { | |
251 return Formatter.getMeanBedHeight(context); | |
252 } | |
253 }; | |
254 | |
255 public static final SInfoResultType minBedHeight = new SInfoResultType(null, null, null) { | |
256 private static final long serialVersionUID = 1L; | |
257 | |
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.getMeanBedHeight(context); | |
267 } | |
268 }; | |
269 | |
9000 | 270 public static final SInfoResultType meanBedHeight = new SInfoResultType(null, SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_HEADER, |
271 SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_HEADER_SHORT) { | |
9006 | 272 private static final long serialVersionUID = 1L; |
273 | |
8948 | 274 @Override |
275 public String exportValue(final CallContext context, final Object value) { | |
276 final double doubleValue = asDouble(value); | |
277 return exportDoubleValue(context, doubleValue); | |
278 } | |
279 | |
280 @Override | |
281 protected NumberFormat createFormatter(final CallContext context) { | |
282 return Formatter.getMeanBedHeight(context); | |
283 } | |
9000 | 284 }; |
8948 | 285 |
9000 | 286 public static final SInfoResultType soundingLabel = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_SOUNDING_HEADER) { |
9006 | 287 private static final long serialVersionUID = 1L; |
288 | |
8948 | 289 @Override |
290 public String exportValue(final CallContext context, final Object value) { | |
291 return exportStringValue(value); | |
292 } | |
293 | |
294 @Override | |
295 protected NumberFormat createFormatter(final CallContext context) { | |
296 throw new UnsupportedOperationException(); | |
297 } | |
9000 | 298 }; |
299 public static final SInfoResultType flowdepthDevelopmentPerYear = new SInfoResultType(I18NStrings.UNIT_CM_A, | |
9287 | 300 SInfoI18NStrings.CSV_FLOWDEPTH_DEVELOPMENT_PER_YEAR_HEADER, "sinfo.export.pdf.header.flowdepth.development.per.year") { |
9006 | 301 private static final long serialVersionUID = 1L; |
302 | |
9000 | 303 @Override |
304 public String exportValue(final CallContext context, final Object value) { | |
305 final double doubleValue = asDouble(value); | |
306 return exportDoubleValue(context, doubleValue); | |
307 } | |
8948 | 308 |
9000 | 309 @Override |
310 protected NumberFormat createFormatter(final CallContext context) { | |
311 return Formatter.getFlowDepthDevelopmentPerYear(context); | |
312 } | |
313 }; | |
314 | |
315 public static final SInfoResultType flowdepthmin = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_MIN_HEADER) { | |
9006 | 316 private static final long serialVersionUID = 1L; |
317 | |
8948 | 318 @Override |
319 public String exportValue(final CallContext context, final Object value) { | |
320 final double doubleValue = asDouble(value); | |
321 return exportDoubleValue(context, doubleValue); | |
322 } | |
323 | |
324 @Override | |
325 protected NumberFormat createFormatter(final CallContext context) { | |
326 return Formatter.getFlowDepth(context); | |
327 } | |
9000 | 328 }; |
8948 | 329 |
9000 | 330 public static final SInfoResultType flowdepthmax = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_MAX_HEADER) { |
9006 | 331 private static final long serialVersionUID = 1L; |
332 | |
8948 | 333 @Override |
334 public String exportValue(final CallContext context, final Object value) { | |
335 final double doubleValue = asDouble(value); | |
336 return exportDoubleValue(context, doubleValue); | |
337 } | |
338 | |
339 @Override | |
340 protected NumberFormat createFormatter(final CallContext context) { | |
341 return Formatter.getFlowDepth(context); | |
342 } | |
9000 | 343 }; |
8948 | 344 |
9609 | 345 public static final SInfoResultType riverside = new SInfoResultType(I18NStrings.UNIT_NONE, "sinfo.export.flood_duration.csv.header.riverside", |
346 "sinfo.export.flood_duration.pdf.header.riverside") { | |
9145 | 347 private static final long serialVersionUID = 1L; |
348 | |
349 @Override | |
350 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
|
351 return localizeRiverside(context, (AttributeKey) value); |
9145 | 352 } |
353 | |
354 @Override | |
355 protected NumberFormat createFormatter(final CallContext context) { | |
356 throw new UnsupportedOperationException(); | |
357 } | |
358 }; | |
359 | |
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
|
360 /** |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
361 * 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
|
362 * 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
|
363 */ |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
364 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
|
365 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
|
366 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
|
367 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
|
368 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
|
369 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
|
370 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
|
371 } |
0dcd1cd41915
Different themes/facets for left bank and right bank infrastructures in S-Info flood durations, some fixmes done
mschaefer
parents:
9205
diff
changeset
|
372 |
9000 | 373 public static final SInfoResultType soilkind = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_TKHKIND_HEADER, |
374 "sinfo.export.tkh.pdf.header.tkhkind") { | |
9006 | 375 private static final long serialVersionUID = 1L; |
376 | |
8948 | 377 @Override |
378 public String exportValue(final CallContext context, final Object value) { | |
379 | |
380 if (value == null) | |
381 return StringUtils.EMPTY; | |
382 | |
383 final SoilKind kind = (SoilKind) value; | |
384 | |
385 final String key = SInfoI18NStrings.PREFIX_TKH_KIND + kind.name(); | |
386 return Resources.getMsg(context.getMeta(), key, key); | |
387 } | |
388 | |
389 @Override | |
390 protected NumberFormat createFormatter(final CallContext context) { | |
391 throw new UnsupportedOperationException(); | |
392 } | |
9000 | 393 }; |
8950
b0aeed4c97c1
Implemented chart output for sinfo flow depth min/max calculation
gernotbelger
parents:
8949
diff
changeset
|
394 |
9000 | 395 public static final SInfoResultType flowdepth = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_HEADER) { |
9006 | 396 private static final long serialVersionUID = 1L; |
397 | |
8951 | 398 @Override |
399 public String exportValue(final CallContext context, final Object value) { | |
400 final double doubleValue = asDouble(value); | |
401 return exportDoubleValue(context, doubleValue); | |
402 } | |
403 | |
404 @Override | |
405 protected NumberFormat createFormatter(final CallContext context) { | |
406 return Formatter.getFlowDepth(context); | |
407 } | |
8948 | 408 }; |
409 | |
9000 | 410 public static final SInfoResultType d50 = new SInfoResultType(null, null) { |
9006 | 411 private static final long serialVersionUID = 1L; |
412 | |
9000 | 413 @Override |
414 public String exportValue(final CallContext context, final Object value) { | |
415 final double doubleValue = asDouble(value); | |
416 return exportDoubleValue(context, doubleValue); | |
417 } | |
8948 | 418 |
9000 | 419 @Override |
420 protected NumberFormat createFormatter(final CallContext context) { | |
421 throw new UnsupportedOperationException(); | |
422 } | |
423 }; | |
8948 | 424 |
9000 | 425 public static final SInfoResultType velocity = new SInfoResultType(null, null) { |
9006 | 426 private static final long serialVersionUID = 1L; |
427 | |
9000 | 428 @Override |
429 public String exportValue(final CallContext context, final Object value) { | |
430 final double doubleValue = asDouble(value); | |
431 return exportDoubleValue(context, doubleValue); | |
432 } | |
8948 | 433 |
9000 | 434 @Override |
435 protected NumberFormat createFormatter(final CallContext context) { | |
436 throw new UnsupportedOperationException(); | |
437 } | |
438 }; | |
8948 | 439 |
9000 | 440 public static final SInfoResultType tau = new SInfoResultType(null, null) { |
9006 | 441 private static final long serialVersionUID = 1L; |
442 | |
9000 | 443 @Override |
444 public String exportValue(final CallContext context, final Object value) { | |
445 final double doubleValue = asDouble(value); | |
446 return exportDoubleValue(context, doubleValue); | |
447 } | |
8949
09e4a4909814
Distinguish between csv and pdf column headers
gernotbelger
parents:
8948
diff
changeset
|
448 |
9000 | 449 @Override |
450 protected NumberFormat createFormatter(final CallContext context) { | |
451 throw new UnsupportedOperationException(); | |
452 } | |
453 }; | |
454 | |
455 public static final SInfoResultType tkh = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_TKH_HEADER, SInfoI18NStrings.CSV_TKH_HEADER_SHORT) { | |
9006 | 456 private static final long serialVersionUID = 1L; |
457 | |
9000 | 458 @Override |
459 public String exportValue(final CallContext context, final Object value) { | |
460 final double doubleValue = asDouble(value); | |
461 return exportDoubleValue(context, doubleValue); | |
462 } | |
463 | |
464 @Override | |
465 protected NumberFormat createFormatter(final CallContext context) { | |
466 return Formatter.getTkh(context); | |
467 } | |
468 }; | |
469 | |
470 public static final SInfoResultType tkhup = new SInfoResultType(I18NStrings.UNIT_M, null) { | |
9006 | 471 private static final long serialVersionUID = 1L; |
472 | |
9000 | 473 @Override |
474 public String exportValue(final CallContext context, final Object value) { | |
475 final double doubleValue = asDouble(value); | |
476 return exportDoubleValue(context, doubleValue); | |
477 } | |
478 | |
479 @Override | |
480 protected NumberFormat createFormatter(final CallContext context) { | |
481 throw new UnsupportedOperationException(); | |
482 } | |
483 }; | |
484 | |
485 public static final SInfoResultType tkhdown = new SInfoResultType(I18NStrings.UNIT_M, null) { | |
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 throw new UnsupportedOperationException(); | |
497 } | |
498 }; | |
499 | |
500 public static final SInfoResultType flowdepthtkh = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTHTKH_HEADER) { | |
9006 | 501 private static final long serialVersionUID = 1L; |
502 | |
9000 | 503 @Override |
504 public String exportValue(final CallContext context, final Object value) { | |
505 final double doubleValue = asDouble(value); | |
506 return exportDoubleValue(context, doubleValue); | |
507 } | |
508 | |
509 @Override | |
510 protected NumberFormat createFormatter(final CallContext context) { | |
511 return Formatter.getFlowDepth(context); | |
512 } | |
513 }; | |
514 | |
9112
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
515 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
|
516 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
|
517 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
518 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
519 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
|
520 final double doubleValue = asDouble(value); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
521 return exportDoubleValue(context, doubleValue); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
522 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
523 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
524 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
525 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
|
526 return Formatter.getChannelWidth(context); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
527 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
528 }; |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
529 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
530 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
|
531 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
|
532 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
533 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
534 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
|
535 final double doubleValue = asDouble(value); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
536 return exportDoubleValue(context, doubleValue); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
537 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
538 |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
539 @Override |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
540 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
|
541 return Formatter.getChannelDepth(context); |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
542 } |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
543 }; |
189cc8ededbd
Added datacage select and chart display for river channel sizes loaded from database
mschaefer
parents:
9109
diff
changeset
|
544 |
9287 | 545 public static final SInfoResultType flowdepthDevelopment = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_FLOWDEPTH_DEVELOPMENT_HEADER, |
9000 | 546 SInfoI18NStrings.PDF_FLOWDEPTH_DEVELOPMENT_HEADER) { |
9006 | 547 private static final long serialVersionUID = 1L; |
548 | |
9000 | 549 @Override |
550 public String exportValue(final CallContext context, final Object value) { | |
551 final double doubleValue = asDouble(value); | |
552 return exportDoubleValue(context, doubleValue); | |
553 } | |
554 | |
555 @Override | |
556 protected NumberFormat createFormatter(final CallContext context) { | |
557 return Formatter.getTkh(context); | |
558 } | |
559 }; | |
560 | |
9287 | 561 public static final SInfoResultType waterlevelDifference = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_WATERLEVEL_DIFFERENCE_HEADER, |
562 SInfoI18NStrings.CSV_WATERLEVEL_DIFFERENCE_HEADER) { | |
9006 | 563 private static final long serialVersionUID = 1L; |
564 | |
9000 | 565 @Override |
566 public String exportValue(final CallContext context, final Object value) { | |
567 final double doubleValue = asDouble(value); | |
568 return exportDoubleValue(context, doubleValue); | |
569 } | |
570 | |
571 @Override | |
572 protected NumberFormat createFormatter(final CallContext context) { | |
573 return Formatter.getTkh(context); | |
574 } | |
575 }; | |
9287 | 576 public static final SInfoResultType bedHeightDifference = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_MEAN_BED_HEIGHT_DIFFERENCE_HEADER, |
9109 | 577 "sinfo.export.csv.header.mean_bed_height.difference") { |
9006 | 578 private static final long serialVersionUID = 1L; |
579 | |
9000 | 580 @Override |
581 public String exportValue(final CallContext context, final Object value) { | |
582 final double doubleValue = asDouble(value); | |
583 return exportDoubleValue(context, doubleValue); | |
584 } | |
585 | |
586 @Override | |
587 protected NumberFormat createFormatter(final CallContext context) { | |
588 return Formatter.getTkh(context); | |
589 } | |
590 }; | |
591 public static final SInfoResultType flowdepthCurrent = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_CURRENT_HEADER) { | |
9006 | 592 private static final long serialVersionUID = 1L; |
593 | |
9000 | 594 @Override |
595 public String exportValue(final CallContext context, final Object value) { | |
596 final double doubleValue = asDouble(value); | |
597 return exportDoubleValue(context, doubleValue); | |
598 } | |
599 | |
600 @Override | |
601 protected NumberFormat createFormatter(final CallContext context) { | |
602 return Formatter.getFlowDepth(context); | |
603 } | |
604 }; | |
605 public static final SInfoResultType flowdepthHistorical = new SInfoResultType(I18NStrings.UNIT_M, SInfoI18NStrings.CSV_FLOWDEPTH_HISTORICAL_HEADER) { | |
9006 | 606 private static final long serialVersionUID = 1L; |
607 | |
9000 | 608 @Override |
609 public String exportValue(final CallContext context, final Object value) { | |
610 final double doubleValue = asDouble(value); | |
611 return exportDoubleValue(context, doubleValue); | |
612 } | |
613 | |
614 @Override | |
615 protected NumberFormat createFormatter(final CallContext context) { | |
616 return Formatter.getFlowDepth(context); | |
617 } | |
618 }; | |
619 | |
9202
b4402594213b
More work on calculations and output for S-Info flood duration workflow (chart types 1 and 2)
mschaefer
parents:
9176
diff
changeset
|
620 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
|
621 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
|
622 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
|
623 |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
624 @Override |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
625 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
|
626 final double doubleValue = asDouble(value); |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
627 return exportDoubleValue(context, doubleValue); |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
628 } |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
629 |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
630 @Override |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
631 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
|
632 return Formatter.getInfrastructureHeight(context); |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
633 } |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
634 }; |
a165cd63099f
Added datacage select and chart display for river infrastructure heights loaded from database
mschaefer
parents:
9112
diff
changeset
|
635 |
9117
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
636 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
|
637 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
|
638 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
639 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
640 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
|
641 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
|
642 return exportDoubleValue(context, doubleValue); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
643 } |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
644 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
645 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
646 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
|
647 return Formatter.getCollisionCount(context); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
648 } |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
649 }; |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
650 |
9582 | 651 public static final SInfoResultType collisionGaugeW = new SInfoResultType(I18NStrings.UNIT_CM, SInfoI18NStrings.CSV_COLLISION_GAUGEW_HEADER, |
652 "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
|
653 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
|
654 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
655 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
656 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
|
657 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
|
658 return exportDoubleValue(context, doubleValue); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
659 } |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
660 |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
661 @Override |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
662 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
|
663 return Formatter.getCollisionGaugeW(context); |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
664 } |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
665 }; |
623b51bf03d7
Added datacage select and chart display for river bed collision counts loaded from database
mschaefer
parents:
9115
diff
changeset
|
666 |
9157
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
667 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
|
668 private static final long serialVersionUID = 1L; |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
669 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
670 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
671 public String exportValue(final CallContext context, final Object value) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
672 return exportStringValue(value); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
673 } |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
674 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
675 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
676 protected NumberFormat createFormatter(final CallContext context) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
677 throw new UnsupportedOperationException(); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
678 } |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
679 }; |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
680 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
681 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
|
682 private static final long serialVersionUID = 1L; |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
683 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
684 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
685 public String exportValue(final CallContext context, final Object value) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
686 return exportStringValue(value); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
687 } |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
688 |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
689 @Override |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
690 protected NumberFormat createFormatter(final CallContext context) { |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
691 throw new UnsupportedOperationException(); |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
692 } |
f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
mschaefer
parents:
9145
diff
changeset
|
693 }; |
8948 | 694 } |