annotate artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveGenerator.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents e4606eae8ea5
children 1cc7653ca84f 0a5239a1e46e
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: 4736
diff changeset
9 package org.dive4elements.river.exports;
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
4176
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
11 import java.util.Date;
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
12
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
13 import org.apache.log4j.Logger;
6144
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
14
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
15 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
16
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
17 import org.dive4elements.river.artifacts.D4EArtifact;
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
18
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
19 import org.dive4elements.river.artifacts.access.HistoricalDischargeAccess;
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
20
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
21 import org.dive4elements.river.artifacts.model.FacetTypes;
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
22 import org.dive4elements.river.artifacts.model.HistoricalWQTimerange;
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
23 import org.dive4elements.river.artifacts.model.Timerange;
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
24 import org.dive4elements.river.artifacts.model.WQTimerange;
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
25
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
26 import org.dive4elements.river.jfree.StyledTimeSeries;
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
27
6905
1b35b2ddfc28 Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6156
diff changeset
28 import org.dive4elements.river.themes.ThemeDocument;
6144
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
29 import org.dive4elements.river.utils.RiverUtils;
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
30
4176
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
31 import org.jfree.chart.plot.XYPlot;
6144
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
32
4176
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
33 import org.jfree.data.general.SeriesException;
6144
cc7df824d5c4 Removed obsolete imports.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6142
diff changeset
34
6142
a8adf19fbde3 Use FixMilliseconds instead of dates for time periods
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
35 import org.jfree.data.time.FixedMillisecond;
4176
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
36 import org.jfree.data.time.RegularTimePeriod;
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
37 import org.jfree.data.time.TimeSeries;
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
38 import org.jfree.data.time.TimeSeriesCollection;
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
39
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 /**
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 */
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
44 public class HistoricalDischargeCurveGenerator extends TimeseriesChartGenerator
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
45 implements FacetTypes {
2249
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
46
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
47 private static Logger log = Logger
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
48 .getLogger(HistoricalDischargeCurveGenerator.class);
2249
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
49
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
50 public static final String I18N_CHART_TITLE =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
51 "chart.historical.discharge.title";
2249
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
52
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
53 public static final String I18N_CHART_SUBTITLE =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
54 "chart.historical.discharge.subtitle";
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
55
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
56 public static final String I18N_XAXIS_LABEL =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
57 "chart.historical.discharge.xaxis.label";
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
58
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
59 public static final String I18N_YAXIS_LABEL =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
60 "chart.historical.discharge.yaxis.label";
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
61
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
62 public static final String I18N_YAXIS_SECOND_LABEL =
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
63 "chart.historical.discharge.yaxis.second.label";
2249
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
64
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 public static enum YAXIS {
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
66 W(0), Q(1);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
67
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 protected int idx;
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
69
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 private YAXIS(int c) {
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 idx = c;
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 @Override
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 protected YAxisWalker getYAxisWalker() {
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 return new YAxisWalker() {
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
78
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 @Override
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 public int length() {
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 return YAXIS.values().length;
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 @Override
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85 public String getId(int idx) {
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 YAXIS[] yaxes = YAXIS.values();
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87 return yaxes[idx].toString();
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 };
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 @Override
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93 protected String getDefaultChartTitle() {
2249
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
94 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE);
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
95 }
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
96
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
97 @Override
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
98 protected String getDefaultChartSubtitle() {
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
99 D4EArtifact flys = (D4EArtifact) master;
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
100 Timerange evalTime = new HistoricalDischargeAccess(flys)
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
101 .getEvaluationTimerange();
4152
5ff3b2f5fb1c Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3409
diff changeset
102
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
103 Object[] args = new Object[] { RiverUtils.getReferenceGaugeName(flys),
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
104 evalTime.getStart(), evalTime.getEnd() };
2249
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
105
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
106 return msg(I18N_CHART_SUBTITLE, "", args);
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109 @Override
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110 protected String getDefaultXAxisLabel() {
2249
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
111 return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL);
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114 @Override
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115 protected String getDefaultYAxisLabel(int pos) {
2249
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
116 if (pos == 0) {
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
117 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL);
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
118 }
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
119 else if (pos == 1) {
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
120 return msg(I18N_YAXIS_SECOND_LABEL, I18N_YAXIS_SECOND_LABEL);
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
121 }
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
122 else {
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
123 return "NO TITLE FOR Y AXIS: " + pos;
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
124 }
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
125 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
126
4176
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
127 @Override
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
128 protected void adjustPlot(XYPlot plot) {
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
129 super.adjustPlot(plot);
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
130 plot.setRangeZeroBaselineVisible(true);
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
131 }
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
132
3409
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2633
diff changeset
133 @Override
6905
1b35b2ddfc28 Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6156
diff changeset
134 public void doOut(ArtifactAndFacet artifactFacet, ThemeDocument theme,
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
135 boolean visible) {
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
136 String name = artifactFacet.getFacetName();
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
137 log.debug("HistoricalDischargeCurveGenerator.doOut: " + name);
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
138 log.debug("Theme description is: "
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
139 + artifactFacet.getFacetDescription());
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
140
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
141 if (name.equals(HISTORICAL_DISCHARGE_Q)) {
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
142 doHistoricalDischargeOutQ(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
143 (D4EArtifact) artifactFacet.getArtifact(),
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
144 artifactFacet.getData(context),
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
145 artifactFacet.getFacetDescription(), theme, visible);
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
146 }
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
147 else if (name.equals(HISTORICAL_DISCHARGE_W)) {
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
148 doHistoricalDischargeOutW(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
149 (D4EArtifact) artifactFacet.getArtifact(),
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: 2249
diff changeset
150 artifactFacet.getData(context),
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
151 artifactFacet.getFacetDescription(), theme, visible);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
152 }
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
153 else if (name.equals(HISTORICAL_DISCHARGE_Q_DIFF)) {
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
154 doHistoricalDischargeDifferenceOutQ(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
155 (D4EArtifact) artifactFacet.getArtifact(),
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
156 artifactFacet.getData(context),
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
157 artifactFacet.getFacetDescription(), theme, visible);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
158 }
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
159 else if (name.equals(HISTORICAL_DISCHARGE_W_DIFF)) {
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
160 doHistoricalDischargeDifferenceOutW(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
161 (D4EArtifact) artifactFacet.getArtifact(),
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
162 artifactFacet.getData(context),
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
163 artifactFacet.getFacetDescription(), theme, visible);
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: 2249
diff changeset
164 }
2633
894186b4c1d0 Issue 494.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2592
diff changeset
165 else if (FacetTypes.IS.MANUALPOINTS(name)) {
7902
a7b218447e12 Potential fix for flys/issue1717: Draw manuel points on W or Q axis depending on the calculation.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6905
diff changeset
166 HistoricalDischargeAccess.EvaluationMode mode =
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
167 new HistoricalDischargeAccess(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
168 (D4EArtifact)getMaster()).getEvaluationMode();
7902
a7b218447e12 Potential fix for flys/issue1717: Draw manuel points on W or Q axis depending on the calculation.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6905
diff changeset
169 int axis = mode == HistoricalDischargeAccess.EvaluationMode.W
a7b218447e12 Potential fix for flys/issue1717: Draw manuel points on W or Q axis depending on the calculation.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6905
diff changeset
170 ? YAXIS.Q.idx
a7b218447e12 Potential fix for flys/issue1717: Draw manuel points on W or Q axis depending on the calculation.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6905
diff changeset
171 : YAXIS.W.idx;
a7b218447e12 Potential fix for flys/issue1717: Draw manuel points on W or Q axis depending on the calculation.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6905
diff changeset
172
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
173 doPoints(artifactFacet.getData(context), artifactFacet, theme,
7902
a7b218447e12 Potential fix for flys/issue1717: Draw manuel points on W or Q axis depending on the calculation.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6905
diff changeset
174 visible, axis);
2633
894186b4c1d0 Issue 494.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2592
diff changeset
175 }
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
176 else {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
177 log.warn("doOut(): unknown facet name: " + name);
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
178 return;
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
179 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
180 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
181
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
182 protected void doHistoricalDischargeOutQ(D4EArtifact artifact,
6905
1b35b2ddfc28 Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6156
diff changeset
183 Object data, String desc, ThemeDocument theme, boolean visible) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
184 log.debug("doHistoricalDischargeOut(): description = " + desc);
2240
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
185
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
186 WQTimerange wqt = (WQTimerange) data;
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
187
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
188 TimeSeriesCollection tsc = newTimeSeriesCollection(wqt.getTimeranges(),
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
189 wqt.getQs(), theme, desc);
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: 2249
diff changeset
190
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
191 addAxisDataset(tsc, YAXIS.Q.idx, visible);
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: 2249
diff changeset
192 }
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2249
diff changeset
193
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
194 protected void doHistoricalDischargeOutW(D4EArtifact artifact,
6905
1b35b2ddfc28 Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6156
diff changeset
195 Object data, String desc, ThemeDocument theme, boolean visible) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
196 log.debug("doHistoricalDischargeOut(): description = " + desc);
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: 2249
diff changeset
197
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
198 WQTimerange wqt = (WQTimerange) data;
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
199
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
200 TimeSeriesCollection tsc = newTimeSeriesCollection(wqt.getTimeranges(),
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
201 wqt.getWs(), theme, desc);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
202
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
203 addAxisDataset(tsc, YAXIS.W.idx, visible);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
204 }
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
205
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
206 protected void doHistoricalDischargeDifferenceOutQ(D4EArtifact artifact,
6905
1b35b2ddfc28 Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6156
diff changeset
207 Object data, String desc, ThemeDocument theme, boolean visible) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
208 log.debug("doHistoricalDischargeDifferenceOut: desc = " + desc);
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: 2249
diff changeset
209
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2249
diff changeset
210 HistoricalWQTimerange wqt = (HistoricalWQTimerange) data;
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2249
diff changeset
211
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
212 TimeSeriesCollection tsc = newTimeSeriesCollection(wqt.getTimeranges(),
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
213 wqt.getDiffs(), theme, desc);
2240
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
214
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
215 addAxisDataset(tsc, YAXIS.Q.idx, visible);
2240
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
216 }
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
217
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
218 protected void doHistoricalDischargeDifferenceOutW(D4EArtifact artifact,
6905
1b35b2ddfc28 Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6156
diff changeset
219 Object data, String desc, ThemeDocument theme, boolean visible) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
220 log.debug("doHistoricalDischargeDifferenceOut: desc = " + desc);
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
221
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
222 HistoricalWQTimerange wqt = (HistoricalWQTimerange) data;
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
223
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
224 TimeSeriesCollection tsc = newTimeSeriesCollection(wqt.getTimeranges(),
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
225 wqt.getDiffs(), theme, desc);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
226
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
227 addAxisDataset(tsc, YAXIS.W.idx, visible);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
228 }
2240
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
229
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
230 /**
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
231 * Creates a new TimeSeriesCollection with a single TimeSeries. The
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
232 * TimeSeries will consist of two RegularTimePeriods for each W/Q value
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
233 * provided by <i>wqt</i>. This has the effect, that the line in the chart
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
234 * looks like a "step chart".
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
235 */
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
236 protected TimeSeriesCollection newTimeSeriesCollection(
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
237 Timerange[] timeranges,
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
238 double[] values,
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
239 ThemeDocument theme,
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
240 String desc
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
241 ) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
242 log.debug("Create new TimeSeriesCollection for: " + desc);
2240
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
243
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
244 TimeSeriesCollection tsc = new TimeSeriesCollection();
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
245 TimeSeries series = new StyledTimeSeries(desc, theme);
2240
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
246
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: 2249
diff changeset
247 for (int i = 0, n = timeranges.length; i < n; i++) {
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2249
diff changeset
248 RegularTimePeriod[] rtp = newRegularTimePeriod(timeranges[i]);
2240
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
249
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
250 try {
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: 2249
diff changeset
251 if (Double.isNaN(values[i])) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
252 log.warn("Skip TimePeriod because value is NaN.");
2243
d70a04cad84d Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2240
diff changeset
253 continue;
d70a04cad84d Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2240
diff changeset
254 }
d70a04cad84d Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2240
diff changeset
255
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: 2249
diff changeset
256 series.add(rtp[0], values[i]);
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2249
diff changeset
257 series.add(rtp[1], values[i]);
2243
d70a04cad84d Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2240
diff changeset
258
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
259 if (log.isDebugEnabled()) {
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
260 log.debug("added Item to TimeSeries:");
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
261 log.debug(" TimePeriod: " + rtp[0] + " - " + rtp[1]);
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
262 log.debug(" Value: " + values[i]);
2243
d70a04cad84d Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2240
diff changeset
263 }
2240
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
264 }
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
265 catch (SeriesException se) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7902
diff changeset
266 log.warn("Error while adding TimePeriod: " + se);
2240
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
267 }
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
268 }
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
269
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
270 tsc.addSeries(series);
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
271
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
272 return tsc;
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
273 }
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
274
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
275 /**
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
276 * Create array that consists of two
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
277 * <i>FixedMillisecond</i> periods [start, end].
4736
b195fede1c3b Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4232
diff changeset
278 *
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
279 * @param timerange
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
280 * Supports start and end time.
4736
b195fede1c3b Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4232
diff changeset
281 *
6156
eee77cdd72fc Fix comment for newRegularTimePeriod
Andre Heinecke <aheinecke@intevation.de>
parents: 6144
diff changeset
282 * @return an array with two <i>FixedMillisecond</i> periods [start, end].
2240
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
283 */
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
284 protected RegularTimePeriod[] newRegularTimePeriod(Timerange timerange) {
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
285 Date start = new Date(timerange.getStart());
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
286 Date end = new Date(timerange.getEnd() - 1000 * 60 * 60 * 24);
2240
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
287
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
288 return new RegularTimePeriod[] {
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
289 new FixedMillisecond(start),
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
290 new FixedMillisecond(end) };
2215
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
291 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
292 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
293 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org