Mercurial > dive4elements > river
view artifacts/src/main/java/org/dive4elements/river/artifacts/AbstractFixBunduArtifact.java @ 9636:ac41551a8e4d
Bundu/Bzws: Error message for missing channel/year, Nachtrag Pos. 20: import of two levels of infrastructure types
author | mschaefer |
---|---|
date | Mon, 11 Nov 2019 16:29:36 +0100 |
parents | ce13a2f07290 |
children |
line wrap: on
line source
/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde * Software engineering by Intevation GmbH * * This file is Free Software under the GNU AGPL (>=v3) * and comes with ABSOLUTELY NO WARRANTY! Check out the * documentation coming with Dive4Elements River for details. */ package org.dive4elements.river.artifacts; import java.io.Serializable; import org.apache.log4j.Logger; import org.dive4elements.artifacts.CallContext; import org.dive4elements.river.artifacts.model.CalculationResult; import org.dive4elements.river.artifacts.model.WKms; import org.dive4elements.river.artifacts.model.fixings.FixRealizingResult; import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; /** * The default fixation analysis artifact. * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ public class AbstractFixBunduArtifact extends D4EArtifact implements WaterLineArtifact { private static final long serialVersionUID = 1L; /** The log for this class. */ private static Logger log = Logger.getLogger(AbstractFixBunduArtifact.class); /** * The default constructor. */ public AbstractFixBunduArtifact() { log.debug("ctor()"); } /** Calculate waterlines against a cross section. */ @Override public double getWaterLevel(final ComputeType type, final String hash, final String stateId, final double currentKm, final Serializable waterLineIndex, final double nextKm, final double prevKm, final CallContext context) { final FixRealizingResult result = (FixRealizingResult) ((CalculationResult) this.compute(context, ComputeType.ADVANCE, false)).getData(); final int wstIndex = (Integer) waterLineIndex; final WKms wkms = result.getWQKms()[wstIndex]; // Find W at km. final double wAtKm = StaticWKmsArtifact.getWAtKm(wkms, currentKm); if (wAtKm == -1 || Double.isNaN(wAtKm)) { log.warn("Waterlevel at km " + currentKm + " unknown."); return Double.NaN; } return wAtKm; } public String getCalculationModeString() { return null; // must be implemented in inheriting classes. cannot declare this class abstract } }