Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java @ 743:e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
flys-artifacts/trunk@2245 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 27 Jun 2011 07:45:32 +0000 |
parents | 56bcf56b1fe0 |
children | 7ca4a287cd0e |
rev | line source |
---|---|
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.exports; |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
454
2c0c22e0935d
Added names for discharge curves (at gauges).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
414
diff
changeset
|
3 import java.util.Date; |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import org.apache.log4j.Logger; |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import org.w3c.dom.Document; |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
375
60f63539d004
Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
369
diff
changeset
|
10 import org.jfree.chart.JFreeChart; |
728
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
11 import org.jfree.chart.axis.ValueAxis; |
375
60f63539d004
Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
369
diff
changeset
|
12 import org.jfree.chart.plot.XYPlot; |
728
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
13 import org.jfree.data.Range; |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import org.jfree.data.xy.DefaultXYDataset; |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.artifacts.Artifact; |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
695
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
664
diff
changeset
|
18 import de.intevation.artifactdatabase.state.Facet; |
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
664
diff
changeset
|
19 |
454
2c0c22e0935d
Added names for discharge curves (at gauges).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
414
diff
changeset
|
20 import de.intevation.flys.model.DischargeTable; |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 import de.intevation.flys.model.Gauge; |
381
52b6de9d0ab4
The DischargeCurveGenerator uses public methods of FLYSArtifact to retrieve all necessary information of the current settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
375
diff
changeset
|
22 import de.intevation.flys.model.River; |
454
2c0c22e0935d
Added names for discharge curves (at gauges).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
414
diff
changeset
|
23 import de.intevation.flys.model.TimeInterval; |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 import de.intevation.flys.artifacts.FLYSArtifact; |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
721
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
27 import de.intevation.flys.artifacts.model.WQKms; |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 /** |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 * An OutGenerator that generates discharge curves. |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 * |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 */ |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
34 public class DischargeCurveGenerator extends XYChartGenerator { |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 /** The logger used in this generator.*/ |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 private static Logger logger = |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 Logger.getLogger(DischargeCurveGenerator.class); |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
41 public static final String I18N_CHART_TITLE = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
42 "chart.discharge.curve.title"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
43 |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
44 public static final String I18N_CHART_SUBTITLE = |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
45 "chart.discharge.curve.subtitle"; |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
46 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
47 public static final String I18N_XAXIS_LABEL = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
48 "chart.discharge.curve.xaxis.label"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
49 |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
50 public static final String I18N_YAXIS_LABEL = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
51 "chart.discharge.curve.yaxis.label"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
52 |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
53 public static final String I18N_CHART_TITLE_DEFAULT = "Abflusskurven"; |
664
e006da5679d2
s@m³/s@m\u00b3/s@
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
454
diff
changeset
|
54 public static final String I18N_XAXIS_LABEL_DEFAULT = "Q [m\u00b3/s]"; |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
55 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [cm]"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
56 |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
57 |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 /** The Dataset that contains the data for the chart.*/ |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 protected DefaultXYDataset dataset; |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 public DischargeCurveGenerator() { |
348
635af5381a4d
Added an abstract OutGenerator that should be the base class for all generators which create charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
299
diff
changeset
|
63 super(); |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 this.dataset = new DefaultXYDataset(); |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 } |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
69 protected String getChartTitle() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
70 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
71 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
72 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
73 |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
74 @Override |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
75 protected void addSubtitles(JFreeChart chart) { |
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 } |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
78 |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
79 |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
80 protected String getXAxisLabel() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
81 return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
82 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
83 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
84 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
85 protected String getYAxisLabel() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
86 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
87 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
88 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
89 |
728
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
90 @Override |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
91 protected boolean zoomX(XYPlot plot, ValueAxis axis, Range range, Range x) { |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
92 boolean zoomin = super.zoom(plot, axis, range, x); |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
93 |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
94 if (!zoomin) { |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
95 axis.setLowerBound(0d); |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
96 } |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
97 |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
98 return zoomin; |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
99 } |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
100 |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
101 |
375
60f63539d004
Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
369
diff
changeset
|
102 protected void addDatasets(JFreeChart chart) { |
60f63539d004
Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
369
diff
changeset
|
103 XYPlot plot = (XYPlot) chart.getPlot(); |
60f63539d004
Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
369
diff
changeset
|
104 plot.setDataset(0, dataset); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
105 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
106 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
107 |
695
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
664
diff
changeset
|
108 public void doOut(Artifact artifact, Facet facet, Document attr) { |
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
664
diff
changeset
|
109 logger.debug("DischargeCurveGenerator.doOut: " + facet.getName()); |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 if (!(artifact instanceof FLYSArtifact)) { |
721
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
112 logger.debug("Artifact is no instance of FLYSArtifact."); |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 return; |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 } |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 FLYSArtifact flysArtifact = (FLYSArtifact) artifact; |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 |
721
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
118 facet = flysArtifact.getNativeFacet(facet); |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 |
721
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
120 if (facet == null) { |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
121 logger.debug("no facet found"); |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
122 return; |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 } |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 |
721
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
125 WQKms wqkms = (WQKms)facet.getData(flysArtifact, context); |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
126 |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
127 String gaugeName = wqkms.getName(); |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
128 |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
129 River river = flysArtifact.getRiver(); |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
130 |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
131 if (river == null) { |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
132 logger.debug("no river found"); |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
133 return; |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 } |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 |
721
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
136 Gauge gauge = river.determineGaugeByName(gaugeName); |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 |
721
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
138 if (gauge == null) { |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
139 logger.debug("no gauge found"); |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
140 return; |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
141 } |
454
2c0c22e0935d
Added names for discharge curves (at gauges).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
414
diff
changeset
|
142 |
721
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
143 String seriesName = getSeriesName(gauge); |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
144 |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
145 double [][] values = new double [][] { |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
146 wqkms.getQs(), wqkms.getWs() }; |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
147 |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
148 dataset.addSeries(seriesName, values); |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 } |
454
2c0c22e0935d
Added names for discharge curves (at gauges).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
414
diff
changeset
|
150 |
2c0c22e0935d
Added names for discharge curves (at gauges).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
414
diff
changeset
|
151 |
2c0c22e0935d
Added names for discharge curves (at gauges).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
414
diff
changeset
|
152 protected String getSeriesName(Gauge gauge) { |
743
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
153 // XXX The following code stops the artifact server accepting new HTTP |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
154 // requests. It needs more analysis! Is loading the discharge table a |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
155 // memory problem? Or is the time interval the problem? |
454
2c0c22e0935d
Added names for discharge curves (at gauges).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
414
diff
changeset
|
156 |
743
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
157 //List<DischargeTable> dts = gauge.getDischargeTables(); |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
158 |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
159 //for (DischargeTable dt: dts) { |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
160 // if (dt.getKind() == 0) { |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
161 // TimeInterval ti = dt.getTimeInterval(); |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
162 |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
163 // Date start = ti.getStartTime(); |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
164 // Date end = ti.getStopTime(); |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
165 |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
166 // String name = gauge.getName(); |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
167 |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
168 // if (end == null) { |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
169 // Object[] args = new Object[] { name, start }; |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
170 // return msg( |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
171 // "chart.discharge.curve.curve.valid.from", |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
172 // "", |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
173 // args); |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
174 // } |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
175 // else { |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
176 // Object[] args = new Object[] { name, start, end }; |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
177 // return msg( |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
178 // "chart.discharge.curve.curve.valid.range", |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
179 // "", |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
180 // args); |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
181 // } |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
182 // } |
e95e6df97e55
#177 Commented out the code that generates the series names in discharge curves. This code currently generates memory problems and stops the server accepting new http requests.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
728
diff
changeset
|
183 //} |
454
2c0c22e0935d
Added names for discharge curves (at gauges).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
414
diff
changeset
|
184 |
2c0c22e0935d
Added names for discharge curves (at gauges).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
414
diff
changeset
|
185 return gauge.getName(); |
2c0c22e0935d
Added names for discharge curves (at gauges).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
414
diff
changeset
|
186 } |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
187 } |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
188 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |