Mercurial > dive4elements > river
view artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BunduAccess.java @ 9573:b9c87bbff6a4
mean bed height -> mean bed LEVEL
author | gernotbelger |
---|---|
date | Tue, 06 Nov 2018 10:56:22 +0100 |
parents | 967ca59cc11a |
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.bundu.bezugswst; import org.apache.log4j.Logger; import org.dive4elements.river.artifacts.D4EArtifact; import org.dive4elements.river.artifacts.access.FixAnalysisAccess; import org.dive4elements.river.artifacts.states.SoundingsSelect; public class BunduAccess extends FixAnalysisAccess { private static Logger log = Logger.getLogger(BunduAccess.class); public BunduAccess(final D4EArtifact artifact) { super(artifact); } public boolean isAutoSelect() { final String fixChoice = this.artifact.getDataAsString("fix_choice"); if (fixChoice != null && fixChoice.equals("state.bundu.wst.fix.auto")) { return true; } return false; } public Integer getBezugsJahr() { return this.artifact.getDataAsInteger("singleyear"); } public int[] getEventsTemp() { return getIntArray("events_temp"); } public int getQSeriesLength() { return this.artifact.getDataAsInteger("year_input_q_series"); } public int getStartYear() { return this.getBezugsJahr() - this.getQSeriesLength() + 1; } public Integer getUd() { if (getUd_Q_mode().equals("UD")) return getInteger("bundu.wst.ud_value"); return null; } @Override public double[] getQs() { if (getUd_Q_mode().equals("Q")) return super.getQs(); return null; } private String getUd_Q_mode() { return getString("bundu.wst.mode"); } public Double getMissingVolFrom() { if (isCalculateMissingVolume()) return getDouble("ld_from_part"); return null; } public Double getMissingVolTo() { if (isCalculateMissingVolume()) return getDouble("ld_to_part"); return null; } public boolean isCalculateMissingVolume() { return getBoolean("missing_volume"); } public Integer getBedHeightID() { final String data = getString("soundings"); if (data == null || !isCalculateMissingVolume()) { log.warn("No 'soundings' parameter specified!"); return null; } log.debug("getBedHeightIDs(): data=" + data); int singleID = 0; if (data.indexOf(SoundingsSelect.PREFIX_SINGLE) >= 0) { final String tmp = data.replace(SoundingsSelect.PREFIX_SINGLE, ""); try { singleID = Integer.parseInt(tmp); } catch (final NumberFormatException nfe) { log.warn("Cannot parse int from string: '" + tmp + "'"); } } return singleID; } }