annotate artifacts/src/main/java/org/dive4elements/river/exports/fixings/DeltaWtExporter.java @ 5863:4897a58c8746

River artifacts: Added new copyright headers.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 28 Apr 2013 14:40:59 +0200
parents 5aa05a7a34b7
children af13ceeba52a
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 *
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
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
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
6 * documentation coming with Dive4Elements River for details.
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
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
104 @Override
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
105 public void init(Document request, OutputStream out, CallContext context) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
106 log.debug("DeltaWtExporter.init");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
107 super.init(request, out, context);
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
108 analysisPeriods = new ArrayList<KMIndex<AnalysisPeriod []>>();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
109 referenceEvents = new ArrayList<KMIndex<QWD[]>>();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
110 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
111
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
112 @Override
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
113 protected void addData(Object d) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
114 log.debug("DeltaWtExporter.addData");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
115 if (!(d instanceof CalculationResult)) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
116 log.warn("Invalid data type");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
117 return;
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
118 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
119
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
120 Object data = ((CalculationResult)d).getData();
3415
e3c7a3228bc2 FixA: Renamed FixResult to FixAnalysisResult.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3402
diff changeset
121 if (!(data instanceof FixAnalysisResult)) {
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
122 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
123 }
3415
e3c7a3228bc2 FixA: Renamed FixResult to FixAnalysisResult.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3402
diff changeset
124 FixAnalysisResult result = (FixAnalysisResult)data;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
125 analysisPeriods.add(result.getAnalysisPeriods());
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
126 referenceEvents.add(result.getReferenced());
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
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
129 @Override
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
130 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
131
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
132 boolean debug = log.isDebugEnabled();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
133
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
134 writeCSVHeader(writer);
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
135
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
136 NumberFormat kmF = getKMFormatter();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
137 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
138 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
139 NumberFormat wF = getWFormatter();
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
140
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
141 DateFormat dF = getDateFormatter();
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
142
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
143 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
144 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
145
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
146 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
147
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
148 for (KMIndex<QWD[]> reference: referenceEvents) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
149
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
150 for (KMIndex.Entry<QWD[]> kmEntry: reference) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
151
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
152 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
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 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
155
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 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
157 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
158 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
159 }
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
160
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
161 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
162 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
163 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
164 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
165 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
166 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
167
5603
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
168 list.add(new String[] {
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
169 kmS,
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
170 dateS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
171 qS,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
172 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
173 referenceS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
174 deltaWS
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
175 });
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
176 }
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
177 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
178 }
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 if (debug) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
181 log.debug("AnalysisPeriods: " + analysisPeriods.size());
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
182 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
183
3398
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
184 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
185
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
186 for (KMIndex<AnalysisPeriod []> periods: analysisPeriods) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
187
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
188 for (KMIndex.Entry<AnalysisPeriod []> kmEntry: periods) {
4736
b195fede1c3b Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4238
diff changeset
189
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
190 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
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 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
193
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 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
195 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
196 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
197 }
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
198
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
199 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
200 int analysisCount = 1;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
201
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
202 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
203 // 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
204 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
205 analysisCount);
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
206 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
207
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
208 if (qwds != null) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
209 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
210 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
211 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
212 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
213 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
214
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
215 list.add(new String[] {
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
216 kmS,
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
217 dateS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
218 qS,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
219 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
220 analyisS,
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
221 deltaWS });
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 }
4238
50273de4cf63 flys/issue825/2 Fix labeling of Analysisperiods (like A1, A2....)
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3915
diff changeset
224 ++analysisCount;
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
225 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
226 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
227 }
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
228
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 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
230 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
231 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
232 }
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
233 }
47e5bc64d3de FixA: tab output ist now grouped by km and periods. Fixes flys/issue1163
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
234
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
235 writer.flush();
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
236 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
237
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
238 /** 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
239 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
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_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
243 }
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
244
7f9fe694f8d1 FixA: Added time range column to Delta W(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
245 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
246 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
247 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
248 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
249 }
3216
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 protected NumberFormat getKMFormatter() {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
252 return Formatter.getFixDeltaWKM(context);
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
253 }
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 protected NumberFormat getDeltaWFormatter() {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
256 return Formatter.getFixDeltaWDeltaW(context);
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
257 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
258
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
259 protected NumberFormat getQFormatter() {
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
260 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
261 }
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3217
diff changeset
262
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
263 protected NumberFormat getWFormatter() {
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
264 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
265 }
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
266
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
267 protected DateFormat getDateFormatter() {
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
268 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
269 return Formatter.getDateFormatter(
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
270 meta,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
271 Resources.getMsg(
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
272 meta,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
273 CSV_T_FORMAT,
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
274 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
275 }
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3398
diff changeset
276
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
277 protected void writeCSVHeader(CSVWriter writer) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
278 log.debug("DeltaWtExporter.writeCSVHeader");
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
279
3644
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
280 /* issue825
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
281 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
282 */
fa633f6a5fd9 smaller part of issue825 fixed (column ordering of dwt-export).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3415
diff changeset
283
3216
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
284 writer.writeNext(new String[] {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
285 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
286 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
287 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
288 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
289 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
290 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
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
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
294 @Override
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
295 protected void writePDF(OutputStream out) {
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
296 // TODO: Implement me!
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
297 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
298 }
a46910e61dfb FixA: Moved DeltaWtExporter to fixings exporter package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
299 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org