changeset 9236:b515ed950d39

S-Info flood durations with automatic km step width
author mschaefer
date Fri, 06 Jul 2018 17:56:18 +0200
parents d47f6641f597
children 972e10522ed6
files artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculation.java artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculationResult.java artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java
diffstat 3 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculation.java	Fri Jul 06 15:29:12 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculation.java	Fri Jul 06 17:56:18 2018 +0200
@@ -22,7 +22,6 @@
 import org.dive4elements.river.artifacts.sinfo.util.CalculationUtils;
 import org.dive4elements.river.artifacts.sinfo.util.RiverInfo;
 import org.dive4elements.river.model.River;
-import org.dive4elements.river.model.sinfo.Infrastructure;
 
 /**
  * Calculation of the flood durations of the infrastructures of the km range of a river
@@ -49,16 +48,15 @@
 
         final RiverInfoProvider infoProvider = RiverInfoProvider.forRange(this.context, river, calcRange);
         final String calcModeLabel = Resources.getMsg(this.context.getMeta(), sinfo.getCalculationMode().name());
-        final Infrastructure infrasSeries = Infrastructure.getSeries(river);
-        final String infrasType = (infrasSeries != null) ? infrasSeries.getType().getName() : "?";
-        final String label = infrasType + ", " + Resources.getMsg(this.context.getMeta(), access.getRiverside().getKey());
+        final String label = Resources.getMsg(this.context.getMeta(), access.getRiverside().getKey());
 
         final Calculation problems = new Calculation();
 
         // Calculate the selected main values, if any
         /* misuse winfo-artifact to calculate waterlevels in the same way */
         final WINFOArtifact winfo = new WinfoArtifactWrapper(sinfo);
-        // TODO Aktivieren wenn Step-Eingabe im Workflow weg: winfo.addStringData("ld_step", "100");
+        winfo.addStringData("ld_mode", "distance");
+        winfo.addStringData("ld_step", "100");
 
         final FloodDurationCalculationResults results = new FloodDurationCalculationResults(calcModeLabel, user, riverInfo, calcRange);
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculationResult.java	Fri Jul 06 15:29:12 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculationResult.java	Fri Jul 06 17:56:18 2018 +0200
@@ -76,8 +76,7 @@
         if (this.mainvalueLabels.length >= 1) {
             // "##METADATEN WASSERSPIEGELLAGE"
             exportContextCSV.writeCSVMetaEntry(SInfoI18NStrings.CSV_META_HEADER_WATERLEVEL);
-            for (int i = 1; i <= getWaterlevelCount(); // this.mainvalueLabels.length;
-                    i++) {
+            for (int i = 1; i <= getWaterlevelCount(); i++) {
                 // "# Bezeichnung der Wasserspiegellage: "
                 final String label = this.getMainValueLabel(i - 1);
                 exportContextCSV.writeCSVMetaEntry(SInfoI18NStrings.CSV_META_HEADER_WATERLEVEL_NAME, String.format("%d: %s", i, label));
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java	Fri Jul 06 15:29:12 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java	Fri Jul 06 17:56:18 2018 +0200
@@ -80,7 +80,7 @@
         // Merge all stations (range/step, borders of gauge ranges, infrastructures)
         final Map<Double, InfrastructureValue> allStations = new HashMap<>();
         final Map<Double, InfrastructureValue> secondBank = new HashMap<>(); // any second infrastructure in case of both-banks-option
-        // addRangeStations(allStations, winfo); //@Schäfer: bitte überprüfen, wie diese Funktion ersetzt werden muss
+        addRangeStations(allStations, winfo);
         addGaugeLimits(allStations, durFinders.keySet(), calcRange.getMinimumDouble(), calcRange.getMaximumDouble());
         addInfrastructures(allStations, secondBank, infras);
         final double[] stationsSorted = sortStations(allStations.keySet());

http://dive4elements.wald.intevation.org