Mercurial > dive4elements > river
view artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepth/FlowDepthUtils.java @ 9365:ba1e2e8f05d1
sinfo.flowdepth Results.isShowRefGauge==false->spalte ausblenden; result.isShowRefGauge==false&&results.isShowRefGauge==true->result.refGauge=""
author | gernotbelger |
---|---|
date | Thu, 02 Aug 2018 15:02:27 +0200 |
parents | b194fa64506a |
children | 8ae7137b67d7 |
line wrap: on
line source
/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde * Software engineering by * Björnsen Beratende Ingenieure GmbH * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt * * 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.sinfo.flowdepth; import org.dive4elements.river.artifacts.model.Calculation; /** * @author Gernot Belger */ public final class FlowDepthUtils { private FlowDepthUtils() { throw new UnsupportedOperationException(); } /** * Checks the year difference between waterlevels and sounding, and issues a warning if too big. * * Zeitraum Zeitliche Differenz [a] * X ≥ 1998 ± 3 * 1958 ≤ X < 1998 ± 6 * 1918 ≤ X < 1958 ± 12 * X < 1918 ± 25 */ public static void checkYearDifference(final String label, final int wstYear, final int soundingYear, final Calculation problems) { if (wstYear < 0) return; final int maxDifference = getMaxDifferenceYears(soundingYear); final int difference = Math.abs(soundingYear - wstYear); if (difference > maxDifference) problems.addProblem("sinfo_calc_flow_depth.warning.year_difference", label, Integer.toString(wstYear), Integer.toString(soundingYear)); } public static int getMaxDifferenceYears(final int year) { if (year < 1918) return 25; if (1918 <= year && year < 1958) return 12; if (1958 <= year && year < 1998) return 6; /* >= 1998 */ return 3; } }