annotate flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/DeltaWtExporter.java @ 5603:47e5bc64d3de

FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
author Sascha L. Teichmann <teichmann@intevation.de>
date Mon, 08 Apr 2013 17:23:20 +0200
parents b195fede1c3b
children
rev   line source
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.exports.fixings;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
3 import au.com.bytecode.opencsv.CSVWriter;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
4
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
5 import de.intevation.artifacts.CallContext;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
6 import de.intevation.artifacts.CallMeta;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
7
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
8 import de.intevation.flys.artifacts.model.CalculationResult;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
9
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10 import de.intevation.flys.artifacts.model.fixings.AnalysisPeriod;
3415
e3c7a3228bc2 FixA: Renamed FixResult to FixAnalysisResult.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3402
diff changeset
11 import de.intevation.flys.artifacts.model.fixings.FixAnalysisResult;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
12 import de.intevation.flys.artifacts.model.fixings.QWD;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
13
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
14 import de.intevation.flys.artifacts.resources.Resources;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
15
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
16 import de.intevation.flys.exports.AbstractExporter;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
17
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
18 import de.intevation.flys.utils.Formatter;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
19 import de.intevation.flys.utils.KMIndex;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
20
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
21 import java.io.IOException;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
22 import java.io.OutputStream;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
23
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
24 import java.text.DateFormat;
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
25 import java.text.MessageFormat;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
26 import java.text.NumberFormat;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
27
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
28 import java.util.ArrayList;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
29 import java.util.List;
5603
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
30 import java.util.TreeMap;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
31
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
32 import org.apache.log4j.Logger;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
34 import org.w3c.dom.Document;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
35
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
36 /** Exports fixation analysis deltaw(t) computation results to csv. */
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
37 public class DeltaWtExporter
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
38 extends AbstractExporter
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
39 {
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
40 /** Private logger. */
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
41 private static Logger log = Logger.getLogger(DeltaWtExporter.class);
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
42
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
43 public static final String CSV_KM_HEADER =
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
44 "export.fixings.deltawt.csv.header.km";
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
45
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
46 public static final String CSV_DELTA_W_HEADER =
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
47 "export.fixings.deltawt.csv.header.deltaw";
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
48
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
49 public static final String CSV_Q_HEADER =
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
50 "export.fixings.deltawt.csv.header.q";
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
51
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
52 public static final String CSV_W_HEADER =
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
53 "export.fixings.deltawt.csv.header.w";
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
54
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
55 public static final String CSV_TRANGE_HEADER =
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
56 "export.fixings.deltawt.csv.header.time.range";
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
57
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
58 public static final String CSV_T_HEADER =
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
59 "export.fixings.deltawt.csv.header.t";
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
60
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
61 public static final String CSV_T_FORMAT =
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
62 "export.fixings.deltawt.csv.t.format";
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
63
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
64 public static final String DEFAULT_CSV_KM_HEADER = "km";
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
65
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
66 public static final String DEFAULT_CSV_DELTA_W_HEADER = "\u0394 W [cm]";
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
67
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
68 public static final String DEFAULT_CSV_W_HEADER = "Wasserstand [m]";
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
69
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
70 public static final String DEFAULT_CSV_Q_HEADER = "Abfluss [m\u00b3/s]";
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
71
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
72 public static final String DEFAULT_CSV_T_HEADER = "Datum";
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
73
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
74 public static final String DEFAULT_CSV_TRANGE_DESC_HEADER =
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
75 "Status";
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
76
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
77 public static final String CSV_REFERENCE =
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
78 "export.fixings.deltawt.csv.reference";
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
79
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
80 public static final String CSV_ANALYSIS =
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
81 "export.fixings.deltawt.csv.analysis";
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
82
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
83 public static final String DEFAULT_CSV_REFERENCE =
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
84 "B";
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
85
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
86 public static final String DEFAULT_CSV_ANALYSIS =
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
87 "A{0,number,integer}";
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
88
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
89 public static final String DEFAULT_CSV_T_FORMAT =
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
90 "dd.MM.yyyy";
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
91
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
92 protected List<KMIndex<AnalysisPeriod []>> analysisPeriods;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
93
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
94 protected List<KMIndex<QWD[]>> referenceEvents;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
95
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
96 @Override
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
97 public void init(Document request, OutputStream out, CallContext context) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
98 log.debug("DeltaWtExporter.init");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
99 super.init(request, out, context);
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
100 analysisPeriods = new ArrayList<KMIndex<AnalysisPeriod []>>();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
101 referenceEvents = new ArrayList<KMIndex<QWD[]>>();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
102 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
103
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
104 @Override
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
105 protected void addData(Object d) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
106 log.debug("DeltaWtExporter.addData");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
107 if (!(d instanceof CalculationResult)) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
108 log.warn("Invalid data type");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
109 return;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
110 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
111
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
112 Object data = ((CalculationResult)d).getData();
3415
e3c7a3228bc2 FixA: Renamed FixResult to FixAnalysisResult.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3402
diff changeset
113 if (!(data instanceof FixAnalysisResult)) {
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
114 log.warn("Invalid data stored in result.");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
115 }
3415
e3c7a3228bc2 FixA: Renamed FixResult to FixAnalysisResult.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3402
diff changeset
116 FixAnalysisResult result = (FixAnalysisResult)data;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
117 analysisPeriods.add(result.getAnalysisPeriods());
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
118 referenceEvents.add(result.getReferenced());
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
119 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
120
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
121 @Override
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
122 protected void writeCSVData(CSVWriter writer) throws IOException {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
123
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
124 boolean debug = log.isDebugEnabled();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
125
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
126 writeCSVHeader(writer);
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
127
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
128 NumberFormat kmF = getKMFormatter();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
129 NumberFormat dwF = getDeltaWFormatter();
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
130 NumberFormat qF = getQFormatter();
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
131 NumberFormat wF = getWFormatter();
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
132
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
133 DateFormat dF = getDateFormatter();
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
134
5603
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
135 TreeMap<Double, ArrayList<String []>> sorted =
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
136 new TreeMap<Double, ArrayList<String []>>();
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
137
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
138 String referenceS = getReference();
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
139
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
140 for (KMIndex<QWD[]> reference: referenceEvents) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
141
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
142 for (KMIndex.Entry<QWD[]> kmEntry: reference) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
143
5603
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
144 Double km = kmEntry.getKm();
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
145
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
146 ArrayList<String []> list = sorted.get(km);
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
147
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
148 if (list == null) {
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
149 list = new ArrayList<String []>();
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
150 sorted.put(km, list);
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
151 }
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
152
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
153 String kmS = kmF.format(kmEntry.getKm());
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
154 for (QWD qwd: kmEntry.getValue()) {
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
155 String deltaWS = dwF.format(qwd.getDeltaW());
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
156 String qS = qF.format(qwd.getQ());
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
157 String wS = wF.format(qwd.getW());
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
158 String dateS = dF.format(qwd.getDate());
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
159
5603
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
160 list.add(new String[] {
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
161 kmS,
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
162 dateS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
163 qS,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
164 wS,
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
165 referenceS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
166 deltaWS
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
167 });
5603
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
168 }
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
169 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
170 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
171
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
172 if (debug) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
173 log.debug("AnalysisPeriods: " + analysisPeriods.size());
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
174 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
175
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
176 String analysisTemplate = getAnalysisTemplate();
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
177
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
178 for (KMIndex<AnalysisPeriod []> periods: analysisPeriods) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
179
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
180 for (KMIndex.Entry<AnalysisPeriod []> kmEntry: periods) {
4736
b195fede1c3b Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4238
diff changeset
181
5603
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
182 Double km = kmEntry.getKm();
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
183
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
184 ArrayList<String []> list = sorted.get(km);
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
185
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
186 if (list == null) {
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
187 list = new ArrayList<String []>();
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
188 sorted.put(km, list);
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
189 }
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
190
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
191 String kmS = kmF.format(kmEntry.getKm());
4238
50273de4cf63 flys/issue825/2 Fix labeling of Analysisperiods (like A1, A2....)
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3915
diff changeset
192 int analysisCount = 1;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
193
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
194 for (AnalysisPeriod period: kmEntry.getValue()) {
4238
50273de4cf63 flys/issue825/2 Fix labeling of Analysisperiods (like A1, A2....)
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3915
diff changeset
195 // Typically resulting in A1,A2...
50273de4cf63 flys/issue825/2 Fix labeling of Analysisperiods (like A1, A2....)
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3915
diff changeset
196 String analyisS = MessageFormat.format(analysisTemplate,
50273de4cf63 flys/issue825/2 Fix labeling of Analysisperiods (like A1, A2....)
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3915
diff changeset
197 analysisCount);
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
198 QWD [] qwds = period.getQWDs();
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
199
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
200 if (qwds != null) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
201 for (QWD qwd: qwds) {
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
202 String deltaWS = dwF.format(qwd.getDeltaW());
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
203 String qS = qF.format(qwd.getQ());
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
204 String wS = wF.format(qwd.getW());
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
205 String dateS = dF.format(qwd.getDate());
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
206
5603
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
207 list.add(new String[] {
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
208 kmS,
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
209 dateS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
210 qS,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
211 wS,
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
212 analyisS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
213 deltaWS });
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
214 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
215 }
4238
50273de4cf63 flys/issue825/2 Fix labeling of Analysisperiods (like A1, A2....)
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3915
diff changeset
216 ++analysisCount;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
217 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
218 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
219 }
5603
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
220
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
221 for (ArrayList<String []> list: sorted.values()) {
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
222 for (String [] row: list) {
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
223 writer.writeNext(row);
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
224 }
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
225 }
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
226
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
227 writer.flush();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
228 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
229
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
230 /** Template to create "State" strings like A1,A2... */
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
231 protected String getAnalysisTemplate() {
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
232 return Resources.getMsg(
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
233 context.getMeta(),
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
234 CSV_ANALYSIS, DEFAULT_CSV_ANALYSIS);
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
235 }
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
236
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
237 protected String getReference() {
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
238 return Resources.getMsg(
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
239 context.getMeta(),
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
240 CSV_REFERENCE, DEFAULT_CSV_REFERENCE);
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
241 }
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
242
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
243 protected NumberFormat getKMFormatter() {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
244 return Formatter.getFixDeltaWKM(context);
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
245 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
246
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
247 protected NumberFormat getDeltaWFormatter() {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
248 return Formatter.getFixDeltaWDeltaW(context);
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
249 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
250
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
251 protected NumberFormat getQFormatter() {
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
252 return Formatter.getFixDeltaWQ(context);
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
253 }
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
254
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
255 protected NumberFormat getWFormatter() {
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
256 return Formatter.getFixDeltaWW(context);
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
257 }
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
258
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
259 protected DateFormat getDateFormatter() {
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
260 CallMeta meta = context.getMeta();
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
261 return Formatter.getDateFormatter(
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
262 meta,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
263 Resources.getMsg(
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
264 meta,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
265 CSV_T_FORMAT,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
266 DEFAULT_CSV_T_FORMAT));
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
267 }
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
268
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
269 protected void writeCSVHeader(CSVWriter writer) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
270 log.debug("DeltaWtExporter.writeCSVHeader");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
271
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
272 /* issue825
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
273 km; Ereignis, Abfluss, GEMESSENER Wasserstand; Status (RECHTSBÜNDIG), del W
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
274 */
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
275
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
276 writer.writeNext(new String[] {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
277 msg(CSV_KM_HEADER, DEFAULT_CSV_KM_HEADER),
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
278 msg(CSV_T_HEADER, DEFAULT_CSV_T_HEADER),
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
279 msg(CSV_Q_HEADER, DEFAULT_CSV_Q_HEADER),
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
280 msg(CSV_W_HEADER, DEFAULT_CSV_W_HEADER),
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
281 msg(CSV_TRANGE_HEADER, DEFAULT_CSV_TRANGE_DESC_HEADER),
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
282 msg(CSV_DELTA_W_HEADER, DEFAULT_CSV_DELTA_W_HEADER)
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
283 });
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
284 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
285
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
286 @Override
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
287 protected void writePDF(OutputStream out) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
288 // TODO: Implement me!
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
289 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
290 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
291 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org