changeset 9292:e6958f0e72fa

bundu.bezugswst details
author gernotbelger
date Tue, 24 Jul 2018 15:30:10 +0200
parents 913bc7d1d2a8
children e3e465766cfe
files artifacts/doc/conf/artifacts/bundu.xml artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/CalcChoice.java artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/DistanceOnlyPartMissVolumeSelect.java artifacts/src/main/resources/messages.properties artifacts/src/main/resources/messages_de.properties gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProviderFactory.java gwt-client/src/main/java/org/dive4elements/river/client/client/ui/bundu/BunduWstCalcSelectRadioPanel.java gwt-client/src/main/java/org/dive4elements/river/client/client/ui/bundu/BunduWstWQPanel.java gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/BunduFixPeriodPanel.java gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java
diffstat 13 files changed, 99 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/artifacts/bundu.xml	Tue Jul 24 11:26:15 2018 +0200
+++ b/artifacts/doc/conf/artifacts/bundu.xml	Tue Jul 24 15:30:10 2018 +0200
@@ -390,9 +390,9 @@
     </transition>
 
     <state id="state.bundu.wst.qs" description="state.bundu.wst.qs" helpText="help.state.bundu.wst.qs" state="org.dive4elements.river.artifacts.bundu.bezugswst.BunduWstWQFixing">
-      <data name="bundu.wst.mode" type="String" /> 
+      <data name="bundu.wst.mode" type="String" />
       <data name="wq_values" type="WQTriple" />
-      <data name="bundu.wst.ud_value" type ="Integer"/>
+      <data name="bundu.wst.ud_value" type="Integer" />
     </state>
 
 
@@ -405,6 +405,7 @@
 
     <state id="state.bundu.wst.load.calc_choice" helpText="state.bundu.wst.load.calc_choice" description="state.bundu.wst.load.calc_choice" state="org.dive4elements.river.artifacts.bundu.bezugswst.CalcChoice">
       <data name="calc_choice" type="String" />
+      <data name="function" type="String" /> <!--  will be set, if auto is selected -->
     </state>
 
     <transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
@@ -416,7 +417,7 @@
 
     <transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
       <from state="state.bundu.wst.load.calc_choice" />
-      <to state="state.bundu.wst.load.function" />
+      <to state="state.bundu.wst.load.preprocessing" />
       <condition data="calc_choice" value="state.bundu.calc.auto" operator="equal" />
     </transition>
 
@@ -453,11 +454,11 @@
 
     <transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
       <from state="state.bundu.wst.load.missing_volume" />
-      <to state="state.bundu.load.distance_only_part" />
+       <to state="state.bundu.wst.soundings" />
       <condition data="missing_volume" value="false" operator="equal" />
     </transition>
 
-    <state id="state.bundu.load.distance_only_part" description="state.bundu.load.distance_only_part" state="org.dive4elements.river.artifacts.states.DistanceOnlyPartSelect" helpText="help.state.bundu.distance_only">
+    <state id="state.bundu.load.distance_only_part" description="state.bundu.load.distance_only_part" state="org.dive4elements.river.artifacts.bundu.bezugswst.DistanceOnlyPartMissVolumeSelect" helpText="help.state.bundu.distance_only">
       <data name="ld_from_part" type="Double" />
       <data name="ld_to_part" type="Double" />
     </state>
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/CalcChoice.java	Tue Jul 24 11:26:15 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/CalcChoice.java	Tue Jul 24 15:30:10 2018 +0200
@@ -27,7 +27,7 @@
 
     @Override
     protected final String getUIProvider() {
-        return "radio_panel";
+        return "bundu_calc_choice_radio_panel";
     }
 
     @Override
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/DistanceOnlyPartMissVolumeSelect.java	Tue Jul 24 15:30:10 2018 +0200
@@ -0,0 +1,23 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * 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.bundu.bezugswst;
+
+import org.dive4elements.artifacts.CallContext;
+import org.dive4elements.river.artifacts.resources.Resources;
+import org.dive4elements.river.artifacts.states.DistanceOnlyPartSelect;
+
+public class DistanceOnlyPartMissVolumeSelect extends DistanceOnlyPartSelect {
+
+    @Override
+    protected String getTitle(final CallContext context) {
+        // custom title, rest stays
+        return Resources.getMsg(context.getMeta(), "state.title.uinfo.bezugswst.miss_vol.distance_part_state");
+    }
+
+}
--- a/artifacts/src/main/resources/messages.properties	Tue Jul 24 11:26:15 2018 +0200
+++ b/artifacts/src/main/resources/messages.properties	Tue Jul 24 15:30:10 2018 +0200
@@ -1233,4 +1233,5 @@
 state.title.location_distance_state = Choose calculation location(s) / range [km] 
 state.title.distance_part_state = state.title.distance_part_state
 state.title.salix.historical.distance_part_state = Festlegen eines Teilabschnitts
+state.title.uinfo.bezugswst.miss_vol.distance_part_state = Strecke der zu ermittelnden Fehltiefen w\u00e4hlen [km]
 state.title.distance_only_inundationduration_state = Darstellungsbereich w\u00e4hlen [km]
\ No newline at end of file
--- a/artifacts/src/main/resources/messages_de.properties	Tue Jul 24 11:26:15 2018 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Tue Jul 24 15:30:10 2018 +0200
@@ -1074,7 +1074,7 @@
 scenarioType.option3 = Historische Betrachtung 
 help.state.uinfo.scenario_type=${help.url}/OnlineHilfe/UINFO#help.state.uinfo.scenario_type
 
-state.bundu.load.distance_only_part= Teilabschnitt
+state.bundu.load.distance_only_part= Berechnungsstrecke Fehltiefen
 state.uinfo.distance_only_part.historical= Teilabschnitt
 state.uinfo.distance_only_part.from_regional= Teilabschnitt 
 state.uinfo.distance_only_part = Teilabschnitt
@@ -1232,5 +1232,6 @@
 state.title.distance_state = Berechnungsstrecke w\u00e4hlen [km]
 state.title.location_distance_state = Berechnungsort(e) / strecke w\u00e4hlen [km] 
 state.title.distance_part_state = Festlegen eines Teilabschnitts
+state.title.uinfo.bezugswst.miss_vol.distance_part_state = Strecke der zu ermittelnden Fehltiefen w\u00e4hlen [km]
 state.title.salix.historical.distance_part_state = Festlegen eines Teilabschnitts
 state.title.distance_only_inundationduration_state = Darstellungsbereich w\u00e4hlen [km]
\ No newline at end of file
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Tue Jul 24 11:26:15 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Tue Jul 24 15:30:10 2018 +0200
@@ -1590,4 +1590,6 @@
     String bundu_bezugswst_mode_ud();
 
     String bundu_bezugswst_validation_range();
+
+    String missingInputs();
 }
\ No newline at end of file
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Tue Jul 24 11:26:15 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Tue Jul 24 15:30:10 2018 +0200
@@ -132,6 +132,7 @@
 toShouldNotBeNegative = Field 'to' has to contain a positive value.
 atLeastOneValue = You need to insert at least one value.
 missingInput = You need to enter a value.
+missingInputs = Sie m\u00fcssen Werte eingeben.
 too_many_values = Only one value allowed
 
 addPointsTooltip = Add manual points
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Tue Jul 24 11:26:15 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Tue Jul 24 15:30:10 2018 +0200
@@ -132,6 +132,7 @@
 toShouldNotBeNegative = Feld 'bis' muss einen positiven Wert enthalten.
 atLeastOneValue = Sie m\u00fcssen mindestens einen Wert eingeben.
 missingInput = Sie m\u00fcssen einen Wert eingeben.
+missingInputs = Sie m\u00fcssen Werte eingeben.
 too_many_values = Nur ein Eingabewert erlaubt
 
 addPointsTooltip = Manuelle Punkte hinzuf\u00fcgen
@@ -339,8 +340,8 @@
 error_validate_lower_range = Der untere Wert $1 muss gr\u00f6\u00dfer sein als $2.
 error_validate_upper_range = Der obere Wert $1 muss kleiner sein als $2.
 error_validate_positive = Der Wert $1 muss eine positive Zahl sein.
-error_empty_state = Es wurden nicht alle ben\u00d6tigten Daten eingegeben.
-error_invalid_double_value = Falsches Format f\u00fc eine Flie\u00dfkommazahl.
+error_empty_state = Es wurden nicht alle ben\u00f6tigten Daten eingegeben.
+error_invalid_double_value = Falsches Format f\u00fcr eine Flie\u00dfkommazahl.
 error_create_artifact = Fehler beim Erstellen eines neuen Projekts.
 error_describe_artifact = Fehler beim Laden der Parametrisierung.
 error_feed_data = Fehler beim Hinzuf\u00fcgen neuer Daten.
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProviderFactory.java	Tue Jul 24 11:26:15 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProviderFactory.java	Tue Jul 24 15:30:10 2018 +0200
@@ -9,6 +9,7 @@
 package org.dive4elements.river.client.client.ui;
 
 import org.dive4elements.river.client.client.FLYSConstants;
+import org.dive4elements.river.client.client.ui.bundu.BunduWstCalcSelectRadioPanel;
 import org.dive4elements.river.client.client.ui.bundu.BunduWstWQPanel;
 import org.dive4elements.river.client.client.ui.bundu.CustomFixationChoiceRadioPanel;
 import org.dive4elements.river.client.client.ui.bundu.QSeriesLengthPanel;
@@ -165,6 +166,8 @@
             return new ParameterMatrixPanel();
         } else if (uiProvider.equals("minfo.bed.year_epoch")) {// legacy
             return new RadioPanel();
+        } else if (uiProvider.equals("bundu_calc_choice_radio_panel")) {
+            return new BunduWstCalcSelectRadioPanel();
         } else if (uiProvider.equals("radio_panel")) {
             return new RadioPanel();
         } else if (uiProvider.equals("custom_fixation_radio_panel")) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/bundu/BunduWstCalcSelectRadioPanel.java	Tue Jul 24 15:30:10 2018 +0200
@@ -0,0 +1,39 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * 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.client.client.ui.bundu;
+
+import org.dive4elements.river.client.client.ui.RadioPanel;
+import org.dive4elements.river.client.shared.model.Data;
+import org.dive4elements.river.client.shared.model.DataItem;
+import org.dive4elements.river.client.shared.model.DefaultData;
+import org.dive4elements.river.client.shared.model.DefaultDataItem;
+
+public class BunduWstCalcSelectRadioPanel extends RadioPanel {
+
+    private static final long serialVersionUID = 3357071563224461043L;
+
+    @Override
+    protected Data[] getData() {
+        // if auto selected, additional custom data (function) has to be set. the rest is standard radioPanel behaviour
+        final String value = this.form.getValueAsString("selection");
+
+        final DataItem item = new DefaultDataItem("label_irrelevant", "description_irrelevant", value);
+        final DefaultData selection = new DefaultData(this.dataName, "label_no_effect", "description_no_effect", new DataItem[] { item });
+        if (value.equals("state.bundu.calc.auto")) {
+            final Data[] data = new Data[2];
+            data[0] = selection;
+            data[1] = new DefaultData("function", "label_no_effect", "description_no_effect",
+                    new DataItem[] { new DefaultDataItem("", "", org.dive4elements.river.client.client.ui.fixation.FixFunctionSelect.funcDesc.get("log")) });
+            return data;
+        } else {
+            return new Data[] { selection };
+        }
+    }
+
+}
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/bundu/BunduWstWQPanel.java	Tue Jul 24 11:26:15 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/bundu/BunduWstWQPanel.java	Tue Jul 24 15:30:10 2018 +0200
@@ -249,8 +249,13 @@
                 if (!this.udInputItem.validate()) {
                     errors.add(this.udInputItem.getRequiredMessage());
                 }
-                final int test = Integer.valueOf(this.udInputItem.getValueAsString());// irgendwie klappt die validator-validierung nur bei der eingabe von
-                                                                                      // ganzzahlen :-(
+                final String value = this.udInputItem.getValueAsString();
+                if (value == null || value.isEmpty()) {
+                    errors.add(this.MSG.missingInput());
+                    return errors;
+                }
+                Integer.valueOf(value);// irgendwie klappt die validator-validierung nur bei der eingabe von
+                                       // ganzzahlen :-(
             }
             catch (final NumberFormatException e) {
                 errors.add(this.MSG.error_invalid_integer());
@@ -274,7 +279,10 @@
             int idx = 0;
 
             final double[] values = dap.getInputValues();
-
+            if (values == null) {
+                errors.add(this.MSG.missingInputs());
+                return errors;
+            }
             final double[] good = new double[values.length];
 
             for (final double value : values) {
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/BunduFixPeriodPanel.java	Tue Jul 24 11:26:15 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/BunduFixPeriodPanel.java	Tue Jul 24 15:30:10 2018 +0200
@@ -172,7 +172,12 @@
         try {
             final int year = Integer.valueOf(this.inputItem.getValueAsString());
             if (year < 1000 || year > 9999) {
-                errors.add(this.MSG.wrongFormat() + "(" + this.MSG.common_input_hint_year() + ")");
+                final StringBuilder builder = new StringBuilder();
+                builder.append(this.MSG.wrongFormat())//
+                        .append(" (") //
+                        .append(this.MSG.common_input_hint_year())//
+                        .append(")");//
+                errors.add(builder.toString());
             }
         }
         catch (final NumberFormatException e) {
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java	Tue Jul 24 11:26:15 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java	Tue Jul 24 15:30:10 2018 +0200
@@ -28,7 +28,7 @@
 import com.smartgwt.client.widgets.layout.VLayout;
 
 public class FixFunctionSelect extends FixationPanel {
-    private static final Map<String, String> funcDesc = new HashMap<String, String>();
+    public static final Map<String, String> funcDesc = new HashMap<String, String>();
 
     static {
         funcDesc.put("log", "W(Q) = m*ln(Q + b)");

http://dive4elements.wald.intevation.org