Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/FlowVelocityMeasurementArtifact.java @ 4464:b66285ece774
For FlowV.-Artifacts, use given id, fetch data and display via facet and generator.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 09 Nov 2012 10:27:17 +0100 |
parents | bdf321802d3d |
children | cc6323401643 |
comparison
equal
deleted
inserted
replaced
4463:3395f8c6b030 | 4464:b66285ece774 |
---|---|
13 import de.intevation.artifacts.Artifact; | 13 import de.intevation.artifacts.Artifact; |
14 import de.intevation.artifacts.ArtifactFactory; | 14 import de.intevation.artifacts.ArtifactFactory; |
15 import de.intevation.artifacts.CallMeta; | 15 import de.intevation.artifacts.CallMeta; |
16 import de.intevation.artifacts.common.utils.XMLUtils; | 16 import de.intevation.artifacts.common.utils.XMLUtils; |
17 import de.intevation.flys.model.FlowVelocityMeasurement; | 17 import de.intevation.flys.model.FlowVelocityMeasurement; |
18 import de.intevation.flys.model.FlowVelocityMeasurementValue; | |
18 import de.intevation.flys.artifacts.model.minfo.FlowVelocityMeasurementFacet; | 19 import de.intevation.flys.artifacts.model.minfo.FlowVelocityMeasurementFacet; |
19 import de.intevation.flys.artifacts.model.minfo.FlowVelocityMeasurementFactory; | 20 import de.intevation.flys.artifacts.model.minfo.FlowVelocityMeasurementFactory; |
20 import de.intevation.flys.artifacts.states.StaticState; | 21 import de.intevation.flys.artifacts.states.StaticState; |
21 | 22 |
22 import de.intevation.flys.artifacts.model.FacetTypes; | 23 import de.intevation.flys.artifacts.model.FacetTypes; |
46 "state.flowvelocitymeasurement.static"; | 47 "state.flowvelocitymeasurement.static"; |
47 | 48 |
48 /** One and only state to be in. */ | 49 /** One and only state to be in. */ |
49 protected transient State state = null; | 50 protected transient State state = null; |
50 | 51 |
52 protected String DATA_NAME = "ID"; | |
51 | 53 |
52 /** | 54 /** |
53 * Trivial Constructor. | 55 * Trivial Constructor. |
54 */ | 56 */ |
55 public FlowVelocityMeasurementArtifact() { | 57 public FlowVelocityMeasurementArtifact() { |
104 String code = getDatacageIDValue(data); | 106 String code = getDatacageIDValue(data); |
105 | 107 |
106 if (code != null) { | 108 if (code != null) { |
107 // parse code, interact with factory, add real facets. | 109 // parse code, interact with factory, add real facets. |
108 // store relevant parts of code as data. | 110 // store relevant parts of code as data. |
111 Facet facet = new FlowVelocityMeasurementFacet( | |
112 FLOW_VELOCITY_MEASUREMENT, | |
113 "flowvelocity-name"); | |
114 | |
115 fs.add(facet); | |
116 facets.put(state.getID(), fs); | |
117 addStringData(DATA_NAME, code); | |
109 } | 118 } |
110 | |
111 Facet facet = new FlowVelocityMeasurementFacet( | |
112 FLOW_VELOCITY_MEASUREMENT, | |
113 "flowvelocity-name"); | |
114 | |
115 fs.add(facet); | |
116 facets.put(state.getID(), fs); | |
117 | 119 |
118 spawnState(); | 120 spawnState(); |
119 super.setup(identifier, factory, context, callMeta, data); | 121 super.setup(identifier, factory, context, callMeta, data); |
120 } | 122 } |
121 | 123 |
178 Object context, | 180 Object context, |
179 CallMeta meta) | 181 CallMeta meta) |
180 { | 182 { |
181 logger.debug("initialize"); | 183 logger.debug("initialize"); |
182 } | 184 } |
185 | |
186 | |
187 /** Get the db-unbound flow velocity measurement value with given | |
188 * id. */ | |
189 public FlowVelocityMeasurementValue.FastFlowVelocityMeasurementValue | |
190 getFlowVelocityMeasurementValue() | |
191 { | |
192 return FlowVelocityMeasurementFactory.getFlowVelocityMeasurement( | |
193 Integer.parseInt(getDataAsString(DATA_NAME))); | |
194 } | |
183 } | 195 } |
184 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : | 196 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |