[Dive4elements-commits] [PATCH 06 of 10] MainValuesArtifact: For hist. W/Q diagram mainvalues, get location from gauge

Wald Commits scm-commit at wald.intevation.org
Fri Mar 22 09:08:47 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1363939792 -3600
# Node ID 92c07d5c433c75f7097f32ea542ff60d28eafd69
# Parent  2a5d7f9f268f756916981f9ebb4542c2571ef59c
MainValuesArtifact: For hist. W/Q diagram mainvalues, get location from gauge.

diff -r 2a5d7f9f268f -r 92c07d5c433c flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java	Fri Mar 22 09:08:04 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java	Fri Mar 22 09:09:52 2013 +0100
@@ -204,6 +204,20 @@
             logger.error("No location for mainvalues given.");
         }
         importData(winfo, "river");
+        // In the case of DischargeWQCurves, there are no locations, but a gauge.
+        if (getDataAsString("ld_locations") == null) {
+            // TODO its a tad difficult to remodel Range/Gauge-Access to
+            // do this.
+            String refGaugeID = winfo.getDataAsString("reference_gauge");
+            if (refGaugeID != null) {
+                Gauge g = Gauge.getGaugeByOfficialNumber(Integer.parseInt(refGaugeID));
+                addData("ld_locations", new DefaultStateData("ld_locations", null, null,
+                    String.valueOf(g.getStation())));
+            }
+            else {
+                logger.error("MainValuesArtifact: No location/gauge.");
+            }
+        }
     }
 
 


More information about the Dive4elements-commits mailing list