[PATCH] bundu bezugswst WQ-Input: UD disabled on global Error

Wald Commits scm-commit at wald.intevation.org
Tue Aug 28 17:05:31 CEST 2018


# HG changeset patch
# User gernotbelger
# Date 1535468725 -7200
# Node ID 7369d6ae3f87a7ed670b797b2550e8442e338b0d
# Parent  65f28328c9a32a359c0026e11114fa2876ef890c
bundu bezugswst WQ-Input: UD disabled on global Error

diff -r 65f28328c9a3 -r 7369d6ae3f87 artifacts/src/main/java/org/dive4elements/river/artifacts/services/DynamicMainValuesTimeRangeDeterminationService.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/DynamicMainValuesTimeRangeDeterminationService.java	Tue Aug 28 14:02:23 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/DynamicMainValuesTimeRangeDeterminationService.java	Tue Aug 28 17:05:25 2018 +0200
@@ -114,11 +114,17 @@
         // common Range and correct errorMsg
         final List<GaugeInfoResult.GaugeInfo> gaugeResultsSecondTurn = new ArrayList<>();
         for (final GaugeInfoResult.GaugeInfo gi : gaugeResults) {
-            gaugeResultsSecondTurn.add(new GaugeInfoResult.GaugeInfo(gi.errorMsg, gi.gauge, gi.startdate != null ? min : null,
-                    gi.enddate != null ? max : null));
+            gaugeResultsSecondTurn
+                    .add(new GaugeInfoResult.GaugeInfo(gi.errorMsg, gi.gauge, gi.startdate != null ? min : null, gi.enddate != null ? max : null));
         }
         if (globalErrorMsg.isEmpty() && (min.getTime() > max.getTime()))
             globalErrorMsg = getMsg(meta, "bundu.wst.gauge_timeranges_disjoint");
+
+        // add "cannot calculate UD" to globalErrorMsg
+        // Eine Berechnung der UD ist nicht möglich.
+        if (!globalErrorMsg.isEmpty())
+            globalErrorMsg = new StringBuilder().append(globalErrorMsg).append("\n").append(getMsg(meta, "bundu.wst.gauge_no_ud_calc_available")).toString();
+
         final GaugeInfoResult result = new GaugeInfoResult(gaugeResultsSecondTurn, globalErrorMsg);
 
         return result;
diff -r 65f28328c9a3 -r 7369d6ae3f87 artifacts/src/main/resources/messages.properties
--- a/artifacts/src/main/resources/messages.properties	Tue Aug 28 14:02:23 2018 +0200
+++ b/artifacts/src/main/resources/messages.properties	Tue Aug 28 17:05:25 2018 +0200
@@ -1310,6 +1310,7 @@
 bundu.wst.range_does_not_cover = Die Abflussganglinie ({0,number,#}-{1,number,#}) deckt nicht den Bezugszeitraum ab. 
 bundu.wst.error_reading_gauges = Fehler beim Abruf des Pegels aus der Datenbank.
 bundu.wst.gauge_timeranges_disjoint = Der Bezugszeitraum konnte nicht auf die vorhandenen Abflusswerte eingeschr\u00e4nkt werden. 
+bundu.wst.gauge_no_ud_calc_available = Eine Berechnung der UD ist nicht m\u00f6glich.
 
 bundu.chart.wspl.section.title = BZWS-L\u00e4ngsschnitt
 bundu_facet_bedheight.description = Mittlere Sohlh\u00f6he ({0}) 
diff -r 65f28328c9a3 -r 7369d6ae3f87 artifacts/src/main/resources/messages_de.properties
--- a/artifacts/src/main/resources/messages_de.properties	Tue Aug 28 14:02:23 2018 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Tue Aug 28 17:05:25 2018 +0200
@@ -1306,10 +1306,11 @@
 
 bundu.wst.export.csv.meta.header.bezugswst = Bezugswasserstand
 bundu.wst.export.pdf.meta.header.bezugswst = Bezugs-wasserstand
-bundu.wst_no_data_at_all = Es liegt keine Abflussganglinie vor ({0})
+bundu.wst_no_data_at_all = Es liegt keine Abflussganglinie vor ({0}). 
 bundu.wst.range_does_not_cover = Die Abflussganglinie ({0,number,#}-{1,number,#}) deckt nicht den Bezugszeitraum ab. 
 bundu.wst.error_reading_gauges = Fehler beim Abruf des Pegels aus der Datenbank.
 bundu.wst.gauge_timeranges_disjoint = Der Bezugszeitraum konnte nicht auf die vorhandenen Abflusswerte eingeschr\u00e4nkt werden. 
+bundu.wst.gauge_no_ud_calc_available = Eine Berechnung der UD ist nicht m\u00f6glich.
 
 bundu.chart.wspl.section.title = BZWS-L\u00e4ngsschnitt
 bundu_facet_bedheight.description = Mittlere Sohlh\u00f6he ({0}) 
diff -r 65f28328c9a3 -r 7369d6ae3f87 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/bundu/BunduWstWQPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/bundu/BunduWstWQPanel.java	Tue Aug 28 14:02:23 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/bundu/BunduWstWQPanel.java	Tue Aug 28 17:05:25 2018 +0200
@@ -171,6 +171,9 @@
                 }
             }
         });
+
+        this.radiogroup.setCanEdit(false);
+
         return this.modes;
     }
 
@@ -404,8 +407,6 @@
                     GWT.log("Could not recieve wq informations.");
                     final String msg = caught.getMessage();
                     resetLoadingMessageOfQTable(msg);
-                    // disable weiter-knopf
-                    getSubmitBtn().disable();
                     SC.warn(msg);
                 }
 
@@ -415,8 +416,6 @@
                     final String globalErrorMsg = result.getGlobalErrorMsg();
                     if (!globalErrorMsg.equals("")) {
                         resetLoadingMessageOfQTable("");
-                        // disable weiter-knopf
-                        getSubmitBtn().disable();
                         SC.warn(globalErrorMsg);
                     }
 
@@ -442,6 +441,8 @@
                             public void onFailure(final Throwable caught) {
                                 GWT.log("Could not recieve wq informations.");
                                 addWQInfo(null, fi, gauge);
+                                if (fi == gauges.length - 1)
+                                    getSubmitBtn().enable(); // always enable on success (globalerrorMsg is also success)
                             }
 
                             @Override
@@ -450,8 +451,13 @@
                                 GWT.log("Received " + num + " wq informations (" + fi + ".");
 
                                 addWQInfo(wqi, fi, gauge);
-                                if (fi == (gauges.length - 1) && globalErrorMsg.equals(""))
-                                    getSubmitBtn().enable();
+                                if (fi == gauges.length - 1) {
+                                    getSubmitBtn().enable(); // always enable on success (globalerrorMsg is also success)
+
+                                    if (globalErrorMsg.equals(""))
+                                        BunduWstWQPanel.this.radiogroup.setCanEdit(true);
+                                }
+
                             }
                         };
                         callMainValuesService(locale, river, range[0] + rDiff, range[1] - rDiff, gauge.getStartdate(), gauge.getEnddate(), cb);


More information about the Dive4Elements-commits mailing list