annotate artifacts/src/main/java/org/dive4elements/river/exports/fixings/DeltaWtExporter.java @ 7088:41567bf1e131 generator-refactoring

Removed obsolete imports.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 22 Sep 2013 21:29:35 +0200
parents 0a337f0005c2
children e4606eae8ea5
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.CallMeta;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
14
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
15 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
16
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
17 import org.dive4elements.river.artifacts.model.fixings.AnalysisPeriod;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
18 import org.dive4elements.river.artifacts.model.fixings.FixAnalysisResult;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
19 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
20
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
21 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
22
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
23 import org.dive4elements.river.exports.AbstractExporter;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
24
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
25 import org.dive4elements.river.utils.Formatter;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5603
diff changeset
26 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
27
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
28 import java.io.IOException;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
29 import java.io.OutputStream;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
30
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
31 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
32 import java.text.MessageFormat;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33 import java.text.NumberFormat;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
34
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
35 import java.util.ArrayList;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
36 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
37 import java.util.TreeMap;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
38
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
39 import org.apache.log4j.Logger;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
40
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
41 /** 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
42 public class DeltaWtExporter
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
43 extends AbstractExporter
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
44 {
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
45 /** Private logger. */
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
46 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
47
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
48 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
49 "export.fixings.deltawt.csv.header.km";
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_DELTA_W_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.deltaw";
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
53
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
54 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
55 "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
56
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
57 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
58 "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
59
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
60 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
61 "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
62
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
63 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
64 "export.fixings.deltawt.csv.header.t";
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
65
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
66 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
67 "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
68
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
69 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
70
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
71 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
72
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
73 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
74
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
75 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
76
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
77 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
78
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
79 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
80 "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
81
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 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
83 "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
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_ANALYSIS =
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.analysis";
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 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
89 "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
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_ANALYSIS =
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
92 "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
93
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
94 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
95 "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
96
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
97 protected List<KMIndex<AnalysisPeriod []>> analysisPeriods;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
98
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
99 protected List<KMIndex<QWD[]>> referenceEvents;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
100
7077
0a337f0005c2 Extended init() of OutGenerator to take name of the out to serve.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
101 public DeltaWtExporter() {
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
102 analysisPeriods = new ArrayList<KMIndex<AnalysisPeriod []>>();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
103 referenceEvents = new ArrayList<KMIndex<QWD[]>>();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
104 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
105
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
106 @Override
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
107 protected void addData(Object d) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
108 log.debug("DeltaWtExporter.addData");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
109 if (!(d instanceof CalculationResult)) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
110 log.warn("Invalid data type");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
111 return;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
112 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
113
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
114 Object data = ((CalculationResult)d).getData();
3415
e3c7a3228bc2 FixA: Renamed FixResult to FixAnalysisResult.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3402
diff changeset
115 if (!(data instanceof FixAnalysisResult)) {
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
116 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
117 }
3415
e3c7a3228bc2 FixA: Renamed FixResult to FixAnalysisResult.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3402
diff changeset
118 FixAnalysisResult result = (FixAnalysisResult)data;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
119 analysisPeriods.add(result.getAnalysisPeriods());
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
120 referenceEvents.add(result.getReferenced());
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
121 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
122
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
123 @Override
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
124 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
125
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
126 boolean debug = log.isDebugEnabled();
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 writeCSVHeader(writer);
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
129
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
130 NumberFormat kmF = getKMFormatter();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
131 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
132 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
133 NumberFormat wF = getWFormatter();
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
134
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
135 DateFormat dF = getDateFormatter();
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
136
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
137 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
138 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
139
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
140 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
141
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
142 for (KMIndex<QWD[]> reference: referenceEvents) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
143
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
144 for (KMIndex.Entry<QWD[]> kmEntry: reference) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
145
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
146 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
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 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
149
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 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
151 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
152 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
153 }
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
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 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
156 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
157 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
158 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
159 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
160 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
161
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
162 list.add(new String[] {
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
163 kmS,
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
164 dateS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
165 qS,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
166 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
167 referenceS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
168 deltaWS
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
169 });
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
170 }
3216
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 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
173
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
174 if (debug) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
175 log.debug("AnalysisPeriods: " + analysisPeriods.size());
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
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
178 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
179
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
180 for (KMIndex<AnalysisPeriod []> periods: analysisPeriods) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
181
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
182 for (KMIndex.Entry<AnalysisPeriod []> kmEntry: periods) {
4736
b195fede1c3b Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4238
diff changeset
183
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
184 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
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 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
187
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 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
189 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
190 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
191 }
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
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
193 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
194 int analysisCount = 1;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
195
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
196 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
197 // 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
198 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
199 analysisCount);
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
200 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
201
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
202 if (qwds != null) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
203 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
204 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
205 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
206 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
207 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
208
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
209 list.add(new String[] {
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
210 kmS,
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
211 dateS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
212 qS,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
213 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
214 analyisS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
215 deltaWS });
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
216 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
217 }
4238
50273de4cf63 flys/issue825/2 Fix labeling of Analysisperiods (like A1, A2....)
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3915
diff changeset
218 ++analysisCount;
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 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
221 }
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
222
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 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
224 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
225 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
226 }
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 }
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
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
229 writer.flush();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
230 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
231
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
232 /** 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
233 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
234 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
235 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
236 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
237 }
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
238
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
239 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
240 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
241 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
242 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
243 }
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
244
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
245 protected NumberFormat getKMFormatter() {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
246 return Formatter.getFixDeltaWKM(context);
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
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
249 protected NumberFormat getDeltaWFormatter() {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
250 return Formatter.getFixDeltaWDeltaW(context);
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
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
253 protected NumberFormat getQFormatter() {
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
254 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
255 }
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
256
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
257 protected NumberFormat getWFormatter() {
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
258 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
259 }
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
260
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
261 protected DateFormat getDateFormatter() {
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
262 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
263 return Formatter.getDateFormatter(
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 Resources.getMsg(
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
266 meta,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
267 CSV_T_FORMAT,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
268 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
269 }
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
270
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
271 protected void writeCSVHeader(CSVWriter writer) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
272 log.debug("DeltaWtExporter.writeCSVHeader");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
273
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
274 /* issue825
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
275 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
276 */
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
277
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
278 writer.writeNext(new String[] {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
279 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
280 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
281 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
282 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
283 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
284 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
285 });
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
286 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
287
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
288 @Override
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
289 protected void writePDF(OutputStream out) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
290 // TODO: Implement me!
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
291 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
292 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
293 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org