changeset 9298:0b1a51b0c42e

Included the infrastructure-less stations in the S-Info flood duration long. sections, and the selected wspls in their w/q duration curves
author mschaefer
date Wed, 25 Jul 2018 11:33:48 +0200
parents 7100a555607c
children 4a6cc7c6716a b40fbca03024
files 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 2 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculationResult.java	Wed Jul 25 10:12:27 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculationResult.java	Wed Jul 25 11:33:48 2018 +0200
@@ -89,6 +89,14 @@
         return Collections.unmodifiableCollection(infrasOnlyRows);
     }
 
+    /**
+     * Collection of all result rows
+     */
+    public Collection<ResultRow> getAllRows() {
+
+        return super.getRows();
+    }
+
     @Override
     protected void writeCSVResultMetadata(final ExportContextCSV exportContextCSV) {
         /* nothing to do, as we never have several results, everything is written into the general header */
@@ -236,7 +244,7 @@
      */
     public final double[][] getMainValueDurationPoints(final ValueGetter valuegetter, final int dataIndex) {
 
-        final Collection<ResultRow> rows = getRows();
+        final Collection<ResultRow> rows = getAllRows();
 
         final TDoubleArrayList xPoints = new TDoubleArrayList(rows.size());
         final TDoubleArrayList yPoints = new TDoubleArrayList(rows.size());
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java	Wed Jul 25 10:12:27 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java	Wed Jul 25 11:33:48 2018 +0200
@@ -161,12 +161,12 @@
         // Search the station in the previously calculated result rows and terminate if no infrastructure row found
         double station1 = station;
         if (Double.isNaN(station)) {
-            for (final ResultRow row : result.getRows()) {
+            for (final ResultRow row : result.getAllRows()) {
                 station1 = row.getDoubleValue(GeneralResultType.station);
                 break;
             }
         }
-        final List<ResultRow> stationRows = searchStation(station1, result.getRows());
+        final List<ResultRow> stationRows = searchStation(station1, result.getAllRows());
         if (stationRows.isEmpty()) {
             return new ArrayList<>();
         }
@@ -191,12 +191,12 @@
         // Search the station in the previously calculated result rows and terminate if no infrastructure row found
         double station1 = station;
         if (Double.isNaN(station)) {
-            for (final ResultRow row : result.getRows()) {
+            for (final ResultRow row : result.getAllRows()) {
                 station1 = row.getDoubleValue(GeneralResultType.station);
                 break;
             }
         }
-        final List<ResultRow> stationRows = searchStation(station1, result.getRows());
+        final List<ResultRow> stationRows = searchStation(station1, result.getAllRows());
         if (stationRows.isEmpty()) {
             return new ArrayList<>();
         }

http://dive4elements.wald.intevation.org