[PATCH] Remove misuse of method for determining gauge for a long range
Wald Commits
scm-commit at wald.intevation.org
Wed Apr 29 16:36:33 CEST 2015
# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1430318189 -7200
# Node ID 7f1fb07e4e3dc6686561e3ef6e5c7fad098b6522
# Parent 68827654ea7a3c0712d22cc8c0e092dab58427a1
Remove misuse of method for determining gauge for a long range.
diff -r 68827654ea7a -r 7f1fb07e4e3d artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java Wed Apr 29 14:13:57 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java Wed Apr 29 16:36:29 2015 +0200
@@ -13,6 +13,7 @@
import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
import org.dive4elements.river.artifacts.D4EArtifact;
+import org.dive4elements.river.artifacts.access.RiverAccess;
import org.dive4elements.river.artifacts.model.FacetTypes;
import org.dive4elements.river.artifacts.model.WQKms;
import org.dive4elements.river.exports.process.MiscDischargeProcessor;
@@ -25,7 +26,6 @@
import org.dive4elements.river.model.Gauge;
import org.dive4elements.river.model.River;
import org.dive4elements.river.themes.ThemeDocument;
-import org.dive4elements.river.utils.RiverUtils;
import org.dive4elements.artifactdatabase.state.State;
import org.dive4elements.river.artifacts.GaugeDischargeCurveArtifact;
@@ -84,8 +84,8 @@
public static double getCurrentGaugeDatum(double km, D4EArtifact artifact, double tolerance) {
// Look if there is a gauge at chosen km:
// Get gauge which is defined for km
- Gauge gauge =
- RiverUtils.getRiver(artifact).determineGauge(km-0.1d, km+0.1d);
+ Gauge gauge = new RiverAccess(artifact).getRiver()
+ .determineGaugeAtStation(km);
if (gauge == null) {
log.error("No Gauge could be found at station " + km + "!");
return 0d;
@@ -307,7 +307,7 @@
String gaugeName = wqkms.getName();
- River river = RiverUtils.getRiver(artifact);
+ River river = new RiverAccess(artifact).getRiver();
if (river == null) {
log.debug("no river found");
More information about the Dive4Elements-commits
mailing list