diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java @ 9625:07f02019065e

Nachtrag Pos. 20: infrastructure query added, calculation updated for extended access class
author mschaefer
date Mon, 14 Oct 2019 08:14:58 +0200
parents 26e113e8224f
children 6ecd1a28017f
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java	Fri Oct 11 18:30:36 2019 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java	Mon Oct 14 08:14:58 2019 +0200
@@ -33,6 +33,7 @@
 import org.dive4elements.river.artifacts.model.river.RiverInfoProvider;
 import org.dive4elements.river.artifacts.sinfo.common.GaugeDurationValuesFinder;
 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultType;
+import org.dive4elements.river.artifacts.sinfo.flood_duration.InfrastructureServerClientXChange.Element;
 import org.dive4elements.river.exports.WaterlevelDescriptionBuilder;
 import org.dive4elements.river.model.Attribute.AttributeKey;
 import org.dive4elements.river.model.Gauge;
@@ -67,7 +68,7 @@
      * Calculate the infrastructures flood duration result rows
      */
     public void execute(final Calculation problems, final String label, final DoubleRange calcRange, final AttributeKey riverside,
-            final Set<String> infrastructureChoices, final boolean withWspl, final WINFOArtifact winfo, final FloodDurationCalculationResults results) {
+            final List<Element> infrastructureChoices, final boolean withWspl, final WINFOArtifact winfo, final FloodDurationCalculationResults results) {
 
         // Find all gauges of the calc range, and create the duration finders
         final Map<Gauge, GaugeDurationValuesFinder> durFinders = new HashMap<>();
@@ -76,8 +77,11 @@
         }
 
         // Find all infrastructures within the calc range
+        final Set<String> choices = new HashSet<>();
+        for (final Element ifch : infrastructureChoices)
+            choices.add(ifch.getGroupLabel() + "\t" + ifch.getTypeLabel());
         final List<InfrastructureValue> infras = InfrastructureValue.getValues(this.riverInfoProvider.getRiver(), calcRange.getMinimumDouble(),
-                calcRange.getMaximumDouble(), riverside, infrastructureChoices);
+                calcRange.getMaximumDouble(), riverside, choices);
 
         // Merge all stations (range/step, borders of gauge ranges, infrastructures)
         // final Map<Double, InfrastructureValue> allStations = new HashMap<>();

http://dive4elements.wald.intevation.org