Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/exports/DurationCurveExporter.java @ 6606:b4fcc9308d00
Factor out description getting code from csv export and reuse for pdf
Fixes issue1388
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 18 Jul 2013 15:50:59 +0200 |
parents | a0078e5e3b39 |
children | 0a337f0005c2 |
rev | line source |
---|---|
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4858
diff
changeset
|
9 package org.dive4elements.river.exports; |
391
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import java.io.OutputStream; |
418
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
12 import java.text.NumberFormat; |
391
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import java.util.ArrayList; |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import java.util.List; |
2178
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
15 import java.util.Map; |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
16 import java.util.HashMap; |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
17 import java.util.Date; |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
18 import java.text.DateFormat; |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
19 import java.util.Locale; |
391
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 import org.w3c.dom.Document; |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 import org.apache.log4j.Logger; |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 import au.com.bytecode.opencsv.CSVWriter; |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
2178
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
27 import net.sf.jasperreports.engine.JasperExportManager; |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
28 import net.sf.jasperreports.engine.JasperFillManager; |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
29 import net.sf.jasperreports.engine.JasperPrint; |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
30 import net.sf.jasperreports.engine.JRException; |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
31 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4858
diff
changeset
|
32 import org.dive4elements.artifacts.CallContext; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4858
diff
changeset
|
33 import org.dive4elements.artifacts.CallMeta; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4858
diff
changeset
|
34 import org.dive4elements.artifacts.common.utils.Config; |
391
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
36 import org.dive4elements.river.artifacts.D4EArtifact; |
709
3b7e9ddf6bb1
New model to transport data and error reports of calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
701
diff
changeset
|
37 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4858
diff
changeset
|
38 import org.dive4elements.river.artifacts.access.RangeAccess; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4858
diff
changeset
|
39 import org.dive4elements.river.artifacts.model.WQDay; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4858
diff
changeset
|
40 import org.dive4elements.river.artifacts.model.CalculationResult; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4858
diff
changeset
|
41 import org.dive4elements.river.artifacts.model.WKmsJRDataSource; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4858
diff
changeset
|
42 import org.dive4elements.river.artifacts.resources.Resources; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4858
diff
changeset
|
43 |
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:
4858
diff
changeset
|
45 import org.dive4elements.river.utils.Formatter; |
391
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 /** |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 */ |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 public class DurationCurveExporter extends AbstractExporter { |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 |
1160
efe1b8545f5c
Cosmetics
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
709
diff
changeset
|
53 /** The logger used in this exporter. */ |
3778
35a6c9a49a76
Fixed wrong assigned loggers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3083
diff
changeset
|
54 private static Logger logger = Logger.getLogger(DurationCurveExporter.class); |
391
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 |
416
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
57 public static final String CSV_DURATION_HEADER = |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
58 "export.duration.curve.csv.header.duration"; |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
59 |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
60 public static final String CSV_W_HEADER = |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
61 "export.duration.curve.csv.header.w"; |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
62 |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
63 public static final String CSV_Q_HEADER = |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
64 "export.duration.curve.csv.header.q"; |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
65 |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
66 public static final String DEFAULT_CSV_DURATION_HEADER = "D [Tagen]"; |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
67 public static final String DEFAULT_CSV_W_HEADER = "W [NN + m]"; |
664
e006da5679d2
s@m³/s@m\u00b3/s@
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
445
diff
changeset
|
68 public static final String DEFAULT_CSV_Q_HEADER = "Q [m\u00b3/s]"; |
416
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
69 |
2178
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
70 public static final String PDF_HEADER_MODE = "export.duration.pdf.mode"; |
2185
a9a8df1473fd
Added i18n support to PDF report export.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2178
diff
changeset
|
71 public static final String JASPER_FILE = "export.duration.pdf.file"; |
416
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
72 |
1160
efe1b8545f5c
Cosmetics
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
709
diff
changeset
|
73 /** The storage that contains all WQKms objects for the different facets. */ |
391
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 protected List<WQDay> data; |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 public void init(Document request, OutputStream out, CallContext context) { |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 logger.debug("DurationCurveExporter.init"); |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 super.init(request, out, context); |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 this.data = new ArrayList<WQDay>(); |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 } |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 |
701
dad1a2c88f9f
Base WST/CSV exports on facets. TODO: generate the facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
664
diff
changeset
|
86 @Override |
dad1a2c88f9f
Base WST/CSV exports on facets. TODO: generate the facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
664
diff
changeset
|
87 protected void addData(Object d) { |
709
3b7e9ddf6bb1
New model to transport data and error reports of calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
701
diff
changeset
|
88 if (d instanceof CalculationResult) { |
3b7e9ddf6bb1
New model to transport data and error reports of calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
701
diff
changeset
|
89 d = ((CalculationResult)d).getData(); |
3b7e9ddf6bb1
New model to transport data and error reports of calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
701
diff
changeset
|
90 if (d instanceof WQDay) { |
3b7e9ddf6bb1
New model to transport data and error reports of calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
701
diff
changeset
|
91 data.add((WQDay)d); |
3b7e9ddf6bb1
New model to transport data and error reports of calculations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
701
diff
changeset
|
92 } |
701
dad1a2c88f9f
Base WST/CSV exports on facets. TODO: generate the facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
664
diff
changeset
|
93 } |
391
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 } |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 protected void writeCSVData(CSVWriter writer) { |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 logger.info("DurationCurveExporter.writeData"); |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 |
416
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
100 writeCSVHeader(writer); |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
101 |
391
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 for (WQDay wqday: data) { |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 wQDay2CSV(writer, wqday); |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 } |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 } |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 |
416
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
108 protected void writeCSVHeader(CSVWriter writer) { |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
109 logger.info("DurationCurveExporter.writeCSVHeader"); |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
110 |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
111 writer.writeNext(new String[] { |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
112 msg(CSV_W_HEADER, DEFAULT_CSV_W_HEADER), |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
113 msg(CSV_Q_HEADER, DEFAULT_CSV_Q_HEADER), |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
114 msg(CSV_DURATION_HEADER, DEFAULT_CSV_DURATION_HEADER) |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
115 }); |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
116 } |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
117 |
340dc41a7ea3
The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
391
diff
changeset
|
118 |
391
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 protected void wQDay2CSV(CSVWriter writer, WQDay wqday) { |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 logger.debug("DurationCurveExporter.wQDay2CSV"); |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 int size = wqday.size(); |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 |
418
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
124 NumberFormat wf = getWFormatter(); |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
125 NumberFormat qf = getQFormatter(); |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
126 NumberFormat df = getDFormatter(); |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
127 |
1689
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
128 if (wqday.isIncreasing()) { |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
129 for (int i = size-1; i >= 0; i --) { |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
130 writer.writeNext(new String[] { |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
131 wf.format(wqday.getW(i)), |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
132 qf.format(wqday.getQ(i)), |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
133 df.format(wqday.getDay(i)) |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
134 }); |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
135 } |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
136 } |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
137 else { |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
138 for (int i = 0; i < size; i ++) { |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
139 writer.writeNext(new String[] { |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
140 wf.format(wqday.getW(i)), |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
141 qf.format(wqday.getQ(i)), |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
142 df.format(wqday.getDay(i)) |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
143 }); |
e9475d2ef343
Bugfix: #189 Changed the order of a duration curve CSV export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1160
diff
changeset
|
144 } |
391
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 } |
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 } |
418
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
147 |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
148 |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
149 /** |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
150 * Returns the number formatter for W values. |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
151 * |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
152 * @return the number formatter for W values. |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
153 */ |
2284
5d1ba04d2f68
Refactored Formatter access to ease reuse.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2185
diff
changeset
|
154 @Override |
418
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
155 protected NumberFormat getWFormatter() { |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
418
diff
changeset
|
156 return Formatter.getDurationW(context); |
418
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
157 } |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
158 |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
159 |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
160 /** |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
161 * Returns the number formatter for Q values. |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
162 * |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
163 * @return the number formatter for Q values. |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
164 */ |
2284
5d1ba04d2f68
Refactored Formatter access to ease reuse.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2185
diff
changeset
|
165 @Override |
418
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
166 protected NumberFormat getQFormatter() { |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
418
diff
changeset
|
167 return Formatter.getDurationQ(context); |
418
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
168 } |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
169 |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
170 |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
171 /** |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
172 * Returns the number formatter for duration values. |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
173 * |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
174 * @return the number formatter for duration values. |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
175 */ |
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
176 protected NumberFormat getDFormatter() { |
445
a7947972fdeb
Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
418
diff
changeset
|
177 return Formatter.getDurationD(context); |
418
e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
416
diff
changeset
|
178 } |
2176
65dac9cf6ff5
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1689
diff
changeset
|
179 |
65dac9cf6ff5
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1689
diff
changeset
|
180 |
65dac9cf6ff5
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1689
diff
changeset
|
181 @Override |
2178
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
182 protected void writePDF(OutputStream out) { |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
183 WKmsJRDataSource source = createJRData(); |
2185
a9a8df1473fd
Added i18n support to PDF report export.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2178
diff
changeset
|
184 |
a9a8df1473fd
Added i18n support to PDF report export.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2178
diff
changeset
|
185 String jasperFile = Resources.getMsg( |
a9a8df1473fd
Added i18n support to PDF report export.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2178
diff
changeset
|
186 context.getMeta(), |
a9a8df1473fd
Added i18n support to PDF report export.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2178
diff
changeset
|
187 JASPER_FILE, |
a9a8df1473fd
Added i18n support to PDF report export.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2178
diff
changeset
|
188 "/jasper/duration_en.jasper"); |
a9a8df1473fd
Added i18n support to PDF report export.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2178
diff
changeset
|
189 String confPath = Config.getConfigDirectory().toString(); |
a9a8df1473fd
Added i18n support to PDF report export.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2178
diff
changeset
|
190 |
2178
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
191 Map parameters = new HashMap(); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
192 parameters.put("ReportTitle", "Exported Data"); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
193 try { |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
194 JasperPrint print = JasperFillManager.fillReport( |
2185
a9a8df1473fd
Added i18n support to PDF report export.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2178
diff
changeset
|
195 confPath + jasperFile, |
2178
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
196 parameters, |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
197 source); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
198 JasperExportManager.exportReportToPdfStream(print, out); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
199 } |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
200 catch(JRException je) { |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
201 logger.warn("Error generating PDF Report!"); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
202 je.printStackTrace(); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
203 } |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
204 } |
2176
65dac9cf6ff5
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1689
diff
changeset
|
205 |
2178
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
206 protected WKmsJRDataSource createJRData() { |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
207 WKmsJRDataSource source = new WKmsJRDataSource(); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
208 |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
209 addMetaData(source); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
210 for (WQDay wqday: data) { |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
211 addWQDayData(source, wqday); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
212 } |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
213 |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
214 return source; |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
215 } |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
216 |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
217 |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
218 protected void addMetaData(WKmsJRDataSource source) { |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
219 CallMeta meta = context.getMeta(); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
220 |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
221 D4EArtifact flys = (D4EArtifact) master; |
2178
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
222 |
5865
73da40528cf2
River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
223 source.addMetaData ("river", RiverUtils.getRivername(flys)); |
2178
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
224 |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
225 Locale locale = Resources.getLocale(meta); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
226 DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
227 |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
228 source.addMetaData("date", df.format(new Date())); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
229 |
6101
a0078e5e3b39
Removed unused context from RangeAccess and subclasses leading to some dead code removal.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
230 RangeAccess rangeAccess = new RangeAccess(flys); |
4858
56fbdcdb7ff2
ChartGenerator, DurationCurveExporter: Updated to use RangeAccess instead of FLYSUtils.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3778
diff
changeset
|
231 double[] kms = rangeAccess.getKmRange(); |
2178
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
232 source.addMetaData("range", String.valueOf(kms[0])); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
233 |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
234 source.addMetaData("calculation", Resources.getMsg( |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
235 locale, |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
236 PDF_HEADER_MODE, |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
237 "Duration")); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
238 } |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
239 |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
240 protected void addWQDayData(WKmsJRDataSource source, WQDay wqday) { |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
241 int size = wqday.size(); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
242 |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
243 NumberFormat wf = getWFormatter(); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
244 NumberFormat qf = getQFormatter(); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
245 NumberFormat df = getDFormatter(); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
246 |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
247 if (wqday.isIncreasing()) { |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
248 for (int i = size-1; i >= 0; i --) { |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
249 source.addData(new String[] { |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
250 "", |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
251 wf.format(wqday.getW(i)), |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
252 qf.format(wqday.getQ(i)), |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
253 "", "", "", |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
254 df.format(wqday.getDay(i)) |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
255 }); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
256 } |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
257 } |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
258 else { |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
259 for (int i = 0; i < size; i ++) { |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
260 source.addData(new String[] { |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
261 "", |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
262 wf.format(wqday.getW(i)), |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
263 qf.format(wqday.getQ(i)), |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
264 "", "", "", |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
265 df.format(wqday.getDay(i)) |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
266 }); |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
267 } |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
268 } |
1d7fb2cabfc7
Issue 138.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2176
diff
changeset
|
269 } |
391
5d6988836f01
Added an exporter to export the computed data of a duration curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
270 } |
3083
4bd3d8bbb60c
Added missing vim lines.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2290
diff
changeset
|
271 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |