Mercurial > dive4elements > river
changeset 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 | 853151285fb1 |
children | df65f24af5bc |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/model/HistoricalDischargeWQFacet.java |
diffstat | 1 files changed, 17 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/HistoricalDischargeWQFacet.java Mon Oct 20 18:26:15 2014 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/HistoricalDischargeWQFacet.java Tue Oct 21 12:14:39 2014 +0200 @@ -11,14 +11,21 @@ import org.dive4elements.artifactdatabase.state.Facet; import org.dive4elements.artifacts.Artifact; import org.dive4elements.artifacts.CallContext; +import org.dive4elements.river.artifacts.model.FacetTypes; import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; +import org.apache.log4j.Logger; + import static org.dive4elements.river.exports.injector.InjectorConstants.PNP; /** * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ -public class HistoricalDischargeWQFacet extends DataFacet { +public class HistoricalDischargeWQFacet +extends DataFacet +implements FacetTypes { + private static final Logger log = Logger + .getLogger(HistoricalDischargeWQFacet.class); private double value; @@ -44,8 +51,15 @@ @Override public Object getData(Artifact artifact, CallContext context) { double v = this.value; - if (context.getContextValue(PNP) instanceof Number) { - v = value/100 + ((Number)context.getContextValue(PNP)).doubleValue(); + if (HISTORICAL_DISCHARGE_WQ_W.equals(name)) { + if (context.getContextValue(PNP) instanceof Number) { + v = value/100 + + ((Number)context.getContextValue(PNP)).doubleValue(); + } + else { + log.error("Missing datum. Cannot calculate W value."); + return null; + } } return v; }