diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java @ 9614:d889ffe2fb05

Nachtrag Pos. 20: rename type/part to group/type, group added in Infrastructure class
author mschaefer
date Wed, 09 Oct 2019 19:17:06 +0200
parents f8308db94634
children 26e113e8224f
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java	Wed Oct 09 16:17:16 2019 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java	Wed Oct 09 19:17:06 2019 +0200
@@ -286,8 +286,8 @@
 
         final ResultRow row = ResultRow.create();
         row.putValue(GeneralResultType.station, station);
-        row.putValue(SInfoResultType.infrastructuretype, null); // is replaced later for an infrastructure type
-        row.putValue(SInfoResultType.infrastructurepart, null); // is replaced later for an infrastructure part
+        row.putValue(SInfoResultType.infrastructuregroup, null); // is replaced later for an infrastructure type
+        row.putValue(SInfoResultType.infrastructuretype, null); // is replaced later for an infrastructure part
         row.putValue(SInfoResultType.floodDuration, Double.NaN); // is replaced later for an infrastructure
 
         final String gaugeLabel = this.riverInfoProvider2.findGauge(station);
@@ -310,8 +310,6 @@
 
     /**
      * Calculate the result row fields for one infrastructure
-     *
-     * @param map
      */
     private void calculateInfrastructure(final ResultRow row, final Gauge gauge, final InfrastructureValue infrastructure, final WstValueTable wst,
             final Map<Gauge, GaugeDurationValuesFinder> durFinders, final Set<Infrastructure> infrastructures) {
@@ -325,13 +323,9 @@
         row.putValue(SInfoResultType.riverside, infrastructure.getAttributeKey());
         row.putValue(SInfoResultType.floodDischarge, q);
         row.putValue(SInfoResultType.infrastructureHeight, infrastructure.getHeight());
+        row.putValue(SInfoResultType.infrastructuregroup, infrastructure.getInfrastructure().getGroup().getName());
         row.putValue(SInfoResultType.infrastructuretype, infrastructure.getInfrastructure().getType().getName());
 
-        int dochNichtRandom = (int) (q / 20 + 1);
-        if (dochNichtRandom > 10)
-            dochNichtRandom = 4;
-
-        row.putValue(SInfoResultType.infrastructurepart, "TEST_" + dochNichtRandom);
         // Determine the relative column position of the Q of the infrastructure height
         final QPosition qPos = wst.getQPosition(infrastructure.getStation().doubleValue(), q);
         if (qPos == null)
@@ -343,8 +337,8 @@
         // Set D in the result row
         row.putValue(SInfoResultType.floodDuration, dur);
 
-        final FloodDurationCalculationResult.Infrastructure typePart = new FloodDurationCalculationResult.Infrastructure(row);
-        infrastructures.add(typePart);
+        final FloodDurationCalculationResult.Infrastructure groupType = new FloodDurationCalculationResult.Infrastructure(row);
+        infrastructures.add(groupType);
     }
 
     /**

http://dive4elements.wald.intevation.org