Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveGenerator.java @ 8223:0bec47e5a951
Made it compile with changed ContextInjector interface again.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Mon, 08 Sep 2014 16:06:34 +0200 |
parents | e4606eae8ea5 |
children | 8c60595fd74c |
rev | line source |
---|---|
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5420
diff
changeset
|
9 package org.dive4elements.river.exports; |
1679
69929c471646
Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1113
diff
changeset
|
10 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5420
diff
changeset
|
11 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5420
diff
changeset
|
12 import org.dive4elements.artifactdatabase.state.Facet; |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
13 import org.dive4elements.river.artifacts.D4EArtifact; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5420
diff
changeset
|
14 import org.dive4elements.river.artifacts.StaticWKmsArtifact; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5420
diff
changeset
|
15 import org.dive4elements.river.artifacts.WINFOArtifact; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5420
diff
changeset
|
16 import org.dive4elements.river.artifacts.model.FacetTypes; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5420
diff
changeset
|
17 import org.dive4elements.river.artifacts.model.WKms; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5420
diff
changeset
|
18 import org.dive4elements.river.artifacts.model.WQKms; |
8181
209f8a9e8a75
Added new processor to plot misc discharge data, e.g. from datacage or recommendations.
Raimund Renkert <rrenkert@intevation.de>
parents:
7695
diff
changeset
|
19 import org.dive4elements.river.exports.process.MiscDischargeProcessor; |
5864
f2e46a668fe6
River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
20 import org.dive4elements.river.jfree.RiverAnnotation; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5420
diff
changeset
|
21 import org.dive4elements.river.jfree.StickyAxisAnnotation; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5420
diff
changeset
|
22 import org.dive4elements.river.jfree.StyledXYSeries; |
1850
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
23 |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6901
diff
changeset
|
24 import org.dive4elements.river.themes.ThemeDocument; |
5865
73da40528cf2
River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5864
diff
changeset
|
25 import org.dive4elements.river.utils.RiverUtils; |
5420
0bb57e72b8ea
Fix flys/issue1206 (reference system in discharge curve).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4047
diff
changeset
|
26 |
3409
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
3054
diff
changeset
|
27 import java.util.ArrayList; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
3054
diff
changeset
|
28 import java.util.List; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
3054
diff
changeset
|
29 |
6423
654ed1732035
issue1370: helper to find Gauge datum if any.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6403
diff
changeset
|
30 import org.jfree.data.xy.XYSeries; |
654ed1732035
issue1370: helper to find Gauge datum if any.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6403
diff
changeset
|
31 |
3409
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
3054
diff
changeset
|
32 import org.apache.log4j.Logger; |
6423
654ed1732035
issue1370: helper to find Gauge datum if any.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6403
diff
changeset
|
33 |
392
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 /** |
6879
1186fa8a0bb9
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6790
diff
changeset
|
36 * An OutGenerator that generates discharge curves, also at locations |
1186fa8a0bb9
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6790
diff
changeset
|
37 * not at a gauge. |
392
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 * |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 */ |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
41 public class ComputedDischargeCurveGenerator |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
42 extends DischargeCurveGenerator |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
43 implements FacetTypes |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
44 { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8194
diff
changeset
|
45 /** The log used in this generator. */ |
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8194
diff
changeset
|
46 private static Logger log = |
392
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 Logger.getLogger(ComputedDischargeCurveGenerator.class); |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
49 public static final String I18N_CHART_TITLE = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
50 "chart.computed.discharge.curve.title"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
51 |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
52 public static final String I18N_CHART_SUBTITLE = |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
53 "chart.computed.discharge.curve.subtitle"; |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
54 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
55 public static final String I18N_YAXIS_LABEL = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
56 "chart.computed.discharge.curve.yaxis.label"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
57 |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
58 public static final String I18N_CHART_TITLE_DEFAULT = "Abflusskurve"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
59 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
60 |
1083
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
61 /** Trivial Constructor. */ |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
62 public ComputedDischargeCurveGenerator () { |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
63 super(); |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
64 } |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
65 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
66 |
392
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 @Override |
2048
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
68 protected String getDefaultChartTitle() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
69 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT); |
400
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
70 } |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
71 |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
72 |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
73 @Override |
2048
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
74 protected String getDefaultChartSubtitle() { |
1113
5b38cdf65307
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1098
diff
changeset
|
75 double[] dist = getRange(); |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
76 |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
77 Object[] args = new Object[] { |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
78 getRiverName(), |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
79 dist[0] |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
80 }; |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
81 |
1989
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
82 return msg(I18N_CHART_SUBTITLE, "", args); |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
83 } |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
84 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
85 |
6423
654ed1732035
issue1370: helper to find Gauge datum if any.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6403
diff
changeset
|
86 |
1989
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
87 @Override |
2051
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2048
diff
changeset
|
88 protected String getDefaultYAxisLabel(int pos) { |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
89 D4EArtifact flys = (D4EArtifact) master; |
5420
0bb57e72b8ea
Fix flys/issue1206 (reference system in discharge curve).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4047
diff
changeset
|
90 |
5865
73da40528cf2
River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5864
diff
changeset
|
91 String unit = RiverUtils.getRiver(flys).getWstUnit().getName(); |
6454
e860fa106f56
issue1370: Now that the default first y axis is in cm, change default label.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6453
diff
changeset
|
92 if (pos == 0 && getCurrentGaugeDatum() != 0) |
6446
49760b45d4df
Adjust label of second y axis to show cm if it is the "cm" axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6445
diff
changeset
|
93 unit = "cm"; |
5420
0bb57e72b8ea
Fix flys/issue1206 (reference system in discharge curve).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4047
diff
changeset
|
94 |
0bb57e72b8ea
Fix flys/issue1206 (reference system in discharge curve).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4047
diff
changeset
|
95 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT, new Object[] { unit }); |
400
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
96 } |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
97 |
6424
11d3d04f3925
issue1370: Let a hypothetical second y axis be an SyncNumberAxis depending on first.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6423
diff
changeset
|
98 /** |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
99 * Process data, build up plot. |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
100 */ |
400
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
101 @Override |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1679
diff
changeset
|
102 public void doOut( |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
103 ArtifactAndFacet artifactFacet, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6901
diff
changeset
|
104 ThemeDocument attr, |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
105 boolean visible |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1679
diff
changeset
|
106 ) { |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
107 String name = artifactFacet.getFacetName(); |
393
befedd7629d5
Enabled the WINFO artifact to compute the data for discharge curves (computed) - ComputedDischargeCurveGenerator uses those values now to create the chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
392
diff
changeset
|
108 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8194
diff
changeset
|
109 log.debug("ComputedDischargeCurveGenerator.doOut: " + name); |
393
befedd7629d5
Enabled the WINFO artifact to compute the data for discharge curves (computed) - ComputedDischargeCurveGenerator uses those values now to create the chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
392
diff
changeset
|
110 |
1085
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
111 if (name == null) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8194
diff
changeset
|
112 log.warn("Broken facet in computed discharge out generation."); |
1085
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
113 return; |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
114 } |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
115 |
8181
209f8a9e8a75
Added new processor to plot misc discharge data, e.g. from datacage or recommendations.
Raimund Renkert <rrenkert@intevation.de>
parents:
7695
diff
changeset
|
116 MiscDischargeProcessor dProcessor = new MiscDischargeProcessor(getRange()[0]); |
6901
a3bf140ce739
ComputedDischargeCurveGenerator: Use DischargeProcessor to add main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6879
diff
changeset
|
117 if (dProcessor.canHandle(name)) { |
a3bf140ce739
ComputedDischargeCurveGenerator: Use DischargeProcessor to add main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6879
diff
changeset
|
118 dProcessor.doOut(this, artifactFacet, attr, visible, YAXIS.W.idx); |
a3bf140ce739
ComputedDischargeCurveGenerator: Use DischargeProcessor to add main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6879
diff
changeset
|
119 } |
a3bf140ce739
ComputedDischargeCurveGenerator: Use DischargeProcessor to add main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6879
diff
changeset
|
120 else if (name.equals(COMPUTED_DISCHARGE_Q)) { |
6429
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
121 doDischargeQOut((WQKms) artifactFacet.getData(context), artifactFacet, attr, visible); |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
122 } |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
123 else if (name.equals(STATIC_WQ)) { |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
124 doWQOut(artifactFacet.getData(context), artifactFacet, attr, visible); |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
125 } |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
126 else if (name.equals(STATIC_WQ_ANNOTATIONS)) { |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
127 doWQAnnotations( |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
128 artifactFacet.getData(context), |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
129 artifactFacet, |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
130 attr, |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
131 visible); |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
132 } |
6790
30507f19cbe7
issue1378: Handle static_wqkms.w as annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6789
diff
changeset
|
133 else if (STATIC_WKMS_INTERPOL.equals(name) || |
30507f19cbe7
issue1378: Handle static_wqkms.w as annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6789
diff
changeset
|
134 HEIGHTMARKS_POINTS.equals(name) || |
30507f19cbe7
issue1378: Handle static_wqkms.w as annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6789
diff
changeset
|
135 STATIC_WQKMS_W.equals(name)) { |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
136 doWAnnotations( |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
137 artifactFacet.getData(context), |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
138 artifactFacet, |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
139 attr, |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
140 visible); |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
141 } |
2769
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
142 else if (name.equals(STATIC_WKMS)) { |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
143 doWAnnotations( |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
144 artifactFacet.getData(context), |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
145 artifactFacet, |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
146 attr, |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
147 visible); |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
148 } |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
149 else if (FacetTypes.IS.MANUALPOINTS(name)) { |
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
150 doPoints(artifactFacet.getData(context), |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
151 artifactFacet, |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
152 attr, visible, YAXIS.W.idx); |
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
153 } |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
154 else if (name.equals(DISCHARGE_CURVE)) { |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
155 doDischargeOut( |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
156 (WINFOArtifact) artifactFacet.getArtifact(), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
157 artifactFacet.getData(context), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
158 artifactFacet.getFacetDescription(), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
159 attr, |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
160 visible); |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
161 } |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
162 else { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8194
diff
changeset
|
163 log.warn("Unknown facet type for computed discharge: " + name); |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
164 return; |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
165 } |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
166 } |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
167 |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
168 |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
169 /** |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
170 * Add WQ Data to plot. |
6789
7a02e613a61c
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6748
diff
changeset
|
171 * @param wq data as double[][] |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
172 */ |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
173 protected void doWQOut( |
6789
7a02e613a61c
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6748
diff
changeset
|
174 Object wq, |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
175 ArtifactAndFacet aaf, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6901
diff
changeset
|
176 ThemeDocument theme, |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
177 boolean visible |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
178 ) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8194
diff
changeset
|
179 log.debug("ComputedDischargeCurveGenerator: doWQOut"); |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
180 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); |
7623
b64c263df4d1
issue1579: ComputedDischargeCurveGenerator: Handle WQKms data.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6905
diff
changeset
|
181 if (wq instanceof double[][]) { |
b64c263df4d1
issue1579: ComputedDischargeCurveGenerator: Handle WQKms data.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6905
diff
changeset
|
182 double [][] data = (double [][]) wq; |
b64c263df4d1
issue1579: ComputedDischargeCurveGenerator: Handle WQKms data.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6905
diff
changeset
|
183 StyledSeriesBuilder.addPoints(series, data, true); |
b64c263df4d1
issue1579: ComputedDischargeCurveGenerator: Handle WQKms data.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6905
diff
changeset
|
184 } else if (wq instanceof WQKms) { |
b64c263df4d1
issue1579: ComputedDischargeCurveGenerator: Handle WQKms data.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6905
diff
changeset
|
185 WQKms wqkms = (WQKms) wq; |
b64c263df4d1
issue1579: ComputedDischargeCurveGenerator: Handle WQKms data.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6905
diff
changeset
|
186 StyledSeriesBuilder.addPointsQW(series, (WQKms) wq); |
b64c263df4d1
issue1579: ComputedDischargeCurveGenerator: Handle WQKms data.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6905
diff
changeset
|
187 } |
1902
6c5229d0b8e5
Refactored to use StyledSeriesBuilder to add Points to DataSeries.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1901
diff
changeset
|
188 |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
189 addAxisSeries(series, YAXIS.W.idx, visible); |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
190 } |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
191 |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
192 |
1083
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
193 /** |
6429
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
194 * Add discharge Q-Series to plot, scale if at gauge. |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
195 * @param wqkms actual data |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
196 * @param theme theme to use. |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
197 */ |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
198 protected void doDischargeQOut( |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
199 WQKms wqkms, |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
200 ArtifactAndFacet aaf, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6901
diff
changeset
|
201 ThemeDocument theme, |
6429
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
202 boolean visible |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
203 ) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8194
diff
changeset
|
204 log.debug("ComputedDischargeCurveGenerator: doDischargeQOut"); |
6429
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
205 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
206 |
6445
192fbd23d97f
Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6444
diff
changeset
|
207 double subtractPNP = getCurrentGaugeDatum(); |
6429
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
208 |
6445
192fbd23d97f
Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6444
diff
changeset
|
209 if (subtractPNP == 0d) { |
6429
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
210 StyledSeriesBuilder.addPointsQW(series, wqkms); |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
211 addAxisSeries(series, YAXIS.W.idx, visible); |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
212 } |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
213 else { |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
214 XYSeries series2 = new StyledXYSeries(aaf.getFacetDescription(), theme); |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
215 StyledSeriesBuilder.addPointsQW(series2, wqkms); |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
216 addAxisSeries(series2, YAXIS.W.idx, false); |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
217 |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
218 // Use second axis... |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
219 StyledSeriesBuilder.addPointsQW(series, wqkms, -subtractPNP, 100d); |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
220 addAxisSeries(series, YAXIS.WCm.idx, visible); |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
221 } |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
222 } |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
223 |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
224 |
e32b166c881b
issue1370: Add discharge q data to second axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6424
diff
changeset
|
225 /** |
6464 | 226 * Add W/Q-Series to plot. |
1083
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
227 * @param wqkms actual data |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
228 * @param theme theme to use. |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
229 */ |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1684
diff
changeset
|
230 protected void doQOut( |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
231 WQKms wqkms, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
232 ArtifactAndFacet aaf, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6901
diff
changeset
|
233 ThemeDocument theme, |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
234 boolean visible |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1684
diff
changeset
|
235 ) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8194
diff
changeset
|
236 log.debug("ComputedDischargeCurveGenerator: doQOut (add W/Q data)."); |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
237 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); |
1902
6c5229d0b8e5
Refactored to use StyledSeriesBuilder to add Points to DataSeries.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1901
diff
changeset
|
238 StyledSeriesBuilder.addPointsQW(series, wqkms); |
393
befedd7629d5
Enabled the WINFO artifact to compute the data for discharge curves (computed) - ComputedDischargeCurveGenerator uses those values now to create the chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
392
diff
changeset
|
239 |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
240 addAxisSeries(series, YAXIS.W.idx, visible); |
393
befedd7629d5
Enabled the WINFO artifact to compute the data for discharge curves (computed) - ComputedDischargeCurveGenerator uses those values now to create the chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
392
diff
changeset
|
241 } |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
242 |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
243 |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
244 /** |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
245 * Add WQ-Annotations to plot. |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
246 * @param wqkms actual data |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
247 * @param theme theme to use. |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
248 */ |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
249 protected void doWQAnnotations( |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
250 Object wqkms, |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
251 ArtifactAndFacet aandf, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6901
diff
changeset
|
252 ThemeDocument theme, |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
253 boolean visible |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
254 ) { |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
255 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>(); |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
256 double [][] data = (double [][]) wqkms; |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
257 for (int i = 0; i< data[0].length; i++) { |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
258 // TODO we need linear interpolation? |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
259 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
260 (float) data[0][i], StickyAxisAnnotation.SimpleAxis.X_AXIS)); |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
261 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
262 (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
263 } |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
264 |
5864
f2e46a668fe6
River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
265 doAnnotations(new RiverAnnotation(aandf.getFacetDescription(), xy), |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
266 aandf, theme, visible); |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
267 } |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
268 |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
269 |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
270 /** |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
271 * Add W-Annotations to plot. |
2570
e123c5643f23
Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2325
diff
changeset
|
272 * @param wqkms actual data (double[][]). |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
273 * @param theme theme to use. |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
274 */ |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
275 protected void doWAnnotations( |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
276 Object wqkms, |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
277 ArtifactAndFacet aandf, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6901
diff
changeset
|
278 ThemeDocument theme, |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
279 boolean visible |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
280 ) { |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
281 Facet facet = aandf.getFacet(); |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
282 |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
283 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>(); |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
284 // Try to find them as WKms as well... |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
285 if (wqkms instanceof double[][]) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8194
diff
changeset
|
286 log.debug("its double[][] time, baby"); |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
287 double [][] data = (double [][]) wqkms; |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
288 // TODO Do we need interpolation? |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
289 for (int i = 0; i< data[0].length; i++) { |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
290 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
291 (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
292 } |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
293 |
5864
f2e46a668fe6
River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
294 doAnnotations(new RiverAnnotation(facet.getDescription(), xy), |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
295 aandf, theme, visible); |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
296 } |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
297 else { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8194
diff
changeset
|
298 log.debug("its wkms time, baby"); |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
299 WKms data = (WKms) wqkms; |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
300 // Assume its WKms. |
4047
3dc26ec2558d
Removed dead code
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4036
diff
changeset
|
301 // XXX DEAD CODE // double location = getRange()[0]; |
4036
10e20830e4e9
Use static method from class not object.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3409
diff
changeset
|
302 double w = StaticWKmsArtifact.getWAtKmLin(data, getRange()[0]); |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
303 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
304 (float) w, StickyAxisAnnotation.SimpleAxis.Y_AXIS)); |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
305 |
5864
f2e46a668fe6
River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
306 doAnnotations(new RiverAnnotation(facet.getDescription(), xy), |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
307 aandf, theme, visible); |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
308 } |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
309 } |
392
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
310 } |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
311 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |