changeset 8993:0adc6d04de95

SInfo - FlowDepthMinMax: choosing bed heights, not bed height min and max separately
author gernotbelger
date Wed, 11 Apr 2018 14:09:13 +0200
parents 2e27061d9a93
children 2bb38e25091b
files artifacts/doc/conf/artifacts/sinfo.xml artifacts/doc/conf/meta-data.xml artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxAccess.java artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxCalculation.java artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxCalculationResult.java artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxExporter.java artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxPairSelectState.java artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxState.java artifacts/src/main/resources/messages.properties artifacts/src/main/resources/messages_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/sinfo/FlowDepthMinMaxTwinPanel.java gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/FlowDepthTwinPanel.java gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/FlowDepthTwinPanelValidator.java
diffstat 14 files changed, 125 insertions(+), 184 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/artifacts/sinfo.xml	Fri Apr 06 11:55:36 2018 +0200
+++ b/artifacts/doc/conf/artifacts/sinfo.xml	Wed Apr 11 14:09:13 2018 +0200
@@ -95,14 +95,16 @@
 
     <transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
       <from state="state.sinfo.distance_only"/>
-      <!-- FIXME: need to distinguish between flow_depth and flow_depth_minmax -->
-      <!-- Insbesondere nur TL/KL -->
-      <to state="state.sinfo.waterlevel_soundings_select"/>
+      <to state="state.sinfo.waterlevel_soundings_minmax_select"/>
       <condition data="calculation_mode" value="sinfo_calc_flow_depth_minmax" operator="equal"/>
     </transition>
 
+    <state id="state.sinfo.waterlevel_soundings_minmax_select" description="state.sinfo.waterlevel_soundings_minmax_select" state="org.dive4elements.river.artifacts.sinfo.flowdepthminmax.FlowDepthMinMaxPairSelectState" helpText="help.state.sinfo.waterlevel_soundings_minmax_select">
+      <data name="diffids" type="String"/>
+    </state>
+
     <transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
-      <from state="state.sinfo.waterlevel_soundings_select"/>
+      <from state="state.sinfo.waterlevel_soundings_minmax_select"/>
       <to state="state.sinfo.flow_depth_minmax"/>
       <condition data="calculation_mode" value="sinfo_calc_flow_depth_minmax" operator="equal"/>
     </transition>
--- a/artifacts/doc/conf/meta-data.xml	Fri Apr 06 11:55:36 2018 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Wed Apr 11 14:09:13 2018 +0200
@@ -266,6 +266,13 @@
                     <dc:variable name="bedheight_count" expr="'bedh_height_count'"/>
                     <dc:call-macro name="bed-heights-single"/>
                   </dc:when>
+                  <dc:when test="$out = 'sinfo_flowdepthminmax_heights'">
+                    <!-- Selects bedheights that have min/max bedheights. According to BfG, it is safe to only assume min is present -->
+                    <dc:variable name="bed_height_type" expr="''"/>
+                    <dc:variable name="bed_height_descr_prefix" expr="''"/>
+                    <dc:variable name="bedheight_count" expr="'bedh_min_count'"/>
+                    <dc:call-macro name="bed-heights-single"/>
+                  </dc:when>
                   <dc:when test="$out = 'sinfo_flowdepth_waterlevels'">
                     <minfo>
                       <fixanalysis>
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxAccess.java	Fri Apr 06 11:55:36 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxAccess.java	Wed Apr 11 14:09:13 2018 +0200
@@ -10,10 +10,7 @@
 
 package org.dive4elements.river.artifacts.sinfo.flowdepthminmax;
 
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
 
 import org.apache.commons.lang.math.DoubleRange;
 import org.dive4elements.river.artifacts.access.RangeAccess;
@@ -31,33 +28,6 @@
  */
 final class FlowDepthMinMaxAccess extends RangeAccess {
 
-    public static class MinMaxIdPair {
-
-        private final String wstId;
-
-        private final String minSoundingId;
-
-        private final String maxSoundingId;
-
-        public MinMaxIdPair(final String wstId, final String minSoundingId, final String maxSoundingId) {
-            this.wstId = wstId;
-            this.minSoundingId = minSoundingId;
-            this.maxSoundingId = maxSoundingId;
-        }
-
-        public String getWstId() {
-            return this.wstId;
-        }
-
-        public String getMinSoundingId() {
-            return this.minSoundingId;
-        }
-
-        public String getMaxSoundingId() {
-            return this.maxSoundingId;
-        }
-    }
-
     private static final String FIELD_DIFFIDS = "diffids";
 
     public FlowDepthMinMaxAccess(final SINFOArtifact artifact) {
@@ -74,32 +44,8 @@
         return new DoubleRange(from, to);
     }
 
-    public Collection<MinMaxIdPair> getMinMaxPairs() {
-
+    public Collection<WstSoundingIdPair> getMinMaxPairs() {
         final String diffids = getString(FIELD_DIFFIDS);
-
-        /* fetch the raw configured pairs */
-        final List<WstSoundingIdPair> diffPairs = WstSoundingIdPair.parsePairs(diffids);
-
-        /* now sort eleemnts into pairs of TL/KL */
-        // FIXME: use sounding-ids to determine how pairs fit together
-        // or, let the ui already enforce it somehow
-
-        final List<MinMaxIdPair> minMaxPairs = new ArrayList<>(diffPairs.size());
-        // FIXME: at the moment, we simply pair by order
-        for (int i = 0; i < diffPairs.size(); i++) {
-
-            final WstSoundingIdPair minPair = diffPairs.get(i);
-
-            if (i < diffPairs.size() - 1) {
-                final WstSoundingIdPair maxPair = diffPairs.get(i + 1);
-                minMaxPairs.add(new MinMaxIdPair(minPair.getWstId(), minPair.getSoundingId(), maxPair.getSoundingId()));
-                i++;
-            } else {
-                minMaxPairs.add(new MinMaxIdPair(minPair.getWstId(), minPair.getSoundingId(), null));
-            }
-        }
-
-        return Collections.unmodifiableCollection(minMaxPairs);
+        return WstSoundingIdPair.parsePairs(diffids);
     }
 }
\ No newline at end of file
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxCalculation.java	Fri Apr 06 11:55:36 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxCalculation.java	Wed Apr 11 14:09:13 2018 +0200
@@ -23,7 +23,7 @@
 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultRow;
 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultType;
 import org.dive4elements.river.artifacts.sinfo.flowdepth.FlowDepthUtils;
-import org.dive4elements.river.artifacts.sinfo.flowdepthminmax.FlowDepthMinMaxAccess.MinMaxIdPair;
+import org.dive4elements.river.artifacts.sinfo.flowdepth.WstSoundingIdPair;
 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.DischargeValuesFinder;
 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.WaterlevelValuesFinder;
 import org.dive4elements.river.artifacts.sinfo.tkhstate.BedHeightsFinder;
@@ -55,7 +55,7 @@
         final River river = access.getRiver();
         final RiverInfo riverInfo = new RiverInfo(river);
 
-        final Collection<MinMaxIdPair> minMaxPairs = access.getMinMaxPairs();
+        final Collection<WstSoundingIdPair> minMaxPairs = access.getMinMaxPairs();
 
         final DoubleRange calcRange = access.getRange();
 
@@ -68,7 +68,7 @@
 
         final FlowDepthMinMaxCalculationResults results = new FlowDepthMinMaxCalculationResults(calcModeLabel, user, riverInfo, calcRange);
 
-        for (final MinMaxIdPair minMaxPair : minMaxPairs) {
+        for (final WstSoundingIdPair minMaxPair : minMaxPairs) {
             final FlowDepthMinMaxCalculationResult result = calculateResult(calcRange, minMaxPair, problems, infoProvider);
             results.addResult(result, problems);
         }
@@ -81,20 +81,16 @@
      *
      * @param infoProvider
      */
-    private FlowDepthMinMaxCalculationResult calculateResult(final DoubleRange calcRange, final MinMaxIdPair minMaxPair, final Calculation problems,
+    private FlowDepthMinMaxCalculationResult calculateResult(final DoubleRange calcRange, final WstSoundingIdPair minMaxPair, final Calculation problems,
             final RiverInfoProvider infoProvider) {
 
         /* access real input data from database */
         final String wstId = minMaxPair.getWstId();
 
-        // FIXME: bfg überzeugen dass man immer nur pärchen auswählen kann --> min/max id ist gleich!
+        final String soundingId = minMaxPair.getSoundingId();
 
-        final String minSoundingId = minMaxPair.getMinSoundingId();
-        final String maxSoundingId = minMaxPair.getMaxSoundingId();
-
-        final BedHeightsFinder minBedHeight = minSoundingId == null ? null : BedHeightsFinder.forId(this.context, minSoundingId, calcRange, problems);
-        final BedHeightsFinder maxBedHeight = maxSoundingId == null ? null : BedHeightsFinder.forId(this.context, maxSoundingId, calcRange, problems);
-        if (minBedHeight == null && maxBedHeight == null)
+        final BedHeightsFinder bedHeight = BedHeightsFinder.forId(this.context, soundingId, calcRange, problems);
+        if (bedHeight == null)
             return null;
 
         /* REMARK: fetch ALL wst kms, because we want to determine the original reference gauge */
@@ -102,11 +98,13 @@
         if (waterlevel == null)
             return null;
 
-        final String label = createLabel(waterlevel, minBedHeight, maxBedHeight);
+        final String label = createLabel(waterlevel, bedHeight);
 
         final WKms wstKms = waterlevel.getWkms();
 
-        final int soundingYear = checkSoundingYear(minBedHeight, maxBedHeight, problems);
+        final BedHeightInfo bedHeightInfo = bedHeight.getInfo();
+
+        final int soundingYear = bedHeightInfo.getYear();
         FlowDepthUtils.checkYearDifference(label, waterlevel.getYear(), soundingYear, problems);
 
         /* re-determine the reference gauge, in the same way as the WaterlevelArtifact would do it */
@@ -119,28 +117,24 @@
         final DischargeValuesFinder dischargeProvider = DischargeValuesFinder.fromKms(wstKms);
 
         final String waterlevelLabel = waterlevel.getName();
-        final String soundingLabel = buildSoundingLabel(minBedHeight, maxBedHeight);
+        final String soundingLabel = bedHeightInfo.getDescription();
 
         /* real calculation loop */
         final Collection<SInfoResultRow> rows = new ArrayList<>();
 
-        // FIXME: we use the stations of one of the bed heights atm, because we probably will later use only data from one bed heights datasets!
-        final Collection<Double> stations = minBedHeight == null ? maxBedHeight.getStations() : minBedHeight.getStations();
+        final Collection<Double> stations = bedHeight.getStations();
         for (final double station : stations) {
             if (calcRange.containsDouble(station)) {
 
                 final double wst = waterlevelProvider.getWaterlevel(station);
                 final double discharge = dischargeProvider.getDischarge(station);
 
-                final double minBedHeightValue = minBedHeight == null ? Double.NaN : minBedHeight.getMeanBedHeight(station);
-                final double maxBedHeightValue = maxBedHeight == null ? Double.NaN : maxBedHeight.getMeanBedHeight(station);
+                final double minBedHeightValue = bedHeight.getMinBedHeight(station);
+                final double maxBedHeightValue = bedHeight.getMaxBedHeight(station);
+                final double meanBedHeight = bedHeight.getMeanBedHeight(station);
 
-                final double minFlowDepth = wst - minBedHeightValue;
-                final double maxFlowDepth = wst - maxBedHeightValue;
-
-                // FIXME: unclear what is meant here...
-                // FIXME: this will simply the bed height of 'the' bed height if we reduce this to simply using one sounding dataset
-                final double meanBedHeight = Double.NaN;
+                final double minFlowDepth = wst - maxBedHeightValue;
+                final double maxFlowDepth = wst - minBedHeightValue;
 
                 // REMARK: access the location once only during calculation
                 final String location = riverInfoProvider.getLocation(station);
@@ -167,52 +161,14 @@
             }
         }
 
-        final BedHeightInfo minBedHeightInfo = minBedHeight == null ? null : minBedHeight.getInfo();
-        final BedHeightInfo maxBedHeightInfo = maxBedHeight == null ? null : maxBedHeight.getInfo();
-
-        return new FlowDepthMinMaxCalculationResult(label, wstInfo, minBedHeightInfo, maxBedHeightInfo, rows);
-    }
-
-    private String buildSoundingLabel(final BedHeightsFinder minBedHeight, final BedHeightsFinder maxBedHeight) {
-
-        if (minBedHeight == null)
-            return maxBedHeight.getInfo().getDescription();
-
-        if (maxBedHeight == null)
-            return minBedHeight.getInfo().getDescription();
-
-        return String.format("%s / %s", minBedHeight.getInfo().getDescription(), maxBedHeight.getInfo().getDescription());
+        return new FlowDepthMinMaxCalculationResult(label, wstInfo, bedHeightInfo, rows);
     }
 
-    private String createLabel(final WaterlevelData waterlevel, final BedHeightsFinder minBedHeight, final BedHeightsFinder maxBedHeight) {
-
-        final StringBuilder buffer = new StringBuilder(waterlevel.getName());
-
-        if (minBedHeight != null)
-            buffer.append(" - "). //
-            append(minBedHeight.getInfo().getDescription());
-
-        if (maxBedHeight != null)
-            buffer.append(" - "). //
-            append(maxBedHeight.getInfo().getDescription());
-
-        return buffer.toString();
-    }
+    private String createLabel(final WaterlevelData waterlevel, final BedHeightsFinder bedHeight) {
 
-    private int checkSoundingYear(final BedHeightsFinder minBedHeight, final BedHeightsFinder maxBedHeight, final Calculation problems) {
-
-        if (maxBedHeight == null)
-            return minBedHeight.getInfo().getYear();
-
-        if (minBedHeight == null)
-            return maxBedHeight.getInfo().getYear();
-
-        final int minYear = minBedHeight.getInfo().getYear();
-        final int maxYear = minBedHeight.getInfo().getYear();
-
-        if (minYear != maxYear)
-            problems.addProblem("sinfo.flowdepthminmaxcalculation.soundingyear.different");
-
-        return minYear;
+        return new StringBuilder(waterlevel.getName()). //
+                append(" - "). //
+                append(bedHeight.getInfo().getDescription()). //
+                toString();
     }
 }
\ No newline at end of file
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxCalculationResult.java	Fri Apr 06 11:55:36 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxCalculationResult.java	Wed Apr 11 14:09:13 2018 +0200
@@ -25,38 +25,16 @@
 
     private static final long serialVersionUID = 1L;
 
-    private final BedHeightInfo minSounding;
+    private final BedHeightInfo sounding;
 
-    private final BedHeightInfo maxSounding;
-
-    public FlowDepthMinMaxCalculationResult(final String label, final WstInfo wst, final BedHeightInfo minSounding, final BedHeightInfo maxSounding,
+    public FlowDepthMinMaxCalculationResult(final String label, final WstInfo wst, final BedHeightInfo sounding,
             final Collection<SInfoResultRow> rows) {
         super(label, wst, rows);
 
-        this.minSounding = minSounding;
-        this.maxSounding = maxSounding;
-    }
-
-    public BedHeightInfo getMinSounding() {
-        return this.minSounding;
-    }
-
-    public BedHeightInfo getMaxSounding() {
-        return this.maxSounding;
+        this.sounding = sounding;
     }
 
-    public BedHeightInfo getAnySounding() {
-        if (this.minSounding != null)
-            return this.minSounding;
-
-        return this.maxSounding;
-    }
-
-    public boolean hasMin() {
-        return this.minSounding != null;
-    }
-
-    public boolean hasMax() {
-        return this.maxSounding != null;
+    public BedHeightInfo getSounding() {
+        return this.sounding;
     }
 }
\ No newline at end of file
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxExporter.java	Fri Apr 06 11:55:36 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxExporter.java	Wed Apr 11 14:09:13 2018 +0200
@@ -45,7 +45,7 @@
     protected void writeCSVResultMetadata(final CSVWriter writer, final FlowDepthMinMaxCalculationResults results,
             final FlowDepthMinMaxCalculationResult result) {
 
-        final BedHeightInfo sounding = result.getAnySounding();
+        final BedHeightInfo sounding = result.getSounding();
         super.writeCSVSoundingMetadata(writer, sounding);
 
         final WstInfo wst = result.getWst();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxPairSelectState.java	Wed Apr 11 14:09:13 2018 +0200
@@ -0,0 +1,27 @@
+/** 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.sinfo.flowdepthminmax;
+
+import org.dive4elements.river.artifacts.sinfo.common.DatacagePairSelectState;
+
+/**
+ * @author Gernot Belger
+ *
+ */
+// FIXME: very ugly; but probably we will break the serialization of WaterlevelPairSelectState if we introduce an
+// abstraction
+public final class FlowDepthMinMaxPairSelectState extends DatacagePairSelectState {
+
+    private static final long serialVersionUID = 1L;
+
+    public FlowDepthMinMaxPairSelectState() {
+        super("sinfo_flowdepthminmax_twin_panel", "diffids");
+    }
+}
\ No newline at end of file
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxState.java	Fri Apr 06 11:55:36 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthminmax/FlowDepthMinMaxState.java	Wed Apr 11 14:09:13 2018 +0200
@@ -82,15 +82,10 @@
             final FlowDepthMinMaxCalculationResult result = resultList.get(index);
 
             /* filtered (zoom dependent mean) flow depth */
-            if (result.hasMin()) {
-                facets.add(FlowDepthProcessor.createFlowDepthMinFilteredFacet(context, hash, this.id, result, index));
-                facets.add(FlowDepthProcessor.createFlowDepthMinRawFacet(context, hash, this.id, result, index));
-            }
-
-            if (result.hasMax()) {
-                facets.add(FlowDepthProcessor.createFlowDepthMaxFilteredFacet(context, hash, this.id, result, index));
-                facets.add(FlowDepthProcessor.createFlowDepthMaxRawFacet(context, hash, this.id, result, index));
-            }
+            facets.add(FlowDepthProcessor.createFlowDepthMinFilteredFacet(context, hash, this.id, result, index));
+            facets.add(FlowDepthProcessor.createFlowDepthMinRawFacet(context, hash, this.id, result, index));
+            facets.add(FlowDepthProcessor.createFlowDepthMaxFilteredFacet(context, hash, this.id, result, index));
+            facets.add(FlowDepthProcessor.createFlowDepthMaxRawFacet(context, hash, this.id, result, index));
         }
 
         if (!resultList.isEmpty()) {
--- a/artifacts/src/main/resources/messages.properties	Fri Apr 06 11:55:36 2018 +0200
+++ b/artifacts/src/main/resources/messages.properties	Wed Apr 11 14:09:13 2018 +0200
@@ -810,6 +810,9 @@
 state.sinfo.waterlevel_soundings_select= Chosen Differences
 help.state.sinfo.waterlevel_soundings_select=${help.url}/OnlineHilfe/SINFO#help.state.sinfo.waterlevel_soundings_select
 
+state.sinfo.waterlevel_soundings_minmax_select= Chosen Differences
+help.state.sinfo.waterlevel_soundings_minmax_select=${help.url}/OnlineHilfe/SINFO#help.state.sinfo.waterlevel_soundings_minmax_select
+
 state.sinfo.use_transport_bodies=Transportk\u00f6rperh\u00f6hen
 help.state.sinfo.use_transport_bodies=${help.url}/OnlineHilfe/SINFO#help.state.sinfo.use_transport_bodies
 
@@ -936,8 +939,6 @@
 sinfo.facet.flow_depth_historical.filtered.description = h-historisch ({0})
 sinfo.facet.flow_depth_historical.raw.description = h-historisch ({0}) (raw)
 
-sinfo.flowdepthminmaxcalculation.soundingyear.different = Die Peiljahre von Talweg und Kammlage untersheiden sich
-
 sinfo.export.flow_depth_minmax.csv.header.min = Minimale Flie\u00dftiefe
 sinfo.export.flow_depth_minmax.csv.header.max = Maximale Flie\u00dftiefe
 
--- a/artifacts/src/main/resources/messages_de.properties	Fri Apr 06 11:55:36 2018 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Wed Apr 11 14:09:13 2018 +0200
@@ -810,6 +810,9 @@
 state.sinfo.waterlevel_soundings_select= Ausgew\u00e4hlte Differenzen
 help.state.sinfo.waterlevel_soundings_select=${help.url}/OnlineHilfe/SINFO#help.state.sinfo.waterlevel_soundings_select
 
+state.sinfo.waterlevel_soundings_minmax_select= Ausgew\u00e4hlte Differenzen
+help.state.sinfo.waterlevel_soundings_minmax_select=${help.url}/OnlineHilfe/SINFO#help.state.sinfo.waterlevel_soundings_minmax_select
+
 state.sinfo.use_transport_bodies=Transportk\u00f6rperh\u00f6hen
 help.state.sinfo.use_transport_bodies=${help.url}/OnlineHilfe/SINFO#help.state.sinfo.use_transport_bodies
 
@@ -936,8 +939,6 @@
 sinfo.facet.flow_depth_historical.filtered.description = h-historisch ({0})
 sinfo.facet.flow_depth_historical.raw.description = h-historisch ({0}) (Rohdaten)
 
-sinfo.flowdepthminmaxcalculation.soundingyear.different = Die Peiljahre von Talweg und Kammlage untersheiden sich
-
 sinfo.export.flow_depth_minmax.csv.header.min = Minimale Flie\u00dftiefe
 sinfo.export.flow_depth_minmax.csv.header.max = Maximale Flie\u00dftiefe
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProviderFactory.java	Fri Apr 06 11:55:36 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProviderFactory.java	Wed Apr 11 14:09:13 2018 +0200
@@ -22,6 +22,7 @@
 import org.dive4elements.river.client.client.ui.minfo.SedLoadEpochPanel;
 import org.dive4elements.river.client.client.ui.minfo.SedLoadPeriodPanel;
 import org.dive4elements.river.client.client.ui.minfo.SedLoadSQTiPanel;
+import org.dive4elements.river.client.client.ui.sinfo.FlowDepthMinMaxTwinPanel;
 import org.dive4elements.river.client.client.ui.sinfo.FlowDepthTwinPanel;
 import org.dive4elements.river.client.client.ui.sq.SQPeriodPanel;
 import org.dive4elements.river.client.shared.model.User;
@@ -199,6 +200,9 @@
         if ("sinfo_flowdepth_twin_panel".equals(uiProvider))
         	return new FlowDepthTwinPanel(user);
 
+        if ("sinfo_flowdepthminmax_twin_panel".equals(uiProvider))
+            return new FlowDepthMinMaxTwinPanel(user);
+        
         //GWT.log("Picked default provider.");
         return new SelectProvider();
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/FlowDepthMinMaxTwinPanel.java	Wed Apr 11 14:09:13 2018 +0200
@@ -0,0 +1,25 @@
+/** 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.client.client.ui.sinfo;
+
+import org.dive4elements.river.client.client.ui.DatacageTwinPanel;
+import org.dive4elements.river.client.client.ui.DefaultDatacageTwinPanelInfo;
+import org.dive4elements.river.client.client.ui.NilDatacageTwinPanelInfo;
+import org.dive4elements.river.client.shared.model.User;
+
+/**
+ * @author Gernot Belger
+ */
+public final class FlowDepthMinMaxTwinPanel extends DatacageTwinPanel {
+    public FlowDepthMinMaxTwinPanel(final User user) {
+        super(user, new FlowDepthTwinPanelValidator(), new NilDatacageTwinPanelInfo("sinfo_flowdepth_waterlevels"),
+                new DefaultDatacageTwinPanelInfo("bedheight", "sinfo_flowdepthminmax_heights"));
+    }
+}
\ No newline at end of file
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/FlowDepthTwinPanel.java	Fri Apr 06 11:55:36 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/FlowDepthTwinPanel.java	Wed Apr 11 14:09:13 2018 +0200
@@ -1,6 +1,6 @@
 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
- * Software engineering by 
- *  Björnsen Beratende Ingenieure GmbH 
+ * 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)
@@ -17,9 +17,9 @@
 /**
  * @author Gernot Belger
  */
-public class FlowDepthTwinPanel 
-extends DatacageTwinPanel {
-	public FlowDepthTwinPanel(final User user) {
-		super(user, new FlowDepthTwinPanelValidator(), new  NilDatacageTwinPanelInfo("sinfo_flowdepth_waterlevels"), new DefaultDatacageTwinPanelInfo("bedheight", "sinfo_flowdepth_minfo_heights") );
-	}
+public final class FlowDepthTwinPanel extends DatacageTwinPanel {
+    public FlowDepthTwinPanel(final User user) {
+        super(user, new FlowDepthTwinPanelValidator(), new NilDatacageTwinPanelInfo("sinfo_flowdepth_waterlevels"),
+                new DefaultDatacageTwinPanelInfo("bedheight", "sinfo_flowdepth_minfo_heights"));
+    }
 }
\ No newline at end of file
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/FlowDepthTwinPanelValidator.java	Fri Apr 06 11:55:36 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/FlowDepthTwinPanelValidator.java	Wed Apr 11 14:09:13 2018 +0200
@@ -1,6 +1,6 @@
 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
- * Software engineering by 
- *  Björnsen Beratende Ingenieure GmbH 
+ * 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)
@@ -16,24 +16,23 @@
 import org.dive4elements.river.client.client.ui.AbstractPairRecommendationPanel.IValidator;
 
 import com.smartgwt.client.widgets.grid.ListGrid;
-import com.smartgwt.client.widgets.grid.ListGridRecord;
 
 /**
  * Contains the old code from the validate-method of the DatacageTwinPanel.
- *  
+ *
  * @author Gernot Belger
  */
 final class FlowDepthTwinPanelValidator implements IValidator {
 
-	@Override
-	public List<String> validate(final ListGrid differencesList, final FLYSConstants msgProvider) {
+    @Override
+    public List<String> validate(final ListGrid differencesList, final FLYSConstants msgProvider) {
 
         final List<String> errors = new ArrayList<String>();
         if (differencesList.getRecords().length == 0) {
-        	// FIXME: waterlevel dependent! This will lead to a bad error message in English, for M-Info/Bed-Differences calculation
+            // FIXME: waterlevel dependent! This will lead to a bad error message in English, for M-Info/Bed-Differences calculation
             errors.add(msgProvider.sinfo_flowdepth_twinpanel_no_pair_selected());
         }
 
         return errors;
-	}
+    }
 }
\ No newline at end of file

http://dive4elements.wald.intevation.org