diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/TkhCalculation.java @ 8948:a4f1ac81f26d

Work on SINFO-FlowDepthMinMax. Also rework of result row stuff, in order to reduce abstraction, using result type concept
author gernotbelger
date Wed, 14 Mar 2018 14:10:32 +0100
parents 5d5d482da3e9
children 183f42641ab6
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/TkhCalculation.java	Wed Mar 14 14:09:33 2018 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/TkhCalculation.java	Wed Mar 14 14:10:32 2018 +0100
@@ -28,8 +28,9 @@
 import org.dive4elements.river.artifacts.resources.Resources;
 import org.dive4elements.river.artifacts.sinfo.SINFOArtifact;
 import org.dive4elements.river.artifacts.sinfo.common.RiverInfoProvider;
+import org.dive4elements.river.artifacts.sinfo.common.SInfoResultRow;
+import org.dive4elements.river.artifacts.sinfo.common.SInfoResultType;
 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.DischargeValuesFinder;
-import org.dive4elements.river.artifacts.sinfo.tkhcalculation.Tkh;
 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.TkhCalculator;
 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.WaterlevelValuesFinder;
 import org.dive4elements.river.artifacts.sinfo.util.BedHeightInfo;
@@ -134,7 +135,7 @@
             return null;
         }
 
-        final Collection<TkhResultRow> rows = new ArrayList<>();
+        final Collection<SInfoResultRow> rows = new ArrayList<>();
 
         /* using wst-kms as basis, because we know that they are generated wst's with a fixed km-step */
         // FIXME: das führt dazu, das aktuell die Sohlhöhen beliebig linear interpolierrt werden. ist das immer richtig? z.b.
@@ -150,13 +151,15 @@
             if (tkhCalculator == null)
                 continue;
 
-            final Tkh tkh = tkhCalculator.getTkh(station);
+            final SInfoResultRow row = SInfoResultRow.create();
 
-            final String description = descBuilder.getDesc(wkms);
-            final String gaugeLabel = riverInfoProvider.findGauge(station);
-            final String location = riverInfoProvider.getLocation(station);
+            row.putValue(SInfoResultType.waterlevelLabel, descBuilder.getDesc(wkms));
+            row.putValue(SInfoResultType.gaugeLabel, riverInfoProvider.findGauge(station));
+            row.putValue(SInfoResultType.location, riverInfoProvider.getLocation(station));
 
-            rows.add(new TkhResultRow(tkh, description, gaugeLabel, location));
+            tkhCalculator.calculateTkh(station, row);
+
+            rows.add(row);
         }
 
         return new TkhCalculationResult(wstLabel, wstInfo, true, rows);

http://dive4elements.wald.intevation.org