diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java @ 9631:6ecd1a28017f

Nachtrag Pos. 20: Q theme for height chart added, calculator corrected (rows for km without any infrastructure)
author mschaefer
date Tue, 15 Oct 2019 12:26:13 +0200
parents 07f02019065e
children
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java	Mon Oct 14 18:07:31 2019 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java	Tue Oct 15 12:26:13 2019 +0200
@@ -114,15 +114,23 @@
         final Set<FloodDurationInfrastructureChoice> infrastructures = new HashSet<>();
 
         // Create the result rows, and calculate and add the flood durations etc.
+        ResultRow row;
+        boolean starting;
         for (int i = 0; i <= stationsSorted.length - 1; i++) {
             final Gauge gauge = this.riverInfoProvider2.getGauge(stationsSorted[i], true);
+            row = createRow(stationsSorted[i], wqkmsArray, gaugeWstDurations.get(gauge), i);
+            starting = true;
             if (this.stationInfras.containsKey(stationsSorted[i])) {
                 for (final InfrastructureValue infra : this.stationInfras.get(stationsSorted[i])) {
-                    final ResultRow row = createRow(stationsSorted[i], wqkmsArray, gaugeWstDurations.get(gauge), i);
+                    if (!starting)
+                        row = createRow(stationsSorted[i], wqkmsArray, gaugeWstDurations.get(gauge), i);
                     calculateInfrastructure(row, gauge, infra, wst, durFinders, infrastructures);
                     this.rows.add(row);
+                    starting = false;
                 }
             }
+            if (starting)
+                this.rows.add(row);
         }
 
         // Get the labels of the selected waterlevels

http://dive4elements.wald.intevation.org