Mercurial > dive4elements > river
changeset 8393:47e96ce9bd79
If context contains pnp, transform W to m.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 08 Oct 2014 12:27:53 +0200 |
parents | 994995baa32b |
children | caba2157ed97 |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/model/HistoricalDischargeWQFacet.java |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/HistoricalDischargeWQFacet.java Wed Oct 08 11:49:07 2014 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/HistoricalDischargeWQFacet.java Wed Oct 08 12:27:53 2014 +0200 @@ -13,6 +13,7 @@ import org.dive4elements.artifacts.CallContext; import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; +import static org.dive4elements.river.exports.injector.InjectorConstants.PNP; /** * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> @@ -42,7 +43,11 @@ @Override public Object getData(Artifact artifact, CallContext context) { - return value; + double v = this.value; + if (context.getContextValue(PNP) instanceof Number) { + v = value/100 + ((Number)context.getContextValue(PNP)).doubleValue(); + } + return v; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :