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