[PATCH 2 of 2] Merge

Wald Commits scm-commit at wald.intevation.org
Thu Aug 2 17:48:12 CEST 2018


# HG changeset patch
# User gernotbelger
# Date 1533224840 -7200
# Node ID a773accce42513c6f5d88ceca092b11e715bae41
# Parent  1a4d2ce77423adf97602f6f869ce5e797b979e68
# Parent  6f7e92c16050aba3f48fcc15916a1be9365d4eb7
Merge

diff -r 1a4d2ce77423 -r a773accce425 artifacts/doc/conf/artifacts/uinfo.xml
--- a/artifacts/doc/conf/artifacts/uinfo.xml	Thu Aug 02 17:39:13 2018 +0200
+++ b/artifacts/doc/conf/artifacts/uinfo.xml	Thu Aug 02 17:47:20 2018 +0200
@@ -171,9 +171,13 @@
       <outputmodes>
         <outputmode name="uinfo_salix_line" description="output.uinfo_salix_line" mime-type="image/png" type="chart">
           <facets>
+            <facet name="uinfo_facet_salix_line.filtered" description="salix line, filtered by current zoom state" />
             <facet name="uinfo_facet_salix_line" description="salix line"/>
+            <facet name="uinfo_facet_salix_mnwmw.filtered" description="nmw-mw differences, filtered by current zoom state" />
             <facet name="uinfo_facet_salix_mnwmw" description="mnw-mw differences"/>
+            <facet name="uinfo_facet_salix_scenario.filtered" description="scenario salix line, filtered by current zoom state" />
             <facet name="uinfo_facet_salix_scenario" description="scenario salix line"/>
+            <facet name="uinfo_facet_salix_rank" description="salix ranks" />
           </facets>
         </outputmode>
 
diff -r 1a4d2ce77423 -r a773accce425 artifacts/doc/conf/seddb-db.xml
--- a/artifacts/doc/conf/seddb-db.xml	Thu Aug 02 17:39:13 2018 +0200
+++ b/artifacts/doc/conf/seddb-db.xml	Thu Aug 02 17:47:20 2018 +0200
@@ -5,7 +5,7 @@
     <password>seddb</password>
     <dialect>org.hibernate.dialect.PostgreSQLDialect</dialect>
     <driver>org.postgresql.Driver</driver>
-    <url>jdbc:postgresql://localhost:5432/seddb</url>
+    <url>jdbc:postgresql://localhost:63333/seddb2</url>
     <validation-query>select 1 from gewaesser</validation-query>
     <max-wait>30000</max-wait>
     <!--
diff -r 1a4d2ce77423 -r a773accce425 artifacts/doc/conf/themes.xml
--- a/artifacts/doc/conf/themes.xml	Thu Aug 02 17:39:13 2018 +0200
+++ b/artifacts/doc/conf/themes.xml	Thu Aug 02 17:47:20 2018 +0200
@@ -475,8 +475,12 @@
         <mapping from="sinfo_floodduration_curve.manualpoints" to="ManualPoints" />
         
         <mapping from="uinfo_facet_salix_line" to="UInfoSalixLine" />
+        <mapping from="uinfo_facet_salix_line.filtered" to="UInfoSalixLine" />
         <mapping from="uinfo_facet_salix_mnwmw" to="UInfoSalixMnwMw" />
+        <mapping from="uinfo_facet_salix_mnwmw.filtered" to="UInfoSalixMnwMw" />
         <mapping from="uinfo_facet_salix_scenario" to="UInfoSalixScenario" />
+        <mapping from="uinfo_facet_salix_scenario.filtered" to="UInfoSalixScenario" />
+        <mapping from="uinfo_facet_salix_rank" to="UInfoSalixRank" />
         
         <mapping from="uinfo_salix_line.manualpoints" to="ManualPoints" />
     </mappings>
diff -r 1a4d2ce77423 -r a773accce425 artifacts/doc/conf/themes/default.xml
--- a/artifacts/doc/conf/themes/default.xml	Thu Aug 02 17:39:13 2018 +0200
+++ b/artifacts/doc/conf/themes/default.xml	Thu Aug 02 17:47:20 2018 +0200
@@ -2937,4 +2937,16 @@
       <field name="linecolor" type="Color" display="Linienfarbe" default="0, 0, 0" />
     </fields>
   </theme>
+  <theme name="UInfoSalixRank">
+    <inherits>
+      <inherit from="Areas" />
+    </inherits>
+    <fields>
+      <field name="areashowbg" type="boolean" display="Hintergrund anzeigen" default="true" hints="hidden" />
+      <field name="areashowborder" type="boolean" display="Begrenzung" default="false" hints="hidden" />
+      <field name="areabordercolor" type="Color" default="0, 0, 0" display="Begrenzungslinienfarbe" hints="hidden" />
+      <field name="showarea" type="boolean" display="Flaeche anzeigen" default="true" hints="hidden" />
+      <field name="showarealabel" type="boolean" display="Flächenbeschriftung anzeigen" default="false" />
+    </fields>
+  </theme>
 </themegroup>
\ No newline at end of file
diff -r 1a4d2ce77423 -r a773accce425 artifacts/doc/conf/themes/second.xml
--- a/artifacts/doc/conf/themes/second.xml	Thu Aug 02 17:39:13 2018 +0200
+++ b/artifacts/doc/conf/themes/second.xml	Thu Aug 02 17:47:20 2018 +0200
@@ -2925,4 +2925,16 @@
       <field name="linecolor" type="Color" display="Linienfarbe" default="0, 0, 0" />
     </fields>
   </theme>
+  <theme name="UInfoSalixRank">
+    <inherits>
+      <inherit from="Areas" />
+    </inherits>
+    <fields>
+      <field name="areashowbg" type="boolean" display="Hintergrund anzeigen" default="true" hints="hidden" />
+      <field name="areashowborder" type="boolean" display="Begrenzung" default="false" hints="hidden" />
+      <field name="areabordercolor" type="Color" default="0, 0, 0" display="Begrenzungslinienfarbe" hints="hidden" />
+      <field name="showarea" type="boolean" display="Flaeche anzeigen" default="true" hints="hidden" />
+      <field name="showarealabel" type="boolean" display="Flächenbeschriftung anzeigen" default="false" />
+    </fields>
+  </theme>
 </themegroup>
\ No newline at end of file
diff -r 1a4d2ce77423 -r a773accce425 artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/UINFOArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/UINFOArtifact.java	Thu Aug 02 17:39:13 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/UINFOArtifact.java	Thu Aug 02 17:47:20 2018 +0200
@@ -50,7 +50,15 @@
 
                 final String name = facet.getName();
 
-                if (SalixLineProcessor.FACET_SALIX_SCENARIO.equals(name))
+                if (SalixLineProcessor.FACET_SALIX_LINE_RAW.equals(name))
+                    return Boolean.FALSE;
+                if (SalixLineProcessor.FACET_SALIX_MNWMW_RAW.equals(name))
+                    return Boolean.FALSE;
+                if (SalixLineProcessor.FACET_SALIX_RANK.equals(name))
+                    return Boolean.FALSE;
+                if (SalixLineProcessor.FACET_SALIX_SCENARIO_FILTERED.equals(name))
+                    return Boolean.FALSE;
+                if (SalixLineProcessor.FACET_SALIX_SCENARIO_RAW.equals(name))
                     return Boolean.FALSE;
 
                 return null;
diff -r 1a4d2ce77423 -r a773accce425 artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineCalculator.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineCalculator.java	Thu Aug 02 17:39:13 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineCalculator.java	Thu Aug 02 17:47:20 2018 +0200
@@ -49,6 +49,9 @@
     private final Map<Gauge, QPosition> gaugeMwPos;
     private final Map<Gauge, QPosition> gaugeMnwPos;
     private final Map<Gauge, QPosition> gaugeMhwPos;
+    private QPosition refGaugeMwPos;
+    private QPosition refGaugeMnwPos;
+    private QPosition refGaugeMhwPos;
 
     private Calculation problems;
 
@@ -96,6 +99,7 @@
         this.gaugeMwPos.clear();
         this.gaugeMnwPos.clear();
         this.gaugeMhwPos.clear();
+        boolean first = true;
         for (final Gauge gauge : this.riverInfoProvider.getGauges()) {
             this.gaugeMwPos.put(gauge, null);
             this.gaugeMnwPos.put(gauge, null);
@@ -109,24 +113,39 @@
                 else if (mv.getMainValue().getName().equalsIgnoreCase("mhq"))
                     this.gaugeMhwPos.put(gauge, this.wst.getQPosition(gaugeKm, mv.getValue().doubleValue()));
             }
+            if (first) {
+                this.refGaugeMwPos = this.gaugeMwPos.get(gauge);
+                this.refGaugeMnwPos = this.gaugeMnwPos.get(gauge);
+                this.refGaugeMhwPos = this.gaugeMhwPos.get(gauge);
+                first = false;
+            }
+        }
+        if (this.refGaugeMwPos == null)
+            this.problems.addProblem("uinfo_salix_calc.warning.missing_mq");
+        else {
+            if (this.refGaugeMhwPos == null)
+                this.problems.addProblem("uinfo_salix_calc.warning.missing_mhq");
+            if (this.refGaugeMnwPos == null)
+                this.problems.addProblem("uinfo_salix_calc.warning.missing_mnq");
         }
     }
 
     /**
      * Create a result row for a station and its gauge, and add w-q-values as selected
-     *
-     * @param rangeScenarios2
      */
     private ResultRow createRow(final double station, final NavigableMap<Double, List<Double>> rangeScenarios) {
 
         final ResultRow row = ResultRow.create();
+        row.putValue(GeneralResultType.station, station);
         // Find station's gauge
-        final Gauge gauge = this.riverInfoProvider.getGauge(station, true);
-        row.putValue(GeneralResultType.station, station);
+        // final Gauge gauge = this.riverInfoProvider.getGauge(station, true);
         // Interpolate mnw, mw, and mhw
-        final double mnw = interpolateW(station, this.gaugeMnwPos.get(gauge));
-        final double mw = interpolateW(station, this.gaugeMwPos.get(gauge));
-        final double mhw = interpolateW(station, this.gaugeMhwPos.get(gauge));
+        // final double mnw = interpolateW(station, this.gaugeMnwPos.get(gauge));
+        // final double mw = interpolateW(station, this.gaugeMwPos.get(gauge));
+        // final double mhw = interpolateW(station, this.gaugeMhwPos.get(gauge));
+        final double mnw = interpolateW(station, this.refGaugeMnwPos);
+        final double mw = interpolateW(station, this.refGaugeMwPos);
+        final double mhw = interpolateW(station, this.refGaugeMhwPos);
         row.putValue(SInfoResultType.waterlevel, mnw);
         row.putValue(SInfoResultType.waterlevel1, mw);
         row.putValue(SInfoResultType.waterlevel2, mhw);
@@ -155,7 +174,6 @@
     private double interpolateW(final double station, final QPosition qPosition) {
         if (qPosition != null)
             return this.wst.interpolateW(station, qPosition, this.problems);
-
         return Double.NaN;
     }
 
@@ -175,8 +193,6 @@
 
     /**
      * Gets the station-specific list of delta-ws of the active scenario, at least with one 0 item in any case
-     *
-     * @param rangeScenarios
      */
     private double[] getDeltaWs(final double station, final NavigableMap<Double, List<Double>> rangeScenarios) {
         final Entry<Double, List<Double>> stationScenarios = rangeScenarios.floorEntry(station);
diff -r 1a4d2ce77423 -r a773accce425 artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineProcessor.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineProcessor.java	Thu Aug 02 17:39:13 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineProcessor.java	Thu Aug 02 17:47:20 2018 +0200
@@ -20,7 +20,6 @@
 import org.dive4elements.river.artifacts.resources.Resources;
 import org.dive4elements.river.artifacts.uinfo.common.UInfoResultType;
 import org.dive4elements.river.exports.DiagramGenerator;
-import org.dive4elements.river.exports.process.WOutProcessor;
 import org.dive4elements.river.themes.ThemeDocument;
 
 /**
@@ -31,70 +30,132 @@
  */
 public final class SalixLineProcessor extends AbstractProcessor {
 
-    private static final String FACET_SALIX_LINE = "uinfo_facet_salix_line";
+    private static final String FACET_SALIX_LINE_FILTERED = "uinfo_facet_salix_line.filtered";
 
-    private static final String FACET_SALIX_LINE_DESCRIPTION = "uinfo_facet_salix_line.description";
+    private static final String FACET_SALIX_LINE_FILTERED_DESCRIPTION = "uinfo_facet_salix_line.filtered.description";
 
-    private static final String FACET_SALIX_MNWMW = "uinfo_facet_salix_mnwmw";
+    public static final String FACET_SALIX_LINE_RAW = "uinfo_facet_salix_line";
 
-    private static final String FACET_SALIX_MNWMW_DESCRIPTION = "uinfo_facet_salix_mnwmw.description";
+    private static final String FACET_SALIX_LINE_RAW_DESCRIPTION = "uinfo_facet_salix_line.raw.description";
 
-    public static final String FACET_SALIX_SCENARIO = "uinfo_facet_salix_scenario";
+    private static final String FACET_SALIX_MNWMW_FILTERED = "uinfo_facet_salix_mnwmw.filtered";
 
-    private static final String FACET_SALIX_SCENARIO_DESCRIPTION = "uinfo_facet_salix_scenario.description";
+    private static final String FACET_SALIX_MNWMW_FILTERED_DESCRIPTION = "uinfo_facet_salix_mnwmw.filtered.description";
+
+    public static final String FACET_SALIX_MNWMW_RAW = "uinfo_facet_salix_mnwmw";
+
+    private static final String FACET_SALIX_MNWMW_RAW_DESCRIPTION = "uinfo_facet_salix_mnwmw.raw.description";
+
+    public static final String FACET_SALIX_SCENARIO_FILTERED = "uinfo_facet_salix_scenario.filtered";
+
+    private static final String FACET_SALIX_SCENARIO_FILTERED_DESCRIPTION = "uinfo_facet_salix_scenario.filtered.description";
+
+    public static final String FACET_SALIX_SCENARIO_RAW = "uinfo_facet_salix_scenario";
+
+    private static final String FACET_SALIX_SCENARIO_RAW_DESCRIPTION = "uinfo_facet_salix_scenario.raw.description";
+
+    public static final String FACET_SALIX_RANK = "uinfo_facet_salix_rank";
+
+    private static final String FACET_SALIX_RANK_DESCRIPTION = "uinfo_facet_salix_rank.description";
+
+    private static final String I18N_AXIS_LABEL = "uinfo.chart.salix_line.section.yaxis.label";
 
     private static final Set<String> HANDLED_FACET_TYPES = new HashSet<>();
 
     static {
-        HANDLED_FACET_TYPES.add(FACET_SALIX_LINE);
-        HANDLED_FACET_TYPES.add(FACET_SALIX_MNWMW);
-        HANDLED_FACET_TYPES.add(FACET_SALIX_SCENARIO);
-    }
-
-    public static Facet createSalixLineFacet(final CallContext context, final String hash, final String id, final int facetIndex, final int resultIndex) {
-
-        final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_LINE_DESCRIPTION, FACET_SALIX_LINE_DESCRIPTION);
-        return new SalixLineResultFacet(facetIndex, resultIndex, FACET_SALIX_LINE, description, WOutProcessor.I18N_AXIS_LABEL, id, hash);
-    }
-
-    public static Facet createSalixMnwMwFacet(final CallContext context, final String hash, final String id, final int facetIndex, final int resultIndex) {
-
-        final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_MNWMW_DESCRIPTION, FACET_SALIX_MNWMW_DESCRIPTION);
-        return new SalixMnwMwResultFacet(facetIndex, resultIndex, FACET_SALIX_MNWMW, description, WOutProcessor.I18N_AXIS_LABEL, id, hash);
-    }
-
-    public static Facet createSalixScenarioFacet(final CallContext context, final String hash, final String id, final int dataIndex, final int resultIndex,
-            final int facetIndex, final String subLabel) {
-
-        final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_SCENARIO_DESCRIPTION, FACET_SALIX_SCENARIO_DESCRIPTION, subLabel);
-        return new SalixScenarioResultFacet(facetIndex, resultIndex, dataIndex, FACET_SALIX_SCENARIO, description, WOutProcessor.I18N_AXIS_LABEL, hash, id);
+        HANDLED_FACET_TYPES.add(FACET_SALIX_LINE_FILTERED);
+        HANDLED_FACET_TYPES.add(FACET_SALIX_LINE_RAW);
+        HANDLED_FACET_TYPES.add(FACET_SALIX_MNWMW_FILTERED);
+        HANDLED_FACET_TYPES.add(FACET_SALIX_MNWMW_RAW);
+        HANDLED_FACET_TYPES.add(FACET_SALIX_SCENARIO_FILTERED);
+        HANDLED_FACET_TYPES.add(FACET_SALIX_SCENARIO_RAW);
+        HANDLED_FACET_TYPES.add(FACET_SALIX_RANK);
     }
 
     public SalixLineProcessor() {
-        super(WOutProcessor.I18N_AXIS_LABEL, HANDLED_FACET_TYPES);
+        super(I18N_AXIS_LABEL, HANDLED_FACET_TYPES);
+    }
+
+    public static Facet createSalixLineFilteredFacet(final CallContext context, final String hash, final String id, final int facetIndex,
+            final int resultIndex) {
+
+        final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_LINE_FILTERED_DESCRIPTION, FACET_SALIX_LINE_FILTERED_DESCRIPTION);
+        return new SalixLineResultFacet(facetIndex, resultIndex, FACET_SALIX_LINE_FILTERED, description, I18N_AXIS_LABEL, id, hash);
+    }
+
+    public static Facet createSalixLineRawFacet(final CallContext context, final String hash, final String id, final int facetIndex, final int resultIndex) {
+
+        final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_LINE_RAW_DESCRIPTION, FACET_SALIX_LINE_RAW_DESCRIPTION);
+        return new SalixLineResultFacet(facetIndex, resultIndex, FACET_SALIX_LINE_RAW, description, I18N_AXIS_LABEL, id, hash);
+    }
+
+    public static Facet createSalixMnwMwFilteredFacet(final CallContext context, final String hash, final String id, final int facetIndex,
+            final int resultIndex) {
+
+        final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_MNWMW_FILTERED_DESCRIPTION, FACET_SALIX_MNWMW_FILTERED_DESCRIPTION);
+        return new SalixMnwMwResultFacet(facetIndex, resultIndex, FACET_SALIX_MNWMW_FILTERED, description, I18N_AXIS_LABEL, id, hash);
+    }
+
+    public static Facet createSalixMnwMwRawFacet(final CallContext context, final String hash, final String id, final int facetIndex, final int resultIndex) {
+
+        final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_MNWMW_RAW_DESCRIPTION, FACET_SALIX_MNWMW_RAW_DESCRIPTION);
+        return new SalixMnwMwResultFacet(facetIndex, resultIndex, FACET_SALIX_MNWMW_RAW, description, I18N_AXIS_LABEL, id, hash);
+    }
+
+    public static Facet createSalixScenarioFilteredFacet(final CallContext context, final String hash, final String id, final int dataIndex,
+            final int resultIndex, final int facetIndex, final String subLabel) {
+
+        final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_SCENARIO_FILTERED_DESCRIPTION,
+                FACET_SALIX_SCENARIO_FILTERED_DESCRIPTION, subLabel);
+        return new SalixScenarioResultFacet(facetIndex, resultIndex, dataIndex, FACET_SALIX_SCENARIO_FILTERED, description, I18N_AXIS_LABEL, hash, id);
+    }
+
+    public static Facet createSalixScenarioRawFacet(final CallContext context, final String hash, final String id, final int dataIndex, final int resultIndex,
+            final int facetIndex, final String subLabel) {
+
+        final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_SCENARIO_RAW_DESCRIPTION, FACET_SALIX_SCENARIO_RAW_DESCRIPTION, subLabel);
+        return new SalixScenarioResultFacet(facetIndex, resultIndex, dataIndex, FACET_SALIX_SCENARIO_RAW, description, I18N_AXIS_LABEL, hash, id);
+    }
+
+    public static Facet createSalixRankFacet(final CallContext context, final String hash, final String id, final int facetIndex, final int resultIndex) {
+
+        final String description = Resources.getMsg(context.getMeta(), FACET_SALIX_RANK_DESCRIPTION, FACET_SALIX_RANK_DESCRIPTION);
+        return new SalixRankResultFacet(facetIndex, resultIndex, FACET_SALIX_RANK, description, I18N_AXIS_LABEL, id, hash);
     }
 
     @Override
     protected String generateSeries(final DiagramGenerator generator, final ArtifactAndFacet bundle, final ThemeDocument theme, final boolean visible) {
 
         // log.debug("Processing facet: " + bundle.getFacetName());
-        final CallContext context = generator.getContext();
-        final SalixLineCalculationResult data = (SalixLineCalculationResult) bundle.getData(context);
 
-        if (bundle.getFacetName().equals(FACET_SALIX_LINE)) {
-            return buildSeriesForType(generator, bundle, theme, visible, UInfoResultType.salixline, GAP_DISTANCE);
-        }
-
-        if (bundle.getFacetName().equals(FACET_SALIX_MNWMW)) {
-            return buildSeriesForType(generator, bundle, theme, visible, UInfoResultType.salix_mw_mnw, GAP_DISTANCE);
-        }
-
-        if (bundle.getFacetName().equals(FACET_SALIX_SCENARIO)) {
+        if (bundle.getFacetName().equals(FACET_SALIX_SCENARIO_FILTERED) || bundle.getFacetName().equals(FACET_SALIX_SCENARIO_RAW)) {
+            final CallContext context = generator.getContext();
+            final SalixLineCalculationResult data = (SalixLineCalculationResult) bundle.getData(context);
             final int dataIndex = ((SalixScenarioResultFacet) bundle.getFacet()).getDataIndex();
             final double[][] scenarioPoints = data.getScenarioPoints(dataIndex);
             return buildSeriesForPoints(scenarioPoints, generator, bundle, theme, visible, GAP_DISTANCE);
         }
 
-        throw new UnsupportedOperationException();
+        if (bundle.getFacetName().equals(FACET_SALIX_RANK)) {
+            // TODO return buildSeriesForType(generator, bundle, theme, visible, UInfoResultType.salixline, GAP_DISTANCE);
+        }
+
+        return buildSeriesForType(generator, bundle, theme, visible, doGetType(bundle.getFacetName()), GAP_DISTANCE);
+    }
+
+    protected UInfoResultType doGetType(final String facetName) {
+
+        if (FACET_SALIX_LINE_FILTERED.contentEquals(facetName))
+            return UInfoResultType.salixline;
+        if (FACET_SALIX_LINE_RAW.contentEquals(facetName))
+            return UInfoResultType.salixline;
+
+        if (FACET_SALIX_MNWMW_FILTERED.contentEquals(facetName))
+            return UInfoResultType.salix_mw_mnw;
+        if (FACET_SALIX_MNWMW_RAW.contentEquals(facetName))
+            return UInfoResultType.salix_mw_mnw;
+
+        final String error = String.format("Unknown facet name: %s", facetName);
+        throw new UnsupportedOperationException(error);
     }
 }
\ No newline at end of file
diff -r 1a4d2ce77423 -r a773accce425 artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineState.java	Thu Aug 02 17:39:13 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineState.java	Thu Aug 02 17:47:20 2018 +0200
@@ -80,8 +80,11 @@
         int facetIndex = 0;
 
         if (!resultList.isEmpty()) {
-            facets.add(SalixLineProcessor.createSalixLineFacet(context, hash, this.id, facetIndex++, 0));
-            facets.add(SalixLineProcessor.createSalixMnwMwFacet(context, hash, this.id, facetIndex++, 0));
+            facets.add(SalixLineProcessor.createSalixLineFilteredFacet(context, hash, this.id, facetIndex++, 0));
+            facets.add(SalixLineProcessor.createSalixLineRawFacet(context, hash, this.id, facetIndex++, 0));
+            facets.add(SalixLineProcessor.createSalixMnwMwFilteredFacet(context, hash, this.id, facetIndex++, 0));
+            facets.add(SalixLineProcessor.createSalixMnwMwRawFacet(context, hash, this.id, facetIndex++, 0));
+            facets.add(SalixLineProcessor.createSalixRankFacet(context, hash, this.id, facetIndex++, 0));
 
             final SalixLineCalculationResult result = resultList.get(0);
 
@@ -90,7 +93,8 @@
                         result.getScenarioLabel(i));
                 // REMARK: using data index as facetIndex, as we know there is only one result of this type. Else we should just
                 // increment
-                facets.add(SalixLineProcessor.createSalixScenarioFacet(context, hash, this.id, i, 0, facetIndex++, sublabel));
+                facets.add(SalixLineProcessor.createSalixScenarioFilteredFacet(context, hash, this.id, i, 0, facetIndex++, sublabel));
+                facets.add(SalixLineProcessor.createSalixScenarioRawFacet(context, hash, this.id, i, 0, facetIndex++, sublabel));
             }
 
             final Facet csv = new DataFacet(FacetTypes.CSV, "CSV data", ComputeType.ADVANCE, hash, this.id);
diff -r 1a4d2ce77423 -r a773accce425 artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixRankResultFacet.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixRankResultFacet.java	Thu Aug 02 17:47:20 2018 +0200
@@ -0,0 +1,46 @@
+/* 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.uinfo.salix;
+
+import org.apache.log4j.Logger;
+import org.dive4elements.artifactdatabase.state.Facet;
+import org.dive4elements.river.artifacts.common.ResultFacet;
+import org.dive4elements.river.artifacts.states.DefaultState.ComputeType;
+
+/**
+ * Facet of the U-Info salix rank areas.
+ */
+public class SalixRankResultFacet extends ResultFacet {
+
+    private static final long serialVersionUID = 1L;
+
+    private static Logger log = Logger.getLogger(SalixRankResultFacet.class);
+
+    public SalixRankResultFacet() {
+        // required for clone operation deepCopy()
+    }
+
+    public SalixRankResultFacet(final int facetIndex, final int resultIndex, final String name, final String description, final String yAxisLabelKey,
+            final String stateId, final String hash) {
+        super(facetIndex, resultIndex, name, description, yAxisLabelKey, ComputeType.ADVANCE, stateId, hash);
+    }
+
+    /** Copy deeply. */
+    @Override
+    public Facet deepCopy() {
+        // FIXME: why not simply use the full constructor instead?
+        final SalixRankResultFacet copy = new SalixRankResultFacet();
+        // FIXME: why does DataFacet does not override set? Bad access to variables of parent!
+        copy.set(this);
+        copy.type = this.type;
+        copy.hash = this.hash;
+        copy.stateId = this.stateId;
+        return copy;
+    }
+}
\ No newline at end of file
diff -r 1a4d2ce77423 -r a773accce425 artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java
--- a/artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java	Thu Aug 02 17:39:13 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java	Thu Aug 02 17:47:20 2018 +0200
@@ -58,11 +58,12 @@
     }
 
     public static final double round(double x, double precision) {
+        // REMARK/FIXME: Gives 0 for NaN - is this intended?
         return Math.round(x * precision)/precision;
     }
 
     public static final double round(double x) {
-        return Math.round(x * DEFAULT_STEP_PRECISION)/DEFAULT_STEP_PRECISION;
+        return round(x, DEFAULT_STEP_PRECISION);
     }
 
     /**
diff -r 1a4d2ce77423 -r a773accce425 artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java
--- a/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java	Thu Aug 02 17:39:13 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java	Thu Aug 02 17:47:20 2018 +0200
@@ -386,6 +386,8 @@
     }
 
     public static double roundFlowDepth(final double value) {
+        if (Double.isNaN(value))
+            return Double.NaN;
         return Math.round(value * FLOWDEPTH_ROUND_MULT) / FLOWDEPTH_ROUND_MULT;
     }
 
@@ -394,6 +396,8 @@
     }
 
     public static double roundW(final double value) {
+        if (Double.isNaN(value))
+            return Double.NaN;
         return Math.round(value * W_ROUND_MULT) / W_ROUND_MULT;
     }
 
diff -r 1a4d2ce77423 -r a773accce425 artifacts/src/main/resources/messages.properties
--- a/artifacts/src/main/resources/messages.properties	Thu Aug 02 17:39:13 2018 +0200
+++ b/artifacts/src/main/resources/messages.properties	Thu Aug 02 17:47:20 2018 +0200
@@ -168,8 +168,8 @@
 scenario.scenario = Scenario
 
 floodplain.option = Use Floodplain?
-floodplain.active = Activ
-floodplain.inactive = Inactiv
+floodplain.active = Active
+floodplain.inactive = Inactive
 
 outlier.method.grubbs=Grubbs
 outlier.method.std-dev=Residual standard error
@@ -845,8 +845,8 @@
 help.state.sinfo.flow_depth_development = ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.flow_depth_development
 
 useTransportBodies.option = Transportk\u00f6rperh\u00f6hen miteinbeziehen?
-useTransportBodies.active = Activ
-useTransportBodies.inactive = Inactiv
+useTransportBodies.active = Active
+useTransportBodies.inactive = Inactive
 
 state.sinfo.flowdepthdevlopment_current_select = Aktuelles Differenzenpaar
 help.state.sinfo.flowdepthdevlopment_current_select = ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.flowdepthdevlopment_current_select
@@ -1084,8 +1084,8 @@
 state.uinfo.inundation.scenario = Werte f\u00fcr \u00c4nderung der Sohl- bzw. Mittelwasserlage eingeben
 state.uinfo.use_scenario=Szenariobetrachtung
 useScenario.option = Zus\u00e4tzlich Szenariobetrachtung miteinbeziehen?
-useScenario.active = Activ
-useScenario.inactive = Inactiv
+useScenario.active = Active
+useScenario.inactive = Inactive
 help.state.uinfo.use_scenario=${help.url}/OnlineHilfe/UINFO#help.state.uinfo.use_scenario
 
 state.uinfo.scenario_type = Szenariotyp
@@ -1139,15 +1139,24 @@
 uinfo.export.url.inundationduration.vegetation_scenario= Vegetationszonen Szenario ({0}, {1}cm)
 uinfo.export.url.inundationduration.scenario = \u00dcberflutungsdauer Szenario ({0}, {1}cm)
 uinfo.chart.salix_line.section.title = Salix-Linie (Fluss/Aue-Konnektivit\u00e4t) - L\u00e4ngsschnitt
+uinfo.chart.salix_line.section.yaxis.label = [m]
 uinfo_facet_salix_line = Salix-Linie
-uinfo_facet_salix_line.description = Salix-Linie
+uinfo_facet_salix_line.filtered.description = Salix-Linie
+uinfo_facet_salix_line.raw.description = Salix-Linie (Rohdaten)
 uinfo_facet_salix_mnwmw = (MW-MNW)x(-1)
-uinfo_facet_salix_mnwmw.description = (MW-MNW)x(-1)
+uinfo_facet_salix_mnwmw.filtered.description = (MW-MNW)x(-1)
+uinfo_facet_salix_mnwmw.raw.description = (MW-MNW)x(-1) (Rohdaten)
 uinfo_facet_salix_scenario = Salix-Linie Szenario, {0}
-uinfo_facet_salix_scenario.description = Salix-Linie Szenario, {0}
+uinfo_facet_salix_scenario.filtered.description = Salix-Linie Szenario, {0}
+uinfo_facet_salix_scenario.raw.description = Salix-Linie Szenario, {0} (Rohdaten)
 uinfo_salix_scenario_deltaw = \u0394MW={0}
 uinfo_salix_scenario_supraregional = \u00fcberregional
 uinfo_salix_scenario_historical = historisch
+uinfo_facet_salix_rank = Bewertungsschema
+uinfo_facet_salix_rank.description = Bewertungsschema
+uinfo_salix_calc.warning.missing_mq = MQ (MW) missing at reference gauge, no calculation possible 
+uinfo_salix_calc.warning.missing_mhq = MHQ (MHW) missing at reference gauge, no salix calculation possible 
+uinfo_salix_calc.warning.missing_mnq = MNQ (MNW) missing at reference gauge, no (MW-MNW) calculation possible 
 
 predefineddepthevol.total.title = Gesamt: {0}
 predefineddepthevol.peryear.title = J\u00e4hrlich: {0}
diff -r 1a4d2ce77423 -r a773accce425 artifacts/src/main/resources/messages_de.properties
--- a/artifacts/src/main/resources/messages_de.properties	Thu Aug 02 17:39:13 2018 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Thu Aug 02 17:47:20 2018 +0200
@@ -1139,15 +1139,24 @@
 uinfo.export.url.inundationduration.vegetation_scenario= Vegetationszonen Szenario ({0}, {1}cm)
 uinfo.export.url.inundationduration.scenario = \u00dcberflutungsdauer Szenario ({0}, {1}cm)
 uinfo.chart.salix_line.section.title = Salix-Linie (Fluss/Aue-Konnektivit\u00e4t) - L\u00e4ngsschnitt
+uinfo.chart.salix_line.section.yaxis.label = [m]
 uinfo_facet_salix_line = Salix-Linie
-uinfo_facet_salix_line.description = Salix-Linie
+uinfo_facet_salix_line.filtered.description = Salix-Linie
+uinfo_facet_salix_line.raw.description = Salix-Linie (Rohdaten)
 uinfo_facet_salix_mnwmw = (MW-MNW)x(-1)
-uinfo_facet_salix_mnwmw.description = (MW-MNW)x(-1)
+uinfo_facet_salix_mnwmw.filtered.description = (MW-MNW)x(-1)
+uinfo_facet_salix_mnwmw.raw.description = (MW-MNW)x(-1) (Rohdaten)
 uinfo_facet_salix_scenario = Salix-Linie Szenario, {0}
-uinfo_facet_salix_scenario.description = Salix-Linie Szenario, {0}
+uinfo_facet_salix_scenario.filtered.description = Salix-Linie Szenario, {0}
+uinfo_facet_salix_scenario.raw.description = Salix-Linie Szenario, {0} (Rohdaten)
 uinfo_salix_scenario_deltaw = \u0394MW={0}
 uinfo_salix_scenario_supraregional = \u00fcberregional
 uinfo_salix_scenario_historical = historisch
+uinfo_facet_salix_rank = Bewertungsschema
+uinfo_facet_salix_rank.description = Bewertungsschema
+uinfo_salix_calc.warning.missing_mq = MQ (MW) fehlt am Bezugspegel, Berechnung nicht m\u00fglich 
+uinfo_salix_calc.warning.missing_mhq = MHQ (MHW) fehlt am Bezugspegel, Berechnung der Salix-Linie nicht m\u00fglich 
+uinfo_salix_calc.warning.missing_mnq = MNQ (MNW) fehlt am Bezugspegel, Berechnung von (MW-MNW) nicht m\u00fglich 
 
 predefineddepthevol.total.title = Gesamt: {0}
 predefineddepthevol.peryear.title = J\u00e4hrlich: {0}
@@ -1273,6 +1282,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.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.salix.historical.distance_part_state = Festlegen eines Teilabschnitts
 state.title.distance_only_inundationduration_state = Darstellungsbereich w\u00e4hlen [km]
\ No newline at end of file


More information about the Dive4Elements-commits mailing list