changeset 9449:ba3ad54edbae

withFieldsOnly bundu.wst sounding
author gernotbelger
date Wed, 22 Aug 2018 14:07:39 +0200
parents d32b11d585cd
children 7e1fb8d0cb0d
files artifacts/doc/conf/artifacts/bundu.xml artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelect.java artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelectMultiple.java artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelectSingle.java artifacts/src/main/java/org/dive4elements/river/artifacts/states/SoundingsSelectSingleWithFieldsOnly.java artifacts/src/main/resources/messages.properties artifacts/src/main/resources/messages_de.properties
diffstat 7 files changed, 45 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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>
 
--- 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();
--- 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;
+    }
+
 }
--- 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;
+    }
+
 }
--- /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;
+    }
+
+}
--- 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
--- 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

http://dive4elements.wald.intevation.org