[PATCH] withFieldsOnly bundu.wst sounding

Wald Commits scm-commit at wald.intevation.org
Wed Aug 22 14:07:46 CEST 2018


# HG changeset patch
# User gernotbelger
# Date 1534939659 -7200
# Node ID ba3ad54edbae496d75772d3f1e5316dbc4f95087
# Parent  d32b11d585cd601fe85af41f230e6be9a33f7600
withFieldsOnly bundu.wst sounding

diff -r d32b11d585cd -r ba3ad54edbae artifacts/doc/conf/artifacts/bundu.xml
--- a/artifacts/doc/conf/artifacts/bundu.xml	Wed Aug 22 11:51:46 2018 +0200
+++ b/artifacts/doc/conf/artifacts/bundu.xml	Wed Aug 22 14:07:39 2018 +0200
@@ -491,7 +491,7 @@
       <condition data="calculation_mode" value="bundu_bezugswst" operator="equal"/>
     </transition>
 
-    <state id="state.bundu.wst.soundings" description="state.bundu.wst.soundings" state="org.dive4elements.river.artifacts.states.SoundingsSelectSingle" helpText="help.state.bundu.wst.soundings">
+    <state id="state.bundu.wst.soundings" description="state.bundu.wst.soundings" state="org.dive4elements.river.artifacts.states.SoundingsSelectSingleWithFieldsOnly" helpText="help.state.bundu.wst.soundings">
       <data name="soundings" type="multiattribute"/>
     </state>
 
diff -r d32b11d585cd -r ba3ad54edbae artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelect.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelect.java	Wed Aug 22 11:51:46 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelect.java	Wed Aug 22 14:07:39 2018 +0200
@@ -90,9 +90,11 @@
         return kvp.toArray(new KVP[kvp.size()]);
     }
 
+    protected abstract boolean withHeightFieldsOnly();
+
     private void appendSingles(final River river, final double kmLo, final double kmHi, final ElementCreator creator, final Element select,
             final CallContext context) {
-        final List<BedHeight> singles = BedHeight.getBedHeights(river, kmLo, kmHi);
+        final List<BedHeight> singles = BedHeight.getBedHeights(river, kmLo, kmHi, withHeightFieldsOnly());
 
         if (singles != null) {
             final int size = singles.size();
diff -r d32b11d585cd -r ba3ad54edbae artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelectMultiple.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelectMultiple.java	Wed Aug 22 11:51:46 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelectMultiple.java	Wed Aug 22 14:07:39 2018 +0200
@@ -21,4 +21,9 @@
         return "parameter-matrix-sounding-multiple";
     }
 
+    @Override
+    protected boolean withHeightFieldsOnly() {
+        return false;
+    }
+
 }
diff -r d32b11d585cd -r ba3ad54edbae artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelectSingle.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelectSingle.java	Wed Aug 22 11:51:46 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelectSingle.java	Wed Aug 22 14:07:39 2018 +0200
@@ -21,4 +21,9 @@
         return "parameter-matrix-sounding-single";
     }
 
+    @Override
+    protected boolean withHeightFieldsOnly() {
+        return false;
+    }
+
 }
diff -r d32b11d585cd -r ba3ad54edbae artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelectSingleWithFieldsOnly.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelectSingleWithFieldsOnly.java	Wed Aug 22 14:07:39 2018 +0200
@@ -0,0 +1,29 @@
+/** 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.states;
+
+/**
+ * @author Domenico Nardi Tironi
+ *
+ */
+public class SoundingsSelectSingleWithFieldsOnly extends SoundingsSelect {
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public String getUIProvider() {
+        return "parameter-matrix-sounding-single";
+    }
+
+    @Override
+    protected boolean withHeightFieldsOnly() {
+        return true;
+    }
+
+}
diff -r d32b11d585cd -r ba3ad54edbae artifacts/src/main/resources/messages.properties
--- a/artifacts/src/main/resources/messages.properties	Wed Aug 22 11:51:46 2018 +0200
+++ b/artifacts/src/main/resources/messages.properties	Wed Aug 22 14:07:39 2018 +0200
@@ -63,7 +63,7 @@
 state.minfo.bed.error.no_data_for_period = No data found for period: {0} - {1}.
 state.minfo.soundings = Choose Soundings
 state.uinfo.salix.historical.soundings=Wahl des historischen Zustands anhand einer Peilung
-state.bundu.wst.soundings = Choose Soundings
+state.bundu.wst.soundings = Choose Sounding
 state.minfo.sediment.load.location = Range
 state.minfo.sediment.load.year_epoch = Year/Epoch
 state.minfo.sediment.load.epochs = Epochs
diff -r d32b11d585cd -r ba3ad54edbae artifacts/src/main/resources/messages_de.properties
--- a/artifacts/src/main/resources/messages_de.properties	Wed Aug 22 11:51:46 2018 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Wed Aug 22 14:07:39 2018 +0200
@@ -63,7 +63,7 @@
 state.minfo.bed.error.no_data_for_period = F\u00fcr den Zeitraum {0} - {1} liegen keine Daten vor.
 state.minfo.soundings = Wahl der Peilungen
 state.uinfo.salix.historical.soundings=Wahl des historischen Zustands anhand einer Peilung
-state.bundu.wst.soundings = Wahl der Peilungen
+state.bundu.wst.soundings = Wahl der Peilung
 state.minfo.sediment.load.location = Berechnungsstrecke
 state.minfo.sediment.load.year_epoch = Jahr/Zeitraum
 state.minfo.sediment.load.epochs = Epochen


More information about the Dive4Elements-commits mailing list