annotate artifacts/src/main/java/org/dive4elements/river/exports/fixings/DeltaWtExporter.java @ 7077:0a337f0005c2 generator-refactoring

Extended init() of OutGenerator to take name of the out to serve.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 20 Sep 2013 16:34:09 +0200
parents af13ceeba52a
children 41567bf1e131
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
9 package org.dive4elements.river.exports.fixings;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
11 import au.com.bytecode.opencsv.CSVWriter;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
12
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
13 import org.dive4elements.artifacts.CallContext;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
14 import org.dive4elements.artifacts.CallMeta;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
15
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
16 import org.dive4elements.river.artifacts.model.CalculationResult;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
17
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
18 import org.dive4elements.river.artifacts.model.fixings.AnalysisPeriod;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
19 import org.dive4elements.river.artifacts.model.fixings.FixAnalysisResult;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
20 import org.dive4elements.river.artifacts.model.fixings.QWD;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
21
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
22 import org.dive4elements.river.artifacts.resources.Resources;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
23
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
24 import org.dive4elements.river.exports.AbstractExporter;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
25
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
26 import org.dive4elements.river.utils.Formatter;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
27 import org.dive4elements.river.utils.KMIndex;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
28
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
29 import java.io.IOException;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
30 import java.io.OutputStream;
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 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
33 import java.text.MessageFormat;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
34 import java.text.NumberFormat;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
35
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
36 import java.util.ArrayList;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
37 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
38 import java.util.TreeMap;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
39
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
40 import org.apache.log4j.Logger;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
41
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
42 import org.w3c.dom.Document;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
43
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
44 /** 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
45 public class DeltaWtExporter
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
46 extends AbstractExporter
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
47 {
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
48 /** Private logger. */
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
49 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
50
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
51 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
52 "export.fixings.deltawt.csv.header.km";
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
53
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
54 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
55 "export.fixings.deltawt.csv.header.deltaw";
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
56
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
57 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
58 "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
59
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
60 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
61 "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
62
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
63 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
64 "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
65
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
66 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
67 "export.fixings.deltawt.csv.header.t";
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
68
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
69 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
70 "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
71
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_KM_HEADER = "km";
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
73
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
74 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
75
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
76 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
77
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
78 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
79
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
80 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
81
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
82 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
83 "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
84
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
85 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
86 "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
87
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
88 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
89 "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
90
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
91 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
92 "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
93
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
94 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
95 "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
96
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
97 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
98 "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
99
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
100 protected List<KMIndex<AnalysisPeriod []>> analysisPeriods;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
101
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
102 protected List<KMIndex<QWD[]>> referenceEvents;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
103
7077
0a337f0005c2 Extended init() of OutGenerator to take name of the out to serve.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
104 public DeltaWtExporter() {
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
105 analysisPeriods = new ArrayList<KMIndex<AnalysisPeriod []>>();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
106 referenceEvents = new ArrayList<KMIndex<QWD[]>>();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
107 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
108
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
109 @Override
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
110 protected void addData(Object d) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
111 log.debug("DeltaWtExporter.addData");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
112 if (!(d instanceof CalculationResult)) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
113 log.warn("Invalid data type");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
114 return;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
115 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
116
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
117 Object data = ((CalculationResult)d).getData();
3415
e3c7a3228bc2 FixA: Renamed FixResult to FixAnalysisResult.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3402
diff changeset
118 if (!(data instanceof FixAnalysisResult)) {
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
119 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
120 }
3415
e3c7a3228bc2 FixA: Renamed FixResult to FixAnalysisResult.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3402
diff changeset
121 FixAnalysisResult result = (FixAnalysisResult)data;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
122 analysisPeriods.add(result.getAnalysisPeriods());
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
123 referenceEvents.add(result.getReferenced());
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
124 }
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 @Override
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
127 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
128
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
129 boolean debug = log.isDebugEnabled();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
130
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
131 writeCSVHeader(writer);
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
132
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
133 NumberFormat kmF = getKMFormatter();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
134 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
135 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
136 NumberFormat wF = getWFormatter();
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
137
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
138 DateFormat dF = getDateFormatter();
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
139
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
140 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
141 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
142
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
143 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
144
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
145 for (KMIndex<QWD[]> reference: referenceEvents) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
146
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
147 for (KMIndex.Entry<QWD[]> kmEntry: reference) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
148
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
149 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
150
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 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
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 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
154 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
155 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
156 }
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
157
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
158 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
159 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
160 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
161 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
162 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
163 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
164
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
165 list.add(new String[] {
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
166 kmS,
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
167 dateS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
168 qS,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
169 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
170 referenceS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
171 deltaWS
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
172 });
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
173 }
3216
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 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
176
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
177 if (debug) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
178 log.debug("AnalysisPeriods: " + analysisPeriods.size());
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
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
181 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
182
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
183 for (KMIndex<AnalysisPeriod []> periods: analysisPeriods) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
184
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
185 for (KMIndex.Entry<AnalysisPeriod []> kmEntry: periods) {
4736
b195fede1c3b Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4238
diff changeset
186
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
187 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
188
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 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
190
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
191 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
192 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
193 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
194 }
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
195
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
196 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
197 int analysisCount = 1;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
198
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
199 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
200 // 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
201 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
202 analysisCount);
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
203 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
204
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
205 if (qwds != null) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
206 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
207 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
208 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
209 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
210 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
211
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
212 list.add(new String[] {
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
213 kmS,
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
214 dateS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
215 qS,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
216 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
217 analyisS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
218 deltaWS });
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
219 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
220 }
4238
50273de4cf63 flys/issue825/2 Fix labeling of Analysisperiods (like A1, A2....)
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3915
diff changeset
221 ++analysisCount;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
222 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
223 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
224 }
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
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 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
227 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
228 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
229 }
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
230 }
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
231
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
232 writer.flush();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
233 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
234
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
235 /** 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
236 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
237 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
238 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
239 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
240 }
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
241
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
242 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
243 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
244 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
245 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
246 }
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
247
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
248 protected NumberFormat getKMFormatter() {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
249 return Formatter.getFixDeltaWKM(context);
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
250 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
251
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
252 protected NumberFormat getDeltaWFormatter() {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
253 return Formatter.getFixDeltaWDeltaW(context);
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
254 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
255
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
256 protected NumberFormat getQFormatter() {
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
257 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
258 }
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
259
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
260 protected NumberFormat getWFormatter() {
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
261 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
262 }
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
263
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
264 protected DateFormat getDateFormatter() {
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
265 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
266 return Formatter.getDateFormatter(
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
267 meta,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
268 Resources.getMsg(
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
269 meta,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
270 CSV_T_FORMAT,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
271 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
272 }
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
273
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
274 protected void writeCSVHeader(CSVWriter writer) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
275 log.debug("DeltaWtExporter.writeCSVHeader");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
276
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
277 /* issue825
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
278 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
279 */
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
280
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
281 writer.writeNext(new String[] {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
282 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
283 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
284 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
285 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
286 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
287 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
288 });
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 @Override
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
292 protected void writePDF(OutputStream out) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
293 // TODO: Implement me!
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
294 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
295 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
296 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org