[PATCH] (issue1801) Remove indirection via RiverUtils for obtaining reference gauge

Wald Commits scm-commit at wald.intevation.org
Fri Jun 26 18:11:30 CEST 2015


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1435335087 -7200
# Node ID 2faf6cef6f5f1a415119d1690ec351da77bb048e
# Parent  d4caab3fedde88b2b6224c5a8a29aa409d8754cd
(issue1801) Remove indirection via RiverUtils for obtaining reference gauge.

diff -r d4caab3fedde -r 2faf6cef6f5f artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java	Fri Jun 26 16:23:32 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java	Fri Jun 26 18:11:27 2015 +0200
@@ -670,9 +670,14 @@
         int      size   = wqkms.size();
         double[] result = new double[3];
 
-        D4EArtifact flys       = (D4EArtifact) master;
+        D4EArtifact flys        = (D4EArtifact) master;
+        RangeAccess rangeAccess = new RangeAccess(flys);
+
         List<Gauge>  gauges     = RiverUtils.getGauges(flys);
-        Gauge        gauge      = RiverUtils.getGauge(flys);
+
+        Gauge gauge = rangeAccess.getRiver().determineRefGauge(
+            rangeAccess.getKmRange(), rangeAccess.isRange());
+
         String       gaugeName  = gauge.getName();
         String       desc       = "";
         String       notinrange = msg(
@@ -1006,8 +1011,12 @@
         int      size   = wqkms.size();
         double[] result = new double[3];
 
-        D4EArtifact flys       = (D4EArtifact) master;
-        Gauge        gauge      = RiverUtils.getGauge(flys);
+        D4EArtifact flys        = (D4EArtifact) master;
+        RangeAccess rangeAccess = new RangeAccess(flys);
+
+        Gauge gauge = rangeAccess.getRiver().determineRefGauge(
+            rangeAccess.getKmRange(), rangeAccess.isRange());
+
         String       gaugeName  = gauge.getName();
         String       desc       = "";
         String       notinrange = msg(


More information about the Dive4Elements-commits mailing list