Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveGenerator.java @ 9123:1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
author | gernotbelger |
---|---|
date | Tue, 05 Jun 2018 19:21:16 +0200 |
parents | 5e38e2924c07 |
children | 740d65e4aa14 |
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; |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
16 import org.dive4elements.artifacts.CallContext; |
6144
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 | 50 public static final String I18N_CHART_TITLE = |
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 | 53 public static final String I18N_CHART_SUBTITLE = |
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 | 56 public static final String I18N_XAXIS_LABEL = |
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 | 59 public static final String I18N_YAXIS_LABEL = |
60 "chart.historical.discharge.yaxis.label"; | |
61 | |
62 public static final String I18N_YAXIS_SECOND_LABEL = | |
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 |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
93 protected String getDefaultChartTitle(final CallContext context) { |
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 |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
98 protected String getDefaultChartSubtitle(final CallContext context) { |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
99 D4EArtifact flys = getArtifact(); |
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 |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
110 protected String getDefaultXAxisLabel(final CallContext context) { |
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 |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
141 final CallContext context = getContext(); |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
142 |
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
|
143 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
|
144 doHistoricalDischargeOutQ( |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
145 (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
|
146 artifactFacet.getData(context), |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
147 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
|
148 } |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
149 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
|
150 doHistoricalDischargeOutW( |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
151 (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
|
152 artifactFacet.getData(context), |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
153 artifactFacet.getFacetDescription(), theme, visible); |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
154 } |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
155 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
|
156 doHistoricalDischargeDifferenceOutQ( |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
157 (D4EArtifact) artifactFacet.getArtifact(), |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
158 artifactFacet.getData(context), |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
159 artifactFacet.getFacetDescription(), theme, visible); |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
160 } |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
161 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
|
162 doHistoricalDischargeDifferenceOutW( |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
163 (D4EArtifact) artifactFacet.getArtifact(), |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
164 artifactFacet.getData(context), |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
165 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
|
166 } |
2633
894186b4c1d0
Issue 494.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2592
diff
changeset
|
167 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
|
168 HistoricalDischargeAccess.EvaluationMode mode = |
8856 | 169 new HistoricalDischargeAccess( |
170 (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
|
171 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
|
172 ? 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
|
173 : 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
|
174 |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
175 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
|
176 visible, axis); |
2633
894186b4c1d0
Issue 494.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2592
diff
changeset
|
177 } |
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
|
178 else { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7902
diff
changeset
|
179 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
|
180 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
|
181 } |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
182 } |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
183 |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
184 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
|
185 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
|
186 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
|
187 |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
188 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
|
189 |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
190 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
|
191 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
|
192 |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
193 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
|
194 } |
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
|
195 |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
196 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
|
197 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
|
198 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
|
199 |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
200 WQTimerange wqt = (WQTimerange) data; |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
201 |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
202 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
|
203 wqt.getWs(), theme, desc); |
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 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
|
206 } |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
207 |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
208 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
|
209 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
|
210 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
|
211 |
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
|
212 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
|
213 |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
214 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
|
215 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
|
216 |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
217 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
|
218 } |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
219 |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
220 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
|
221 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
|
222 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
|
223 |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
224 HistoricalWQTimerange wqt = (HistoricalWQTimerange) data; |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
225 |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
226 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
|
227 wqt.getDiffs(), theme, desc); |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
228 |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
229 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
|
230 } |
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
|
231 |
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 /** |
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 * 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
|
234 * 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
|
235 * 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
|
236 * 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
|
237 */ |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
238 protected TimeSeriesCollection newTimeSeriesCollection( |
8856 | 239 Timerange[] timeranges, |
240 double[] values, | |
241 ThemeDocument theme, | |
242 String desc | |
243 ) { | |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7902
diff
changeset
|
244 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
|
245 |
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 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
|
247 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
|
248 |
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
|
249 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
|
250 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
|
251 |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
252 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
|
253 if (Double.isNaN(values[i])) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7902
diff
changeset
|
254 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
|
255 continue; |
d70a04cad84d
Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2240
diff
changeset
|
256 } |
d70a04cad84d
Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2240
diff
changeset
|
257 |
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
|
258 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
|
259 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
|
260 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7902
diff
changeset
|
261 if (log.isDebugEnabled()) { |
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7902
diff
changeset
|
262 log.debug("added Item to TimeSeries:"); |
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7902
diff
changeset
|
263 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
|
264 log.debug(" Value: " + values[i]); |
2243
d70a04cad84d
Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2240
diff
changeset
|
265 } |
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
|
266 } |
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 catch (SeriesException se) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7902
diff
changeset
|
268 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
|
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 } |
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 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
|
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 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
|
275 } |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
276 |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
277 /** |
8856 | 278 * Create array that consists of two |
279 * <i>FixedMillisecond</i> periods [start, end]. | |
4736
b195fede1c3b
Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4232
diff
changeset
|
280 * |
4232
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
281 * @param timerange |
b3aa91e45010
Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4176
diff
changeset
|
282 * Supports start and end time. |
4736
b195fede1c3b
Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4232
diff
changeset
|
283 * |
6156
eee77cdd72fc
Fix comment for newRegularTimePeriod
Andre Heinecke <aheinecke@intevation.de>
parents:
6144
diff
changeset
|
284 * @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
|
285 */ |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
286 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
|
287 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
|
288 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
|
289 |
8856 | 290 return new RegularTimePeriod[] { |
291 new FixedMillisecond(start), | |
292 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
|
293 } |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
294 } |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
295 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |