annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java @ 9491:d7d22ea8573d

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

http://dive4elements.wald.intevation.org