annotate artifacts/src/main/java/org/dive4elements/river/artifacts/ManualPointsArtifact.java @ 9425:3f49835a00c3

Extended CrossSectionFacet so it may fetch different data from within the artifact result. Also allows to have acces to the potentially already computed artifact result via its normal computation cache.
author gernotbelger
date Fri, 17 Aug 2018 15:31:02 +0200
parents 5e38e2924c07
children
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: 4497
diff changeset
9 package org.dive4elements.river.artifacts;
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
11 import java.io.Serializable;
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
12 import java.util.ArrayList;
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
13 import java.util.List;
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
14
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
15 import org.apache.log4j.Logger;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
16 import org.dive4elements.artifactdatabase.state.Facet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
17 import org.dive4elements.artifacts.Artifact;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
18 import org.dive4elements.artifacts.ArtifactFactory;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
19 import org.dive4elements.artifacts.CallContext;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
20 import org.dive4elements.artifacts.CallMeta;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
21 import org.dive4elements.river.artifacts.model.FacetTypes;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
22 import org.dive4elements.river.artifacts.states.DefaultState;
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
23 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType;
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
24 import org.json.JSONArray;
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
25 import org.json.JSONException;
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
26 import org.w3c.dom.Document;
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
27
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
28 /**
3225
049ccd2c5935 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3198
diff changeset
29 * Artifact to store user-added points and water lines.
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
30 */
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
31 public class ManualPointsArtifact extends StaticD4EArtifact implements FacetTypes, WaterLineArtifact {
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
32
3761
066e2b4d69ca Fix missing import
Christian Lins <christian.lins@intevation.de>
parents: 3556
diff changeset
33 private static final long serialVersionUID = 7096025125474986011L;
066e2b4d69ca Fix missing import
Christian Lins <christian.lins@intevation.de>
parents: 3556
diff changeset
34
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
35 /** The log for this class. */
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
36 private static Logger log = Logger.getLogger(ManualPointsArtifact.class);
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
37
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
38 /** The name of the artifact. */
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
39 public static final String ARTIFACT_NAME = "manualpoints";
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
40
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
41 public ManualPointsArtifact() {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
42 log.debug("ManualPointsArtifact.ManualPointsArtifact()");
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
43 }
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
44
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
45 /**
3761
066e2b4d69ca Fix missing import
Christian Lins <christian.lins@intevation.de>
parents: 3556
diff changeset
46 * Gets called from factory to set things up.
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
47 */
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
48 @Override
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
49 public void setup(final String identifier, final ArtifactFactory factory, final Object context, final CallMeta callMeta, final Document data,
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
50 final List<Class> loadFacets) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
51 log.debug("ManualPointsArtifact.setup");
7842
8d5ca5175038 Updated signature of artifacts setup method; Removed unnecessary setup overrides.
Raimund Renkert <rrenkert@intevation.de>
parents: 5994
diff changeset
52 super.setup(identifier, factory, context, callMeta, data, loadFacets);
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
53 initialize(null, context, callMeta);
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
54 }
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
55
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
56 /** Return the name of this artifact. */
3761
066e2b4d69ca Fix missing import
Christian Lins <christian.lins@intevation.de>
parents: 3556
diff changeset
57 @Override
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
58 public String getName() {
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
59 return ARTIFACT_NAME;
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
60 }
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
61
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
62 /** Access state data storing the jsonstring with points. */
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
63 public String getPointsData(final String facetName) {
2206
e2124ca11adb Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2173
diff changeset
64 return getDataAsString(facetName + ".data");
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
65 }
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
66
3198
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
67 /**
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
68 * Access state data storing the jsonstring with lines.
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
69 *
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
70 * @param facetName
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
71 * Name of facet or null if the so far
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
72 * only known case should be picked.
3198
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
73 * @return (String) value of data element (expect json).
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
74 */
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
75 private String getLinesData(final String facetName) {
3198
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
76 if (facetName == null)
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
77 return getDataAsString("cross_section.manualpoints.lines");
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
78 // TODO .lineS?
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
79 return getDataAsString(facetName + ".line");
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
80 }
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
81
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
82 /** Setup state and facet. */
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
83 @Override
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
84 protected void initialize(final Artifact artifact, final Object context, final CallMeta meta) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
85 log.debug("ManualPointsArtifact.initialize");
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
86 final List<Facet> fs = new ArrayList<>();
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
87
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
88 final DefaultState state = (DefaultState) getCurrentState(context);
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
89 state.computeInit(this, hash(), context, meta, fs);
3076
5642a83420f2 FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2206
diff changeset
90 if (!fs.isEmpty()) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
91 log.debug("Facets to add in ManualPointsArtifact.initialize .");
4497
a2735a4bf75e Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4478
diff changeset
92 addFacets(getCurrentStateId(), fs);
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
93 } else {
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
94 log.debug("No facets to add in ManualPointsArtifact.initialize (" + state.getID() + ").");
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
95 }
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
96 }
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
97
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
98 /**
3198
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
99 * Get value of line at index.
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
100 *
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
101 * @param index
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
102 * index in json array defining lines.
3198
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
103 * @return water height of line at given index.
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
104 */
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
105 private double getLine(final int index) {
3198
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
106 try {
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
107 final JSONArray lines = new JSONArray(getLinesData(null));
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
108 final JSONArray array = lines.getJSONArray(index);
3198
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
109
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
110 return array.getDouble(0);
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
111 }
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
112 catch (final JSONException e) {
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
113 log.error("Could not decode json for line.", e);
3198
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
114 return 0d;
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
115 }
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
116 }
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
117
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
118 /**
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
119 * Get the water line "surface".
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
120 *
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
121 * @param index
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
122 * index of facets data.
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
123 * @param csl
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
124 * 'ground' against which to determine water surface.
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
125 * @param a
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
126 * (ignored in this implementation).
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
127 * @param b
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
128 * (ignored in this implementation).
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
129 * @param context
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
130 * (ignored in this implementation).
3198
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
131 */
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
132 @Override
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
133 public double getWaterLevel(final ComputeType type, final String hash, final String stateId, final double currentKm, final Serializable waterLineIndex,
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
134 final double nextKm, final double prevKm, final CallContext context) {
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
135 final int index = (int) waterLineIndex;
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
136 return getLine(index);
3198
d35f28655fa6 Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
137 }
9425
3f49835a00c3 Extended CrossSectionFacet so it may fetch different data from within the artifact result.
gernotbelger
parents: 8856
diff changeset
138 }

http://dive4elements.wald.intevation.org