annotate flys-artifacts/src/main/java/de/intevation/flys/exports/HistoricalDischargeCurveGenerator.java @ 4242:448cbd8708d5

Added new classes for the last commit.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 24 Oct 2012 14:44:12 +0200
parents b3aa91e45010
children b195fede1c3b
rev   line source
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
1 package de.intevation.flys.exports;
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
4176
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
3 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
4
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
5 import org.apache.log4j.Logger;
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
6 import org.jfree.chart.plot.XYPlot;
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
7 import org.jfree.data.general.SeriesException;
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
8 import org.jfree.data.time.Day;
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
9 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
10 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
11 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
12 import org.w3c.dom.Document;
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
13
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
14 import de.intevation.artifactdatabase.state.ArtifactAndFacet;
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 import de.intevation.flys.artifacts.FLYSArtifact;
4152
5ff3b2f5fb1c Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3409
diff changeset
16 import de.intevation.flys.artifacts.access.HistoricalDischargeAccess;
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
17 import de.intevation.flys.artifacts.model.FacetTypes;
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
18 import de.intevation.flys.artifacts.model.HistoricalWQTimerange;
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
19 import de.intevation.flys.artifacts.model.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
20 import de.intevation.flys.artifacts.model.WQTimerange;
2321
991e4a5df323 Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2311
diff changeset
21 import de.intevation.flys.jfree.StyledTimeSeries;
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
22 import de.intevation.flys.utils.FLYSUtils;
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
23
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 /**
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 * @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
27 */
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
28 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
29 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
30
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
31 private static Logger logger = Logger
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
32 .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
33
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
34 public static final String I18N_CHART_TITLE = "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
35
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
36 public static final String I18N_CHART_SUBTITLE = "chart.historical.discharge.subtitle";
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
37
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
38 public static final String I18N_XAXIS_LABEL = "chart.historical.discharge.xaxis.label";
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
39
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
40 public static final String I18N_YAXIS_LABEL = "chart.historical.discharge.yaxis.label";
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
41
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
42 public static final String I18N_YAXIS_SECOND_LABEL = "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
43
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
44 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
45 W(0), Q(1);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
46
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
47 protected int idx;
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
48
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
49 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
50 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
51 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 @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
55 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
56 return new YAxisWalker() {
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
57
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
58 @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
59 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
60 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
61 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 @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
64 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
65 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
66 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
67 }
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 };
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 }
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
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 @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
72 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
73 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
74 }
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
75
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
76 @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
77 protected String getDefaultChartSubtitle() {
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
78 FLYSArtifact flys = (FLYSArtifact) master;
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
79 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
80 .getEvaluationTimerange();
4152
5ff3b2f5fb1c Added evaluation timerange to subtitle of historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3409
diff changeset
81
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
82 Object[] args = new Object[] { FLYSUtils.getReferenceGaugeName(flys),
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
83 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
84
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
85 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
86 }
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
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 @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
89 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
90 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
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
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 @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
94 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
95 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
96 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
97 }
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 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
99 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
100 }
997df76c6f58 Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2243
diff changeset
101 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
102 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
103 }
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
104 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105
4176
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
106 @Override
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
107 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
108 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
109 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
110 }
0e5544c54be8 Fixed flys/issue929. Made zero baseline in historical discharge curve charts visible.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4152
diff changeset
111
3409
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2633
diff changeset
112 @Override
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
113 public void doOut(ArtifactAndFacet artifactFacet, Document theme,
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
114 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
115 String name = artifactFacet.getFacetName();
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116 logger.debug("HistoricalDischargeCurveGenerator.doOut: " + name);
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
117 logger.debug("Theme description is: "
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
118 + 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
119
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120 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
121 doHistoricalDischargeOutQ(
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
122 (FLYSArtifact) artifactFacet.getArtifact(),
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123 artifactFacet.getData(context),
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
124 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
125 }
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
126 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
127 doHistoricalDischargeOutW(
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
128 (FLYSArtifact) artifactFacet.getArtifact(),
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
129 artifactFacet.getData(context),
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
130 artifactFacet.getFacetDescription(), theme, visible);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
131 }
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
132 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
133 doHistoricalDischargeDifferenceOutQ(
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
134 (FLYSArtifact) artifactFacet.getArtifact(),
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
135 artifactFacet.getData(context),
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
136 artifactFacet.getFacetDescription(), theme, visible);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
137 }
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
138 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
139 doHistoricalDischargeDifferenceOutW(
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
140 (FLYSArtifact) artifactFacet.getArtifact(),
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
141 artifactFacet.getData(context),
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
142 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
143 }
2633
894186b4c1d0 Issue 494.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2592
diff changeset
144 else if (FacetTypes.IS.MANUALPOINTS(name)) {
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
145 doPoints(artifactFacet.getData(context), artifactFacet, theme,
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
146 visible, YAXIS.Q.idx);
2633
894186b4c1d0 Issue 494.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2592
diff changeset
147 }
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 else {
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
149 logger.warn("doOut(): unknown facet name: " + name);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
150 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
151 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
152 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
153
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
154 protected void doHistoricalDischargeOutQ(FLYSArtifact artifact,
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
155 Object data, String desc, Document theme, 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
156 logger.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
157
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
158 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
159
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
160 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
161 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
162
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
163 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
164 }
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
165
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
166 protected void doHistoricalDischargeOutW(FLYSArtifact artifact,
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
167 Object data, String desc, Document theme, boolean visible) {
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
168 logger.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
169
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
170 WQTimerange wqt = (WQTimerange) data;
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
171
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
172 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
173 wqt.getWs(), theme, desc);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
174
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
175 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
176 }
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
177
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
178 protected void doHistoricalDischargeDifferenceOutQ(FLYSArtifact artifact,
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
179 Object data, String desc, Document theme, boolean 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
180 logger.debug("doHistoricalDischargeDifferenceOut: desc = " + desc);
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
181
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
182 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
183
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
184 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
185 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
186
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
187 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
188 }
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 protected void doHistoricalDischargeDifferenceOutW(FLYSArtifact artifact,
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
191 Object data, String desc, Document theme, boolean visible) {
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
192 logger.debug("doHistoricalDischargeDifferenceOut: desc = " + desc);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
193
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
194 HistoricalWQTimerange wqt = (HistoricalWQTimerange) data;
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
195
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
196 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
197 wqt.getDiffs(), theme, desc);
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
198
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
199 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
200 }
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
201
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
202 /**
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
203 * 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
204 * 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
205 * 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
206 * 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
207 */
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
208 protected TimeSeriesCollection newTimeSeriesCollection(
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
209 Timerange[] timeranges, double[] values, Document theme, String 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
210 logger.debug("Create new TimeSeriesCollection for: " + desc);
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
211
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
212 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
213 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
214
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
215 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
216 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
217
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 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
219 if (Double.isNaN(values[i])) {
2243
d70a04cad84d Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2240
diff changeset
220 logger.warn("Skip TimePeriod because value is NaN.");
d70a04cad84d Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2240
diff changeset
221 continue;
d70a04cad84d Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2240
diff changeset
222 }
d70a04cad84d Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2240
diff changeset
223
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
224 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
225 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
226
d70a04cad84d Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2240
diff changeset
227 if (logger.isDebugEnabled()) {
d70a04cad84d Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2240
diff changeset
228 logger.debug("added Item to TimeSeries:");
d70a04cad84d Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2240
diff changeset
229 logger.debug(" TimePeriod: " + rtp[0] + " - " + rtp[1]);
2311
b8df8d1476ba Compute differences between discharge table values and reference discharge table values in historical discharge curve calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2249
diff changeset
230 logger.debug(" Value: " + values[i]);
2243
d70a04cad84d Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2240
diff changeset
231 }
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
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 catch (SeriesException se) {
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 logger.warn("Error while adding TimePeriod: " + se);
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 }
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 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
239
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
240 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
241 }
e9173de1026c The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2233
diff changeset
242
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 * Creates an array that consists of two <i>Minute</i> periods [start, end].
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
245 *
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
246 * @param timerange
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
247 * Supports start and end time.
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
248 *
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 * @return an array with two <i>Minute</i> periods [start, end].
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 */
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 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
252 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
253 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
254
4232
b3aa91e45010 Implemented the Q evaluation mode for historical discharge calculations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4176
diff changeset
255 return new RegularTimePeriod[] { new Day(start), new Day(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
256 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
257 }
ebbb18ed78c4 Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
258 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org