Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/HistoricalDischargeWQFacet.java @ 8442:e65aad00b3a1
Do not transform Q values from cm to m.
author | "Tom Gottfried <tom@intevation.de>" |
---|---|
date | Tue, 21 Oct 2014 12:14:39 +0200 |
parents | 47e96ce9bd79 |
children | 0beb34d55630 |
comparison
equal
deleted
inserted
replaced
8441:853151285fb1 | 8442:e65aad00b3a1 |
---|---|
9 package org.dive4elements.river.artifacts.model; | 9 package org.dive4elements.river.artifacts.model; |
10 | 10 |
11 import org.dive4elements.artifactdatabase.state.Facet; | 11 import org.dive4elements.artifactdatabase.state.Facet; |
12 import org.dive4elements.artifacts.Artifact; | 12 import org.dive4elements.artifacts.Artifact; |
13 import org.dive4elements.artifacts.CallContext; | 13 import org.dive4elements.artifacts.CallContext; |
14 import org.dive4elements.river.artifacts.model.FacetTypes; | |
14 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; | 15 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; |
16 | |
17 import org.apache.log4j.Logger; | |
15 | 18 |
16 import static org.dive4elements.river.exports.injector.InjectorConstants.PNP; | 19 import static org.dive4elements.river.exports.injector.InjectorConstants.PNP; |
17 | 20 |
18 /** | 21 /** |
19 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 22 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
20 */ | 23 */ |
21 public class HistoricalDischargeWQFacet extends DataFacet { | 24 public class HistoricalDischargeWQFacet |
25 extends DataFacet | |
26 implements FacetTypes { | |
27 private static final Logger log = Logger | |
28 .getLogger(HistoricalDischargeWQFacet.class); | |
22 | 29 |
23 private double value; | 30 private double value; |
24 | 31 |
25 public HistoricalDischargeWQFacet() { | 32 public HistoricalDischargeWQFacet() { |
26 } | 33 } |
42 } | 49 } |
43 | 50 |
44 @Override | 51 @Override |
45 public Object getData(Artifact artifact, CallContext context) { | 52 public Object getData(Artifact artifact, CallContext context) { |
46 double v = this.value; | 53 double v = this.value; |
47 if (context.getContextValue(PNP) instanceof Number) { | 54 if (HISTORICAL_DISCHARGE_WQ_W.equals(name)) { |
48 v = value/100 + ((Number)context.getContextValue(PNP)).doubleValue(); | 55 if (context.getContextValue(PNP) instanceof Number) { |
56 v = value/100 + | |
57 ((Number)context.getContextValue(PNP)).doubleValue(); | |
58 } | |
59 else { | |
60 log.error("Missing datum. Cannot calculate W value."); | |
61 return null; | |
62 } | |
49 } | 63 } |
50 return v; | 64 return v; |
51 } | 65 } |
52 } | 66 } |
53 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : | 67 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |