changeset 9495:bb278c927b66

Datenkorb bezugswasserstände längsschnitte + minor fixes
author gernotbelger
date Tue, 25 Sep 2018 16:43:51 +0200
parents 879c902c4a2d
children d8e753d0fdb9
files artifacts/doc/conf/meta-data.xml artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstCalculation.java artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstCalculationResults.java artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstFixationFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstState.java artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BunduAccess.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWaterlevelFacet.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
diffstat 12 files changed, 145 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Mon Sep 24 18:01:10 2018 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Tue Sep 25 16:43:51 2018 +0200
@@ -142,10 +142,10 @@
                   <dc:when test="$out = 'sinfo_flood_height'">
                     <dc:call-macro name="annotations" />
                   </dc:when>
-                  <!--TODO sinfo_floodduration_curve: mainvalues wie in winfo-duration_curve unterstuetzen-->
+                  <!--TODO sinfo_floodduration_curve: mainvalues wie in winfo-duration_curve unterstuetzen -->
                   <!--dc:when test="$out = 'sinfo_floodduration_curve'">
                     <dc:call-macro name="mainvalues" />
-                  </dc:when-->
+                    </dc:when -->
                   <dc:when test="$out = 'uinfo_salix_line'">
                     <dc:call-macro name="annotations" />
                   </dc:when>
@@ -328,13 +328,13 @@
                   <dc:when test="$out = 'sinfo_flood_height'">
                     <dc:call-macro name="longitudinal-section-prototype" />
                   </dc:when>
-                  <!--TODO sinfo_floodduration_curve: mainvalues wie in winfo-duration_curve unterstuetzen-->
+                  <!--TODO sinfo_floodduration_curve: mainvalues wie in winfo-duration_curve unterstuetzen -->
                   <!--dc:when test="$out = 'sinfo_floodduration_curve'">
                     <dc:call-macro name="mainvalues" />
                     <dc:call-macro name="basedata_2_fixations_relative_point" />
                     <dc:call-macro name="basedata_4_heightmarks-points-relative_points" />
                     <dc:call-macro name="basedata_5_flood-protections_relative_points" />
-                  </dc:when-->
+                    </dc:when -->
 
                   <dc:when test="$out = 'uinfo_salix_line'">
                     <dc:call-macro name="longitudinal-section-prototype" />
@@ -348,8 +348,8 @@
                   </dc:when>
                   <dc:when test="$out = 'bundu_depth_longitudinal_section'">
                     <dc:call-macro name="longitudinal-section-prototype" />
-                  </dc:when>
-                </dc:choose>
+                  </dc:when> 
+                </dc:choose> 
               </dc:iterate>
             </dc:otherwise>
           </dc:choose>
@@ -465,6 +465,8 @@
                     <dc:when test="$out = 'bundu_depth_longitudinal_section'">
                       <dc:call-macro name="longitudinal-section-user-prototype" />
                     </dc:when>
+
+
                     <dc:comment> Discharge curves </dc:comment>
                     <dc:when test="$out = 'computed_discharge_curve'">
                       <dc:call-macro name="discharge-curve-user-prototype" />
@@ -1718,6 +1720,7 @@
         </sinfo_predefined_depthevol>
 
       </sinfo>
+    
     </dc:macro>
 
     <dc:macro name="longitudinal-section-user-prototype">
@@ -1742,9 +1745,12 @@
       <dc:call-macro name="bedquality" />
       <dc:call-macro name="flow-velocity" />
       <dc:call-macro name="sediment-load" />
-      
+
       <dc:comment> UINFO </dc:comment>
       <dc:call-macro name="uinfo_salix_line" />
+
+      <dc:comment> BUNDU </dc:comment>
+      <dc:call-macro name="bundu_bezugswst" />
     </dc:macro>
 
     <!-- porosities -->
@@ -3527,7 +3533,7 @@
         </dc:if>
       </dc:filter>
     </dc:macro>
-    
+
     <!-- channel size imported from CSV-files for S-INFO -->
     <dc:macro name="sinfo_predefined_channel">
       <dc:context>
@@ -3775,5 +3781,68 @@
       </dc:filter>
     </dc:macro>
 
+
+    <!-- U-INFO -->
+    <dc:macro name="bundu_bezugswst">
+      <dc:filter
+        expr="$a_state = 'state.bundu.wst' 
+       
+          and ($facet_name = 'longitudinal_section.w' 
+          or $facet_name = 'bundu_facet_bedheight' 
+          or $facet_name = 'bundu_facet_channelmin' 
+          or $facet_name = 'bundu_facet_bedheight_01' 
+          or $facet_name = 'bundu_facet_bedheight_02' 
+          or $facet_name = 'bundu_facet_bedheight_03' 
+          or $facet_name = 'bundu_facet_bedheight_04' 
+          or $facet_name = 'bundu_facet_bedheight_05' 
+          or $facet_name = 'bundu_facet_bedheight_06' 
+          or $facet_name = 'bundu_facet_bedheight_07' 
+          or $facet_name = 'bundu_facet_bedheight_08' 
+          or $facet_name = 'bundu_facet_bedheight_09' 
+          or $facet_name = 'bundu_facet_bedheight_10' 
+          or $facet_name = 'bundu_facet_bedheight_01' 
+          or $facet_name = 'bundu_facet_bedheight_01' 
+          or $facet_name = 'longitudinal_section.q' 
+          or $facet_name = 'longitudinal_section.area' 
+          or $facet_name = 'longitudinal_section.manualpoints' 
+            or $facet_name = 'bundu_facet_flowdepth.filtered' 
+            or $facet_name = 'bundu_facet_channeldepth' 
+            or $facet_name = 'bundu_facet_depth_01.filtered' 
+            or $facet_name = 'bundu_facet_depth_02.filtered' 
+            or $facet_name = 'bundu_facet_depth_03.filtered' 
+            or $facet_name = 'bundu_facet_depth_04.filtered' 
+            or $facet_name = 'bundu_facet_depth_05.filtered' 
+            or $facet_name = 'bundu_facet_depth_06.filtered' 
+            or $facet_name = 'bundu_facet_depth_07.filtered' 
+            or $facet_name = 'bundu_facet_depth_08.filtered' 
+            or $facet_name = 'bundu_facet_depth_09.filtered' 
+            or $facet_name = 'bundu_facet_depth_10.filtered'  
+            or $facet_name = 'longitudinal_section.area' 
+            or $facet_name = 'longitudinal_section.manualpoints' 
+            )" > 
+            
+        <dc:if test="dc:has-result()">
+          <bundu_bezugswsts>
+            <dc:call-macro name="collection-group">
+              <bundu_bezugswst description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="factory" value="bundu" />
+                    <dc:attribute name="target_out" value="${out}" />
+                    <dc:attribute name="description" value="${facet_description}" />
+                    <dc:attribute name="ids" value="${facet_num}" />
+                    <dc:attribute name="artifact-id" value="${a_gid}" />
+                    <dc:attribute name="out" value="${out_name}" />
+                  </dc:element>
+                </dc:for-each>
+              </bundu_bezugswst>
+            </dc:call-macro>
+          </bundu_bezugswsts>
+        </dc:if>
+      </dc:filter>
+    </dc:macro>
+
+
+
   </datacage>
 </dc:template>
\ No newline at end of file
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstCalculation.java	Mon Sep 24 18:01:10 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstCalculation.java	Tue Sep 25 16:43:51 2018 +0200
@@ -86,7 +86,8 @@
         this.missKmFrom = access.getMissingVolFrom();
         this.missKmTo = access.getMissingVolTo();
 
-        final BezugswstCalculationResults results = new BezugswstCalculationResults(calcModeLabel, user, riverInfo, access.getRange());
+        final BezugswstCalculationResults results = new BezugswstCalculationResults(calcModeLabel, user, riverInfo, access.getRange(),
+                access.isCalculateMissingVolume());
 
         final Calculation problems = new Calculation();
 
@@ -117,7 +118,7 @@
         }
 
         // Compute the missing volumes
-        if (access.isCalculateMissingValue()) {
+        if (access.isCalculateMissingVolume()) {
             if ((bedHeightsFinder == null) || bedHeightsFinder.isNull())
                 return new CalculationResult(results, problems);
             computeMissingVolumes(problems);
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstCalculationResults.java	Mon Sep 24 18:01:10 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstCalculationResults.java	Tue Sep 25 16:43:51 2018 +0200
@@ -22,8 +22,16 @@
 
     private static final long serialVersionUID = 1L;
 
-    public BezugswstCalculationResults(final String calcModeLabel, final String user, final RiverInfo river, final DoubleRange calcRange) {
+    private final boolean hasSounding;
+
+    public BezugswstCalculationResults(final String calcModeLabel, final String user, final RiverInfo river, final DoubleRange calcRange,
+            final boolean hasSounding) {
         super(calcModeLabel, user, river, calcRange);
+        this.hasSounding = hasSounding;
+    }
+
+    public boolean hasSounding() {
+        return this.hasSounding;
     }
 
 }
\ No newline at end of file
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstFixationFacet.java	Mon Sep 24 18:01:10 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstFixationFacet.java	Tue Sep 25 16:43:51 2018 +0200
@@ -11,6 +11,7 @@
 
 import java.util.List;
 
+import org.dive4elements.artifactdatabase.state.Facet;
 import org.dive4elements.river.artifacts.common.AbstractCalculationExportableResult;
 import org.dive4elements.river.artifacts.model.CalculationResult;
 import org.dive4elements.river.artifacts.model.WQKms;
@@ -19,6 +20,8 @@
 
 public class BezugswstFixationFacet extends FixWaterlevelFacet {
 
+    private static final long serialVersionUID = 1L;
+
     public BezugswstFixationFacet() {
     }
 
@@ -39,4 +42,14 @@
         return null;
     }
 
+    /** Copy deeply. */
+    @Override
+    public Facet deepCopy() {
+        final BezugswstFixationFacet copy = new BezugswstFixationFacet();
+        copy.set(this);
+        copy.type = this.type;
+        copy.hash = this.hash;
+        copy.stateId = this.stateId;
+        return copy;
+    }
 }
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstState.java	Mon Sep 24 18:01:10 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstState.java	Tue Sep 25 16:43:51 2018 +0200
@@ -89,19 +89,26 @@
 
         if (!resultList.isEmpty()) {
             final BezugswstMainCalculationResult result = (BezugswstMainCalculationResult) resultList.get(0);
-            facets.add(BezugswstHeightProcessor.createChannelminFacet(context, hash, this.id, facetIndex++, 0));
-            facets.add(BezugswstHeightProcessor.createBedheightFacet(context, hash, this.id, facetIndex++, 0, result.getBedHeightLabel()));
+
+            final boolean hasSounding = results.hasSounding();
+
             final String nameQ = result.getWstLabel();
             final String nameW = "W(" + nameQ + ")";
             facets.add(new BezugswstFixationFacet(0, LONGITUDINAL_W, nameW, ComputeType.ADVANCE, hash, this.id));
             facets.add(new BezugswstFixationFacet(0, LONGITUDINAL_Q, nameQ, ComputeType.ADVANCE, hash, this.id));
-            for (int i = BedHeightValueType.FIELD_FIRST_INDEX; i <= BedHeightValueType.FIELD_LAST_INDEX; i++)
-                facets.add(BezugswstHeightProcessor.createFieldBedheightFacet(context, hash, this.id, facetIndex++, 0, i));
 
-            facets.add(BezugswstDepthProcessor.createFlowdepthFilteredFacet(context, hash, this.id, facetIndex++, 0, result.getBedHeightLabel()));
-            facets.add(BezugswstDepthProcessor.createChanneldepthFacet(context, hash, this.id, facetIndex++, 0));
-            for (int i = BedHeightValueType.FIELD_FIRST_INDEX; i <= BedHeightValueType.FIELD_LAST_INDEX; i++)
-                facets.add(BezugswstDepthProcessor.createFieldDepthFacet(context, hash, this.id, facetIndex++, 0, i));
+            if (hasSounding) {
+                facets.add(BezugswstHeightProcessor.createChannelminFacet(context, hash, this.id, facetIndex++, 0));
+                facets.add(BezugswstHeightProcessor.createBedheightFacet(context, hash, this.id, facetIndex++, 0, result.getBedHeightLabel()));
+
+                for (int i = BedHeightValueType.FIELD_FIRST_INDEX; i <= BedHeightValueType.FIELD_LAST_INDEX; i++)
+                    facets.add(BezugswstHeightProcessor.createFieldBedheightFacet(context, hash, this.id, facetIndex++, 0, i));
+
+                facets.add(BezugswstDepthProcessor.createFlowdepthFilteredFacet(context, hash, this.id, facetIndex++, 0, result.getBedHeightLabel()));
+                facets.add(BezugswstDepthProcessor.createChanneldepthFacet(context, hash, this.id, facetIndex++, 0));
+                for (int i = BedHeightValueType.FIELD_FIRST_INDEX; i <= BedHeightValueType.FIELD_LAST_INDEX; i++)
+                    facets.add(BezugswstDepthProcessor.createFieldDepthFacet(context, hash, this.id, facetIndex++, 0, i));
+            }
 
             final Facet csv = new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id);
             final Facet pdf = new DataFacet(FacetTypes.PDF, "PDF data", ComputeType.ADVANCE, hash, this.id);
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BunduAccess.java	Mon Sep 24 18:01:10 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BunduAccess.java	Tue Sep 25 16:43:51 2018 +0200
@@ -72,20 +72,20 @@
     }
 
     public Double getMissingVolFrom() {
-        if (isCalculateMissingValue())
+        if (isCalculateMissingVolume())
             return getDouble("ld_from_part");
         else
             return null;
     }
 
     public Double getMissingVolTo() {
-        if (isCalculateMissingValue())
+        if (isCalculateMissingVolume())
             return getDouble("ld_to_part");
         else
             return null;
     }
 
-    public boolean isCalculateMissingValue() {
+    public boolean isCalculateMissingVolume() {
         return getBoolean("missing_volume");
     }
 
@@ -93,7 +93,7 @@
 
         final String data = getString("soundings");
 
-        if (data == null || !isCalculateMissingValue()) {
+        if (data == null || !isCalculateMissingVolume()) {
             log.warn("No 'soundings' parameter specified!");
             return null;
         } else {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWaterlevelFacet.java	Mon Sep 24 18:01:10 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWaterlevelFacet.java	Tue Sep 25 16:43:51 2018 +0200
@@ -9,51 +9,44 @@
 package org.dive4elements.river.artifacts.model.fixings;
 
 import org.dive4elements.artifactdatabase.state.Facet;
-
 import org.dive4elements.river.artifacts.model.CalculationResult;
 import org.dive4elements.river.artifacts.model.WQKms;
+import org.dive4elements.river.artifacts.model.WQKmsResult;
 import org.dive4elements.river.artifacts.model.WaterlevelFacet;
-
 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType;
 
 /** Waterlevel from fix realize compute. */
-public class FixWaterlevelFacet
-extends      WaterlevelFacet
-{
+public class FixWaterlevelFacet extends WaterlevelFacet {
     public FixWaterlevelFacet() {
     }
 
-    public FixWaterlevelFacet(int index, String name, String description) {
+    public FixWaterlevelFacet(final int index, final String name, final String description) {
         super(index, name, description, ComputeType.ADVANCE, null, null);
     }
 
-    public FixWaterlevelFacet(
-        int         index,
-        String      name,
-        String      description,
-        ComputeType type,
-        String      hash,
-        String      stateID
-    ) {
+    public FixWaterlevelFacet(final int index, final String name, final String description, final ComputeType type, final String hash, final String stateID) {
         // Note that in super, hash and stateID are on switched positions.
         // on super.super it is this way around again.
         super(index, name, description, type, stateID, hash);
     }
 
     @Override
-    protected WQKms [] getWQKms(CalculationResult res) {
-        FixRealizingResult fr = (FixRealizingResult)res.getData();
-        return fr != null ? fr.getWQKms() : null;
+    protected WQKms[] getWQKms(final CalculationResult res) {
+        if (res.getData() instanceof WQKmsResult) {
+            final WQKmsResult fr = (WQKmsResult) res.getData();
+            return fr != null ? fr.getWQKms() : null;
+        }
+        return null;
     }
 
     /** Copy deeply. */
     @Override
     public Facet deepCopy() {
-        FixWaterlevelFacet copy = new FixWaterlevelFacet();
+        final FixWaterlevelFacet copy = new FixWaterlevelFacet();
         copy.set(this);
-        copy.type    = type;
-        copy.hash    = hash;
-        copy.stateId = stateId;
+        copy.type = this.type;
+        copy.hash = this.hash;
+        copy.stateId = this.stateId;
         return copy;
     }
 }
--- a/artifacts/src/main/resources/messages.properties	Mon Sep 24 18:01:10 2018 +0200
+++ b/artifacts/src/main/resources/messages.properties	Tue Sep 25 16:43:51 2018 +0200
@@ -1324,13 +1324,13 @@
 bundu.wst.gauge_no_ud_calc_available = No calculation of DNE available.
 
 bundu.chart.wspl.section.title = REFWL-Longitudinal Section
-bundu_facet_bedheight.description = Mean Bed Height ({0}) 
+bundu_facet_bedheight.description = Mean Bed Height ({0})
 bundu_facet_channelmin.description = Bed (Target)
-bundu_facet_field_bedheight.description = Bed Height Field {0} 
+bundu_facet_field_bedheight.description = Bed Height Field {0}
 bundu.chart.depth.section.title = \u0394h-L\u00e4ngsschnitt
 bundu_facet_flowdepth.filtered.description = \u0394h (BZWS, {0})
 bundu_facet_channeldepth.description = \u0394h (Target depth)
-bundu_facet_field_depth.description = \u0394h Field {0} 
+bundu_facet_field_depth.description = \u0394h Field {0}
 bundu.channelfinder.empty = The database does not contain any values for the river and the reference year
 bundu.channelfinder.missing = no channel data available
 
--- a/artifacts/src/main/resources/messages_de.properties	Mon Sep 24 18:01:10 2018 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Tue Sep 25 16:43:51 2018 +0200
@@ -1324,13 +1324,13 @@
 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}) 
+bundu_facet_bedheight.description = Mittlere Sohlh\u00f6he ({0})
 bundu_facet_channelmin.description = Sohle (Sollzustand)
-bundu_facet_field_bedheight.description = Sohlh\u00f6he Feld {0} 
+bundu_facet_field_bedheight.description = Sohlh\u00f6he Feld {0}
 bundu.chart.depth.section.title = \u0394h-L\u00e4ngsschnitt
 bundu_facet_flowdepth.filtered.description = \u0394h (BZWS, {0})
 bundu_facet_channeldepth.description = \u0394h (Solltiefe)
-bundu_facet_field_depth.description = \u0394h Feld {0} 
+bundu_facet_field_depth.description = \u0394h Feld {0}
 bundu.channelfinder.empty = Die Datenbank enth\u00e4lt keine Fahrrinnedaten f\u00fcr das Gew\u00e4sser und das Bezugsjahr
 bundu.channelfinder.missing = keine Fahrrinnedaten vorhanden
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Mon Sep 24 18:01:10 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Tue Sep 25 16:43:51 2018 +0200
@@ -1616,4 +1616,6 @@
     String gauge_list_grid_end();
 
     String no_data_for_input();
+
+    String bundu_bezugswsts();
 }
\ No newline at end of file
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Mon Sep 24 18:01:10 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Tue Sep 25 16:43:51 2018 +0200
@@ -858,6 +858,7 @@
 bundu_ws_wq_info = The discharge values MNQ, MQ and MHQ are being calculated based on the daily discharge values.
 bundu_wspl_longitudinal_section = REFWL - Longitudinal Section
 bundu_depth_longitudinal_section = REFWL \u0394h - 
+bundu_bezugswsts = Reference Waterlevels
 
 chart_settings_export_metadata = Show Metadata
 export_csv_title = Title: 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Mon Sep 24 18:01:10 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Tue Sep 25 16:43:51 2018 +0200
@@ -858,6 +858,7 @@
 bundu_ws_wq_info = Die Abfl\u00fcsse MNQ, MQ und MHQ sind anhand der Tagesmittelwerte des Abflusses berechnet.
 bundu_wspl_longitudinal_section = BZWS - L\u00e4ngsschnitt
 bundu_depth_longitudinal_section = BZWS \u0394h - L\u00e4ngsschnitt
+bundu_bezugswsts = Bezugswasserst\u00e4nde
 
 chart_settings_export_metadata = Metadaten anzeigen
 export_csv_title = Titel: 

http://dive4elements.wald.intevation.org