annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java @ 4587:c2ec7f5ac422

Enable manual points for s/q diagrams.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 28 Nov 2012 07:19:06 +0100
parents 319565a48182
children 526fd442e0e5
rev   line source
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts;
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
2
4190
b87d76a6da70 The AT export needs a ld_locations data item
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4188
diff changeset
3 import java.math.BigDecimal;
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
4 import java.util.ArrayList;
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
5 import java.util.List;
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
6
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
7 import org.apache.log4j.Logger;
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
8
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
9 import org.w3c.dom.Document;
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
10
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
11 import de.intevation.artifactdatabase.state.DefaultOutput;
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
12 import de.intevation.artifactdatabase.state.Facet;
4034
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
13 import de.intevation.artifactdatabase.data.DefaultStateData;
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
14
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
15 import de.intevation.artifacts.ArtifactFactory;
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
16 import de.intevation.artifacts.CallMeta;
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
17
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
18 import de.intevation.artifacts.common.ArtifactNamespaceContext;
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
19 import de.intevation.artifacts.common.utils.XMLUtils;
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
20
4032
a5e1ca620f15 Add description and set correct name for GaugeDischargeCurveFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4028
diff changeset
21 import de.intevation.flys.artifacts.model.GaugeDischargeCurveFacet;
a5e1ca620f15 Add description and set correct name for GaugeDischargeCurveFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4028
diff changeset
22 import de.intevation.flys.artifacts.resources.Resources;
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
23 import de.intevation.flys.artifacts.states.StaticState;
4032
a5e1ca620f15 Add description and set correct name for GaugeDischargeCurveFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4028
diff changeset
24
a5e1ca620f15 Add description and set correct name for GaugeDischargeCurveFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4028
diff changeset
25 import de.intevation.flys.model.Gauge;
a5e1ca620f15 Add description and set correct name for GaugeDischargeCurveFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4028
diff changeset
26 import de.intevation.flys.utils.FLYSUtils;
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
27
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
28
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
29 /**
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
30 * Artifact to calculate a discharge curve from a gauge overview info
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
31 *
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
32 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a>
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
33 */
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
34 public class GaugeDischargeCurveArtifact
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
35 extends AbstractStaticStateArtifact
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
36 {
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
37
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
38 private static final Logger logger =
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
39 Logger.getLogger(GaugeDischargeCurveArtifact.class);
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
40
4027
21cac9482958 Fix xpath for attributes
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3991
diff changeset
41 public static final String XPATH_RIVER = "/art:action/art:river/@art:name";
21cac9482958 Fix xpath for attributes
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3991
diff changeset
42 public static final String XPATH_GAUGE = "/art:action/art:gauge/@art:reference";
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
43 public static final String NAME = "gaugedischargecurve";
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
44 public static final String STATIC_STATE_NAME = "state.gaugedischargecurve.static";
4159
bbae306fcb4f Set uiprovider on the state
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4034
diff changeset
45 public static final String UIPROVIDER = "gauge_discharge_curve";
4188
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
46 public static final String GAUGE_DISCHARGE_CURVE_FACET =
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
47 "gauge_discharge_curve";
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
48 public static final String GAUGE_DISCHARGE_CURVE_AT_EXPORT_FACET =
4305
8c51c43e59ca Rename gauge_discharge_curve_at_export facet to at
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4190
diff changeset
49 "at";
4188
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
50 public static final String GAUGE_DISCHARGE_CURVE_OUT =
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
51 "discharge_curve";
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
52 public static final String GAUGE_DISCHARGE_CURVE_AT_EXPORT_OUT =
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
53 "computed_dischargecurve_at_export";
4586
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
54 public static final String GAUGE_DISCHARGE_CURVE_CSV_OUT =
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
55 "computed_dischargecurve_export";
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
56 public static final String GAUGE_DISCHARGE_CURVE_CSV_FACET =
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
57 "csv";
4188
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
58
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
59 private Facet atexportfacet;
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
60 private Facet curvefacet;
4586
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
61 private Facet csvfacet;
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
62
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
63 /**
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
64 * Setup initializes the data by extracting the river and gauge from
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
65 * the XML Document.
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
66 */
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
67 @Override
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
68 public void setup(
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
69 String identifier,
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
70 ArtifactFactory factory,
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
71 Object context,
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
72 CallMeta callmeta,
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
73 Document data)
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
74 {
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
75 logger.debug("GaugeDischargeCurveArtifact.setup");
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
76
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
77 if (logger.isDebugEnabled()) {
4028
b993d328f8b0 Improve debug output
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4027
diff changeset
78 logger.debug("GaugeDischargeCurveArtifact.setup" + XMLUtils.toString(data));
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
79 }
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
80 String gaugeref = XMLUtils.xpathString(data, XPATH_GAUGE,
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
81 ArtifactNamespaceContext.INSTANCE);
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
82 String rivername = XMLUtils.xpathString(data, XPATH_RIVER,
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
83 ArtifactNamespaceContext.INSTANCE);
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
84
4034
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
85 addData("river", new DefaultStateData("river",
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
86 Resources.getMsg(callmeta,
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
87 "facet.gauge_discharge_curve.river",
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
88 "Name of the river"),
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
89 "String", rivername));
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
90 addData("reference_gauge", new DefaultStateData("reference_gauge",
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
91 Resources.getMsg(callmeta,
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
92 "facet.gauge_discharge_curve.reference_gauge",
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
93 "Gauge official number"),
4186
eba517419832 Change reference_gauge paremeter to Long
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4185
diff changeset
94 "Long", gaugeref));
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
95
4032
a5e1ca620f15 Add description and set correct name for GaugeDischargeCurveFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4028
diff changeset
96 Gauge gauge = FLYSUtils.getReferenceGauge(this);
4034
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
97 String gaugename = "";
4190
b87d76a6da70 The AT export needs a ld_locations data item
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4188
diff changeset
98 Double gaugelocation = null;
4034
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
99 if (gauge != null) {
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
100 gaugename = gauge.getName();
4190
b87d76a6da70 The AT export needs a ld_locations data item
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4188
diff changeset
101 BigDecimal station = gauge.getStation();
b87d76a6da70 The AT export needs a ld_locations data item
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4188
diff changeset
102 if (station != null) {
b87d76a6da70 The AT export needs a ld_locations data item
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4188
diff changeset
103 gaugelocation = station.doubleValue();
b87d76a6da70 The AT export needs a ld_locations data item
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4188
diff changeset
104 }
4034
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
105 }
4032
a5e1ca620f15 Add description and set correct name for GaugeDischargeCurveFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4028
diff changeset
106
4164
8d3e8cb54e4c Add data for the gauge name to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4159
diff changeset
107 addData("gauge_name", new DefaultStateData("gauge_name",
8d3e8cb54e4c Add data for the gauge name to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4159
diff changeset
108 Resources.getMsg(callmeta,
8d3e8cb54e4c Add data for the gauge name to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4159
diff changeset
109 "facet.gauge_discharge_curve.gauge_name",
8d3e8cb54e4c Add data for the gauge name to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4159
diff changeset
110 "Name of the gauge"),
8d3e8cb54e4c Add data for the gauge name to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4159
diff changeset
111 "String", gaugename));
8d3e8cb54e4c Add data for the gauge name to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4159
diff changeset
112
4190
b87d76a6da70 The AT export needs a ld_locations data item
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4188
diff changeset
113 if (gaugelocation != null) {
b87d76a6da70 The AT export needs a ld_locations data item
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4188
diff changeset
114 addData("ld_locations", new DefaultStateData("ld_locations",
b87d76a6da70 The AT export needs a ld_locations data item
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4188
diff changeset
115 Resources.getMsg(callmeta,
b87d76a6da70 The AT export needs a ld_locations data item
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4188
diff changeset
116 "facet.gauge_discharge_curve.gauge_location",
b87d76a6da70 The AT export needs a ld_locations data item
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4188
diff changeset
117 "Location of the gauge"),
b87d76a6da70 The AT export needs a ld_locations data item
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4188
diff changeset
118 "Double", gaugelocation.toString()));
b87d76a6da70 The AT export needs a ld_locations data item
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4188
diff changeset
119 }
b87d76a6da70 The AT export needs a ld_locations data item
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4188
diff changeset
120
4032
a5e1ca620f15 Add description and set correct name for GaugeDischargeCurveFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4028
diff changeset
121 String description = Resources.format(callmeta,
a5e1ca620f15 Add description and set correct name for GaugeDischargeCurveFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4028
diff changeset
122 "facet.gauge_discharge_curve.description",
a5e1ca620f15 Add description and set correct name for GaugeDischargeCurveFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4028
diff changeset
123 "Discharge curve on gauge",
a5e1ca620f15 Add description and set correct name for GaugeDischargeCurveFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4028
diff changeset
124 rivername,
4034
46c1210be26b Set translated data descriptions
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4032
diff changeset
125 gaugename);
4032
a5e1ca620f15 Add description and set correct name for GaugeDischargeCurveFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4028
diff changeset
126
4586
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
127 List<Facet> fs = new ArrayList<Facet>(3);
4188
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
128 curvefacet = new GaugeDischargeCurveFacet(
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
129 GAUGE_DISCHARGE_CURVE_FACET, description);
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
130 fs.add(curvefacet);
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
131
4188
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
132 description = Resources.format(callmeta,
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
133 "facet.gauge_discharge_curve_at_export.description",
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
134 "Discharge curve AT export on gauge",
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
135 rivername,
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
136 gaugename);
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
137 atexportfacet = new GaugeDischargeCurveFacet(
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
138 GAUGE_DISCHARGE_CURVE_AT_EXPORT_FACET, description);
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
139 fs.add(atexportfacet);
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
140
4586
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
141 description = Resources.format(callmeta,
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
142 "facet.computed_dischargecurve_export.csv",
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
143 "Discharge curve CSV export on gauge",
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
144 rivername,
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
145 gaugename);
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
146 csvfacet = new GaugeDischargeCurveFacet(
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
147 GAUGE_DISCHARGE_CURVE_CSV_FACET, description);
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
148 fs.add(csvfacet);
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
149
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
150 addFacets(STATIC_STATE_NAME, fs);
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
151
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
152 super.setup(identifier, factory, context, callmeta, data);
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
153 }
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
154
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
155 @Override
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
156 public String getName() {
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
157 return NAME;
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
158 }
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
159
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
160 @Override
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
161 protected void initStaticState() {
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
162 StaticState state = new StaticState(STATIC_STATE_NAME);
4188
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
163
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
164 List<Facet> fs = new ArrayList<Facet>(1);
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
165 fs.add(curvefacet);
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
166
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
167 DefaultOutput output = new DefaultOutput(
4188
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
168 GAUGE_DISCHARGE_CURVE_OUT,
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
169 "output.discharge_curve",
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
170 "image/png",
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
171 fs,
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
172 "chart");
4188
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
173 state.addOutput(output);
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
174
4188
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
175 fs = new ArrayList<Facet>(1);
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
176 fs.add(atexportfacet);
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
177 output = new DefaultOutput(
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
178 GAUGE_DISCHARGE_CURVE_AT_EXPORT_OUT,
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
179 "output.computed_dischargecurve_at_export",
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
180 "text/plain",
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
181 fs,
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
182 "export");
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
183 state.addOutput(output);
4188
dc4087088c0b Add a new outputmode for an at export in GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4186
diff changeset
184
4586
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
185 fs = new ArrayList<Facet>(1);
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
186 fs.add(csvfacet);
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
187 output = new DefaultOutput(
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
188 GAUGE_DISCHARGE_CURVE_CSV_OUT,
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
189 "output.computed_dischargecurve_export",
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
190 "text/plain",
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
191 fs,
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
192 "export");
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
193 state.addOutput(output);
319565a48182 Add the csv export to the GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4305
diff changeset
194
4159
bbae306fcb4f Set uiprovider on the state
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4034
diff changeset
195 state.setUIProvider(UIPROVIDER);
3936
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
196 setStaticState(state);
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
197 }
4e1b3b4ef132 Add new Artifacts and State for displaying discharge curves at a gauge
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
198 }

http://dive4elements.wald.intevation.org