Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/HistoricalDischargeCurveGenerator.java @ 4044:7eebd9e58641
Add chart legend entries for interpolated series (#838).
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Fri, 05 Oct 2012 23:21:18 +0200 |
parents | 97ad960f5579 |
children | 5ff3b2f5fb1c |
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 |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 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
|
4 import de.intevation.flys.artifacts.FLYSArtifact; |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 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
|
6 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
|
7 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
|
8 import de.intevation.flys.artifacts.model.WQTimerange; |
2321
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2311
diff
changeset
|
9 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
|
10 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
|
11 |
3409
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
2633
diff
changeset
|
12 import java.util.Date; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
2633
diff
changeset
|
13 |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
2633
diff
changeset
|
14 import org.apache.log4j.Logger; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
2633
diff
changeset
|
15 import org.jfree.data.general.SeriesException; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
2633
diff
changeset
|
16 import org.jfree.data.time.Day; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
2633
diff
changeset
|
17 import org.jfree.data.time.RegularTimePeriod; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
2633
diff
changeset
|
18 import org.jfree.data.time.TimeSeries; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
2633
diff
changeset
|
19 import org.jfree.data.time.TimeSeriesCollection; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
2633
diff
changeset
|
20 import org.w3c.dom.Document; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
2633
diff
changeset
|
21 |
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
|
22 |
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 * @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
|
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 public class HistoricalDischargeCurveGenerator |
2233
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2215
diff
changeset
|
27 extends TimeseriesChartGenerator |
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
|
28 implements FacetTypes |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 { |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 private static Logger logger = |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 Logger.getLogger(HistoricalDischargeCurveGenerator.class); |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 |
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
|
34 public static final String 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
|
35 "chart.historical.discharge.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
|
36 |
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 public static final String I18N_CHART_SUBTITLE = |
997df76c6f58
Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2243
diff
changeset
|
38 "chart.historical.discharge.subtitle"; |
997df76c6f58
Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2243
diff
changeset
|
39 |
997df76c6f58
Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2243
diff
changeset
|
40 public static final String I18N_XAXIS_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
|
41 "chart.historical.discharge.xaxis.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
|
42 |
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 public static final String 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
|
44 "chart.historical.discharge.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
|
45 |
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 public static final String 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
|
47 "chart.historical.discharge.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
|
48 |
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 |
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
|
50 public static enum YAXIS { |
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 Q(0); |
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 protected 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
|
53 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
|
54 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
|
55 } |
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 } |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 |
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 |
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 @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
|
60 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
|
61 return new YAxisWalker() { |
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 @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
|
63 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
|
64 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
|
65 } |
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 |
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 @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
|
68 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
|
69 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
|
70 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
|
71 } |
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 |
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 @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
|
77 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
|
78 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
|
79 } |
997df76c6f58
Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2243
diff
changeset
|
80 |
997df76c6f58
Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2243
diff
changeset
|
81 |
997df76c6f58
Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2243
diff
changeset
|
82 @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
|
83 protected String getDefaultChartSubtitle() { |
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 String[] args = new String[] { |
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 FLYSUtils.getReferenceGaugeName((FLYSArtifact) master) |
997df76c6f58
Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2243
diff
changeset
|
86 }; |
997df76c6f58
Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2243
diff
changeset
|
87 |
997df76c6f58
Create title, subtitle and axes labels for charts from type historical discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2243
diff
changeset
|
88 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
|
89 } |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 @Override |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 protected String 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
|
94 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
|
95 } |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 @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
|
98 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
|
99 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
|
100 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
|
101 } |
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 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
|
103 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
|
104 } |
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 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
|
106 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
|
107 } |
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
|
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 |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 |
3409
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
2633
diff
changeset
|
111 @Override |
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 public void doOut( |
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 ArtifactAndFacet artifactFacet, |
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 Document theme, |
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 boolean visible |
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 ) { |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 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
|
118 logger.debug("HistoricalDischargeCurveGenerator.doOut: " + name); |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2321
diff
changeset
|
119 logger.debug("Theme description is: " + 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
|
120 |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 |
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 if (name.equals(HISTORICAL_DISCHARGE_Q)) { |
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 doHistoricalDischargeOut( |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 (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
|
125 artifactFacet.getData(context), |
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 artifactFacet.getFacetDescription(), |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 theme, |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 visible); |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 } |
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
|
130 else if (name.equals(HISTORICAL_DISCHARGE_Q_DIFF)) { |
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
|
131 doHistoricalDischargeDifferenceOut( |
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
|
132 (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
|
133 artifactFacet.getData(context), |
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
|
134 artifactFacet.getFacetDescription(), |
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
|
135 theme, |
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
|
136 visible); |
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
|
137 } |
2633
894186b4c1d0
Issue 494.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2592
diff
changeset
|
138 else if (FacetTypes.IS.MANUALPOINTS(name)) { |
894186b4c1d0
Issue 494.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2592
diff
changeset
|
139 doPoints (artifactFacet.getData(context), |
894186b4c1d0
Issue 494.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2592
diff
changeset
|
140 artifactFacet, |
894186b4c1d0
Issue 494.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2592
diff
changeset
|
141 theme, visible, YAXIS.Q.idx); |
894186b4c1d0
Issue 494.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2592
diff
changeset
|
142 } |
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 // TODO ADD THE CASE FOR DISPLAYING W VALUES |
2215
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 else { |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 logger.warn("doOut(): unknown facet name: " + name); |
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 return; |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 } |
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 } |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 |
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 protected void doHistoricalDischargeOut( |
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 FLYSArtifact artifact, |
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 Object data, |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 String desc, |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 Document theme, |
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 boolean visible) |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 { |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
158 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
|
159 |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
160 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
|
161 |
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 TimeSeriesCollection tsc = newTimeSeriesCollection( |
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
|
163 wqt.getTimeranges(), |
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 wqt.getQs(), |
2321
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2311
diff
changeset
|
165 theme, |
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 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
|
167 |
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
|
168 addAxisDataset(tsc, 0, visible); |
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 } |
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
|
170 |
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
|
171 |
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
|
172 protected void doHistoricalDischargeDifferenceOut( |
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
|
173 FLYSArtifact artifact, |
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
|
174 Object 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
|
175 String 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
|
176 Document theme, |
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
|
177 boolean visible |
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
|
178 ) { |
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
|
179 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
|
180 |
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 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
|
182 |
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 TimeSeriesCollection tsc = newTimeSeriesCollection( |
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
|
184 wqt.getTimeranges(), |
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
|
185 wqt.getDiffs(), |
2321
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2311
diff
changeset
|
186 theme, |
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
|
187 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
|
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 addAxisDataset(tsc, 0, visible); |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
190 } |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
191 |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
192 |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
193 /** |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
194 * 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
|
195 * 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
|
196 * 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
|
197 * 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
|
198 */ |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
199 protected TimeSeriesCollection newTimeSeriesCollection( |
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
|
200 Timerange[] timeranges, |
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
|
201 double[] values, |
2321
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2311
diff
changeset
|
202 Document 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
|
203 String 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
|
204 ) { |
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 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
|
206 |
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 TimeSeriesCollection tsc = new TimeSeriesCollection(); |
2321
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2311
diff
changeset
|
208 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
|
209 |
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
|
210 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
|
211 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
|
212 |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
213 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
|
214 if (Double.isNaN(values[i])) { |
2243
d70a04cad84d
Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2240
diff
changeset
|
215 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
|
216 continue; |
d70a04cad84d
Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2240
diff
changeset
|
217 } |
d70a04cad84d
Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2240
diff
changeset
|
218 |
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 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
|
220 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
|
221 |
d70a04cad84d
Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2240
diff
changeset
|
222 if (logger.isDebugEnabled()) { |
d70a04cad84d
Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2240
diff
changeset
|
223 logger.debug("added Item to TimeSeries:"); |
d70a04cad84d
Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2240
diff
changeset
|
224 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
|
225 logger.debug(" Value: " + values[i]); |
2243
d70a04cad84d
Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2240
diff
changeset
|
226 } |
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
|
227 } |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
228 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
|
229 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
|
230 } |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
231 } |
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 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
|
234 |
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 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
|
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 |
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 * Creates an array that consists of 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
|
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 * @param timerange Supports start and end time. |
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 * @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
|
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 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
|
247 Date start = new Date(timerange.getStart()); |
2243
d70a04cad84d
Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2240
diff
changeset
|
248 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
|
249 |
e9173de1026c
The HistoricalDischargeCurveGenerator now creates new AxisDataset objects and new TimeSeriesCollections for each Facet.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
250 return new RegularTimePeriod[] { |
2243
d70a04cad84d
Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2240
diff
changeset
|
251 new Day(start), |
d70a04cad84d
Improved chart creation for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2240
diff
changeset
|
252 new Day(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
|
253 }; |
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
|
254 } |
ebbb18ed78c4
Added new classes and stubs used to calculate data for historical discharge curve charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
255 } |
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 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |