annotate artifacts/src/main/java/org/dive4elements/river/artifacts/states/GaugeDischargeCurveState.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents 6ebad936d82b
children a805211690f7
rev   line source
8302
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
1 package org.dive4elements.river.artifacts.states;
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
2
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
3 import java.util.List;
8435
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
4 import java.util.Date;
8302
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
5
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
6 import org.dive4elements.artifactdatabase.state.Facet;
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
7 import org.dive4elements.artifacts.CallContext;
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
8 import org.dive4elements.river.artifacts.D4EArtifact;
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
9 import org.dive4elements.river.artifacts.access.RiverAccess;
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
10 import org.dive4elements.river.artifacts.model.GaugeDischargeCurveFacet;
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
11 import org.dive4elements.river.artifacts.resources.Resources;
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
12
8435
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
13 import org.dive4elements.river.model.TimeInterval;
8302
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
14
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
15 public class GaugeDischargeCurveState
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
16 extends DefaultState
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
17 {
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
18
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
19 @Override
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
20 public Object computeAdvance(
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
21 D4EArtifact artifact,
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
22 String hash,
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
23 CallContext context,
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
24 List<Facet> facets,
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
25 Object old
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
26 ) {
8435
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
27 String gaugeName = artifact.getDataAsString("gauge_name");
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
28 TimeInterval validity = new RiverAccess(artifact).getRiver()
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
29 .determineGaugeByName(gaugeName).fetchMasterDischargeTable()
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
30 .getTimeInterval();
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
31 Date stopTime = validity.getStopTime();
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
32 String description = Resources.getMsg(
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
33 context.getMeta(),
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8435
diff changeset
34 "chart.discharge.curve.model"
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8435
diff changeset
35 + (stopTime != null ? "" : ".nostop"),
8435
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
36 new Object[] {gaugeName,
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
37 validity.getStartTime(),
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
38 stopTime
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
39 }
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
40 );
6ebad936d82b Unify descriptions of model discharge curve at gauge.
"Tom Gottfried <tom@intevation.de>"
parents: 8302
diff changeset
41
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8435
diff changeset
42 facets.add(new GaugeDischargeCurveFacet("gauge_discharge_curve",
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8435
diff changeset
43 description));
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8435
diff changeset
44 facets.add(new GaugeDischargeCurveFacet("at",
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8435
diff changeset
45 "gauge_discharge_curve"));
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8435
diff changeset
46 facets.add(new GaugeDischargeCurveFacet("csv",
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8435
diff changeset
47 "gauge_discharge_curve"));
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8435
diff changeset
48 facets.add(new GaugeDischargeCurveFacet("pdf",
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8435
diff changeset
49 "gauge_discharge_curve"));
8302
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
50 return null;
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
51 }
8578babdb2c8 Configured gauge discharge curve to use a default D4EArtifact and two states to hold the parameters and outs.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
52 }

http://dive4elements.wald.intevation.org