Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveExporter.java @ 5866:9a6741ccf6d4
FLYS artifacts: Renamed FLYSContext(Factory) to RiverContext(Factory).
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Sun, 28 Apr 2013 15:14:30 +0200 |
parents | 73da40528cf2 |
children | 59ff03ff48f1 |
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:
5421
diff
changeset
|
9 package org.dive4elements.river.exports; |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import java.io.OutputStream; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import java.text.NumberFormat; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import java.text.DateFormat; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import java.util.ArrayList; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import java.util.Date; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import java.util.List; |
2286
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
17 import java.util.Map; |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
18 import java.util.HashMap; |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
19 import java.util.Locale; |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 import org.w3c.dom.Document; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 import org.apache.log4j.Logger; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 import au.com.bytecode.opencsv.CSVWriter; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
2286
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
27 import net.sf.jasperreports.engine.JasperExportManager; |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
28 import net.sf.jasperreports.engine.JasperFillManager; |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
29 import net.sf.jasperreports.engine.JasperPrint; |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
30 import net.sf.jasperreports.engine.JRException; |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
31 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5421
diff
changeset
|
32 import org.dive4elements.artifacts.common.utils.Config; |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5421
diff
changeset
|
34 import org.dive4elements.artifacts.CallContext; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5421
diff
changeset
|
35 import org.dive4elements.artifacts.CallMeta; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5421
diff
changeset
|
36 |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5421
diff
changeset
|
37 import org.dive4elements.river.artifacts.FLYSArtifact; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5421
diff
changeset
|
38 import org.dive4elements.river.artifacts.model.CalculationResult; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5421
diff
changeset
|
39 import org.dive4elements.river.artifacts.model.HistoricalDischargeData; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5421
diff
changeset
|
40 import org.dive4elements.river.artifacts.model.Timerange; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5421
diff
changeset
|
41 import org.dive4elements.river.artifacts.model.WQTimerange; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5421
diff
changeset
|
42 import org.dive4elements.river.artifacts.model.WQTJRDataSource; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5421
diff
changeset
|
43 import org.dive4elements.river.artifacts.resources.Resources; |
5865
73da40528cf2
River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
44 import org.dive4elements.river.utils.RiverUtils; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5421
diff
changeset
|
45 import org.dive4elements.river.utils.Formatter; |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 /** |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 */ |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 public class HistoricalDischargeCurveExporter extends AbstractExporter { |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 private static final Logger logger = |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 Logger.getLogger(HistoricalDischargeCurveExporter.class); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 public static final String CSV_TIMERANGE_HEADER = |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 "export.historical.discharge.csv.header.timerange"; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 public static final String CSV_WATERLEVEL_HEADER = |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 "export.historical.discharge.csv.header.waterlevel"; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 public static final String CSV_DISCHARGE_HEADER = |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 "export.historical.discharge.csv.header.discharge"; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 public static final String CSV_DIFF_HEADER = |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 "export.historical.discharge.csv.header.diff"; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 public static final String CSV_GAUGENAME_HEADER = |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 "export.historical.discharge.csv.header.gaugename"; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 |
2286
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
72 public static final String PDF_HEADER_MODE = |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
73 "export.historical.discharge.pdf.mode"; |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
74 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
75 public static final String JASPER_FILE = |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
76 "export.historical.discharge.pdf.file"; |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 protected List<WQTimerange[]> data; |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 public void init(Document request, OutputStream out, CallContext cc) { |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 super.init(request, out, cc); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 data = new ArrayList<WQTimerange[]>(); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 @Override |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 protected void addData(Object d) { |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 logger.debug("Add data of class: " + d.getClass()); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 if (d instanceof CalculationResult) { |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 d = ((CalculationResult) d).getData(); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 logger.debug("Internal data of CalculationResult: " + d.getClass()); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 |
4241
49cb65d5932d
Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4197
diff
changeset
|
97 if (d instanceof HistoricalDischargeData) { |
49cb65d5932d
Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4197
diff
changeset
|
98 d = (WQTimerange[]) ((HistoricalDischargeData) d).getWQTimeranges(); |
49cb65d5932d
Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4197
diff
changeset
|
99 |
49cb65d5932d
Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4197
diff
changeset
|
100 if (d instanceof WQTimerange[]) { |
49cb65d5932d
Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4197
diff
changeset
|
101 logger.debug("Add new data of type WQTimerange"); |
49cb65d5932d
Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4197
diff
changeset
|
102 data.add((WQTimerange[]) d); |
49cb65d5932d
Improved the historical discharge calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4197
diff
changeset
|
103 } |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 @Override |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 protected void writeCSVData(CSVWriter writer) { |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 logger.info("HistoricalDischargeCurveExporter.writeCSVData"); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 logger.debug("CSV gets " + data.size() + " WQTimerange[] objects."); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 writeCSVHeader(writer); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 for (WQTimerange[] arr: data) { |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 for (WQTimerange wqt: arr) { |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 wqt2CSV(writer, wqt); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 @Override |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 protected void writePDF(OutputStream out) { |
2286
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
126 WQTJRDataSource source = createJRData(); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
127 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
128 String jasperFile = Resources.getMsg( |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
129 context.getMeta(), |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
130 JASPER_FILE, |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
131 "/jasper/historical-discharge_en.jasper"); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
132 String confPath = Config.getConfigDirectory().toString(); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
133 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
134 Map parameters = new HashMap(); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
135 parameters.put("ReportTitle", "Exported Data"); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
136 try { |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
137 JasperPrint print = JasperFillManager.fillReport( |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
138 confPath + jasperFile, |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
139 parameters, |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
140 source); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
141 JasperExportManager.exportReportToPdfStream(print, out); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
142 } |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
143 catch(JRException je) { |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
144 logger.warn("Error generating PDF Report!"); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
145 je.printStackTrace(); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
146 } |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 protected void writeCSVHeader(CSVWriter writer) { |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 writer.writeNext(new String[] { |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 msg(CSV_TIMERANGE_HEADER, CSV_TIMERANGE_HEADER), |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
153 msg(CSV_WATERLEVEL_HEADER, CSV_WATERLEVEL_HEADER), |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 msg(CSV_DISCHARGE_HEADER, CSV_DISCHARGE_HEADER), |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 msg(CSV_DIFF_HEADER, CSV_DIFF_HEADER), |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 msg(CSV_GAUGENAME_HEADER, CSV_GAUGENAME_HEADER) |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 }); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
158 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
159 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
161 protected void wqt2CSV(CSVWriter writer, WQTimerange wqt) { |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 logger.debug("Add next WQTimerange to CSV"); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
163 |
2588
7dd45896e941
Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2331
diff
changeset
|
164 DateFormat df = Formatter.getMediumDateFormat(context); |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
165 NumberFormat wf = Formatter.getHistoricalDischargeW(context); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
166 NumberFormat qf = Formatter.getHistoricalDischargeQ(context); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
167 |
2311
b8df8d1476ba
Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2286
diff
changeset
|
168 double[] wq = new double[3]; |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
169 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 String gaugeName = getReferenceGaugename(); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 |
4171
1d8faeedda0c
Sort calculation results of a historical discharge calculation based on their start date.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
172 List<WQTimerange.TimerangeItem> sorted = wqt.sort(); |
1d8faeedda0c
Sort calculation results of a historical discharge calculation based on their start date.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
173 |
1d8faeedda0c
Sort calculation results of a historical discharge calculation based on their start date.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
174 for (int i = 0, n = sorted.size(); i < n; i++) { |
1d8faeedda0c
Sort calculation results of a historical discharge calculation based on their start date.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
175 WQTimerange.TimerangeItem item = sorted.get(i); |
1d8faeedda0c
Sort calculation results of a historical discharge calculation based on their start date.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
176 |
1d8faeedda0c
Sort calculation results of a historical discharge calculation based on their start date.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
177 Timerange tr = item.timerange; |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
178 Date start = new Date(tr.getStart()); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
179 Date end = new Date(tr.getEnd()); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
180 |
4171
1d8faeedda0c
Sort calculation results of a historical discharge calculation based on their start date.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2588
diff
changeset
|
181 item.get(wq); |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
182 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
183 writer.writeNext(new String[] { |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
184 df.format(start) + " - " + df.format(end), |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
185 wf.format(wq[0]), |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
186 qf.format(wq[1]), |
2311
b8df8d1476ba
Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2286
diff
changeset
|
187 qf.format(wq[2]), |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
188 gaugeName |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
189 }); |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
190 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
191 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
192 |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 |
2286
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
194 protected WQTJRDataSource createJRData() { |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
195 WQTJRDataSource source = new WQTJRDataSource(); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
196 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
197 addMetaData(source); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
198 for (WQTimerange[] arr: data) { |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
199 for (WQTimerange wqt: arr) { |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
200 addWQTData(source, wqt); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
201 } |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
202 } |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
203 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
204 return source; |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
205 } |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
206 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
207 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
208 protected void addMetaData(WQTJRDataSource source) { |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
209 CallMeta meta = context.getMeta(); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
210 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
211 FLYSArtifact flys = (FLYSArtifact) master; |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
212 |
5865
73da40528cf2
River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
213 source.addMetaData ("river", RiverUtils.getRivername(flys)); |
2286
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
214 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
215 Locale locale = Resources.getLocale(meta); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
216 DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
217 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
218 source.addMetaData("date", df.format(new Date())); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
219 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
220 source.addMetaData("calculation", Resources.getMsg( |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
221 locale, |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
222 PDF_HEADER_MODE, |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
223 "Historical Discharge")); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
224 } |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
225 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
226 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
227 protected void addWQTData(WQTJRDataSource source, WQTimerange wqt) { |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
228 DateFormat df = Formatter.getShortDateFormat(context); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
229 NumberFormat wf = Formatter.getHistoricalDischargeW(context); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
230 NumberFormat qf = Formatter.getHistoricalDischargeQ(context); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
231 |
2331
2c96222dd773
Picked rev4034 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2311
diff
changeset
|
232 double[] wq = new double[3]; |
2286
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
233 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
234 String gaugeName = getReferenceGaugename(); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
235 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
236 for (int i = 0, n = wqt.size(); i < n; i++) { |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
237 Timerange tr = wqt.getTimerange(i); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
238 Date start = new Date(tr.getStart()); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
239 Date end = new Date(tr.getEnd()); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
240 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
241 wqt.get(i, wq); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
242 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
243 source.addData(new String[] { |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
244 df.format(start) + " - " + df.format(end), |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
245 wf.format(wq[0]), |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
246 qf.format(wq[1]), |
2331
2c96222dd773
Picked rev4034 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2311
diff
changeset
|
247 qf.format(wq[2]), |
2286
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
248 gaugeName |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
249 }); |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
250 } |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
251 } |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
252 |
89ca1e8572e4
Added PDF export for historical discharge curve calculations.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2258
diff
changeset
|
253 |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
254 public String getReferenceGaugename() { |
5865
73da40528cf2
River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
255 return RiverUtils.getReferenceGaugeName((FLYSArtifact) master); |
2258
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
256 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
257 } |
ea173e4c07c7
Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
258 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |