[PATCH] Small fixes of the S-Info flood duration outputs

Wald Commits scm-commit at wald.intevation.org
Wed Jul 25 10:12:46 CEST 2018


# HG changeset patch
# User mschaefer
# Date 1532506347 -7200
# Node ID 7100a555607c9800782ee081c3bce7b03be6f13d
# Parent  77f24792d75f7fd03d552d3ad12a080db6e17d19
Small fixes of the S-Info flood duration outputs

diff -r 77f24792d75f -r 7100a555607c artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculationResult.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculationResult.java	Tue Jul 24 18:52:40 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculationResult.java	Wed Jul 25 10:12:27 2018 +0200
@@ -146,7 +146,7 @@
         header.add(exportContextCSV.formatCsvHeader(SInfoResultType.riverside));
         header.add(exportContextCSV.formatCsvHeader(SInfoResultType.floodDuration));
         header.add(exportContextCSV.msgUnitCSV(SInfoResultType.floodDischarge, SInfoResultType.floodDischarge.getUnit()));
-        header.add(exportContextCSV.msgUnitCSV(SInfoResultType.infrastructureHeight, SInfoResultType.infrastructureHeight.getUnit()));
+        header.add(exportContextCSV.msgUnitCSV(SInfoResultType.infrastructureHeight, river.getWstUnit()));
         header.add(exportContextCSV.formatCsvHeader(SInfoResultType.infrastructuretype));
 
         // add dynamic headers
@@ -154,7 +154,7 @@
                 getWaterlevelCount();
         for (int i = 0; i < waterlevelCount; i++) {
             final String appendIndex = "_" + Integer.toString(i + 1);
-            header.add(exportContextCSV.msg(DurationWaterlevel.getHeaderWCsv(), appendIndex, "results.getRiver().getWstUnit()"));
+            header.add(exportContextCSV.msg(DurationWaterlevel.getHeaderWCsv(), appendIndex, river.getWstUnit()));
             header.add(exportContextCSV.msg(DurationWaterlevel.getHeaderFloodDurPerYearCsv(), appendIndex));
             header.add(exportContextCSV.msg(DurationWaterlevel.getHeaderQ(), appendIndex));
             header.add(exportContextCSV.msg(DurationWaterlevel.getHeaderBezeichnCsv(), appendIndex));
diff -r 77f24792d75f -r 7100a555607c artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java	Tue Jul 24 18:52:40 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java	Wed Jul 25 10:12:27 2018 +0200
@@ -167,7 +167,7 @@
             }
         }
         final List<ResultRow> stationRows = searchStation(station1, result.getRows());
-        if (stationRows.isEmpty() || (stationRows.get(0).getValue(SInfoResultType.infrastructuretype) == null)) {
+        if (stationRows.isEmpty()) {
             return new ArrayList<>();
         }
         final ResultRow row = stationRows.get(0);
@@ -197,7 +197,7 @@
             }
         }
         final List<ResultRow> stationRows = searchStation(station1, result.getRows());
-        if (stationRows.isEmpty() || (stationRows.get(0).getValue(SInfoResultType.infrastructuretype) == null)) {
+        if (stationRows.isEmpty()) {
             return new ArrayList<>();
         }
         final List<StickyAxisAnnotation> annotations = new ArrayList<>();
diff -r 77f24792d75f -r 7100a555607c artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodHeightProcessor.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodHeightProcessor.java	Tue Jul 24 18:52:40 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodHeightProcessor.java	Wed Jul 25 10:12:27 2018 +0200
@@ -24,7 +24,6 @@
 import org.dive4elements.river.artifacts.sinfo.flood_duration.FloodDurationCalculationResult.ValueGetter;
 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType;
 import org.dive4elements.river.exports.DiagramGenerator;
-import org.dive4elements.river.exports.LongitudinalSectionGenerator;
 import org.dive4elements.river.model.Attribute.AttributeKey;
 import org.dive4elements.river.themes.ThemeDocument;
 
@@ -46,7 +45,7 @@
 
     private static final String FACET_MAIN_VALUE_HEIGHT_DESCRIPTION = "mainvalue.w.description";
 
-    private static final String I18N_AXIS_LABEL = LongitudinalSectionGenerator.I18N_YAXIS_LABEL;
+    private static final String I18N_AXIS_LABEL = "sinfo.chart.flood_duration.height.section.yaxis.label";
 
     private static final Set<String> HANDLED_FACET_TYPES = new HashSet<>();
 
diff -r 77f24792d75f -r 7100a555607c artifacts/src/main/resources/messages.properties
--- a/artifacts/src/main/resources/messages.properties	Tue Jul 24 18:52:40 2018 +0200
+++ b/artifacts/src/main/resources/messages.properties	Wed Jul 25 10:12:27 2018 +0200
@@ -1011,7 +1011,7 @@
 sinfo.flood_duration.header.duration_index = \u00dcberflutungsdauer WSPL{0} [d/a]
 sinfo.flood_duration.header.fd_per_year_index = \u00dcberflutungsdauer WSPL{0} [d/a]
 sinfo.flood_duration.header.pdf.fd_per_year_index = \u00dcberflu-tungs-dauer WSPL{0} [d/a]
-sinfo.flood_duration.header.w_index = Wasserstand/Wasserspiegellage{0}
+sinfo.flood_duration.header.w_index = Wasserstand/Wasserspiegellage{0} [{1}]
 sinfo.flood_duration.header.pdf.w_index = Wasser-stand/ Wasser-spiegel-lage{0} 
 sinfo.flood_duration.header.q_index =  Q{0} [m\u00b3/s]
 
@@ -1091,7 +1091,7 @@
 state.uinfo.calculation_mode=Berechnungsart
 
 mainvalue.w = Wasserstand/Wasserspiegellage
-mainvalue.w.description = Wasserstand/Wasserspiegel-lage ({0})
+mainvalue.w.description = Wasserstand/Wasserspiegellage ({0})
 mainvalue.duration = \u00dcberflutungsdauer
 mainvalue.duration.description = \u00dcberflutungsdauer ({0})
 state.uinfo.salix.historical.km_range_part = Ausgewertete Strecke
@@ -1162,6 +1162,7 @@
 gauge_main_values.missing = No named main values available for gauge {0}
 wq_base_data.missing = No base waterlevel/discharge available
 sinfo.chart.flood_duration.height.section.title = H\u00f6he Infrastrukturen BWaStr
+sinfo.chart.flood_duration.height.section.yaxis.label = H\u00f6he [{0}]
 sinfo_facet_flood_height = Geod\u00e4tische H\u00f6he Infrastrukturen BWaStr
 sinfo_facet_flood_height.description = Geod\u00e4tische H\u00f6he Infrastrukturen BWaStr ({0})
 sinfo.chart.flood_duration.curve.section.title = \u00dcberflutungsdauer Infrastrukturen BWaStr - Dauerlinie
diff -r 77f24792d75f -r 7100a555607c artifacts/src/main/resources/messages_de.properties
--- a/artifacts/src/main/resources/messages_de.properties	Tue Jul 24 18:52:40 2018 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Wed Jul 25 10:12:27 2018 +0200
@@ -1011,7 +1011,7 @@
 sinfo.flood_duration.header.duration_index = \u00dcberflutungsdauer WSPL{0} [d/a]
 sinfo.flood_duration.header.fd_per_year_index = \u00dcberflutungsdauer WSPL{0} [d/a]
 sinfo.flood_duration.header.pdf.fd_per_year_index = \u00dcberflu-tungs-dauer WSPL{0} [d/a]
-sinfo.flood_duration.header.w_index = Wasserstand/Wasserspiegellage{0}
+sinfo.flood_duration.header.w_index = Wasserstand/Wasserspiegellage{0} [{1}]
 sinfo.flood_duration.header.pdf.w_index = Wasser-stand/ Wasser-spiegel-lage{0} 
 sinfo.flood_duration.header.q_index =  Q{0} [m\u00b3/s]
 
@@ -1091,7 +1091,7 @@
 state.uinfo.calculation_mode=Berechnungsart
 
 mainvalue.w = Wasserstand/Wasserspiegellage
-mainvalue.w.description = Wasserstand/Wasserspiegel-lage ({0})
+mainvalue.w.description = Wasserstand/Wasserspiegellage ({0})
 mainvalue.duration = \u00dcberflutungsdauer
 mainvalue.duration.description = \u00dcberflutungsdauer ({0})
 state.uinfo.salix.historical.km_range_part = Ausgewertete Strecke
@@ -1163,6 +1163,7 @@
 wq_base_data.missing = W/Q-Daten fehlen oder sind ung\00fcltig
 sinfo.chart.flood_duration.height.section.title = H\u00f6he Infrastrukturen BWaStr
 sinfo_facet_flood_height = Geod\u00e4tische H\u00f6he Infrastrukturen BWaStr
+sinfo.chart.flood_duration.height.section.yaxis.label = H\u00f6he [{0}]
 sinfo_facet_flood_height.description = Geod\u00e4tische H\u00f6he Infrastrukturen BWaStr ({0})
 sinfo.chart.flood_duration.curve.section.title = \u00dcberflutungsdauer Infrastrukturen BWaStr - Dauerlinie
 sinfo.chart.flood_duration.curve.xaxis.label = \u00dcberflutungsdauer [d/a]


More information about the Dive4Elements-commits mailing list