diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthdev/FlowDepthDevelopmentCalculation.java @ 8953:c40db8e8dcae

SINFO - Flow depth development - implemented exporters
author gernotbelger
date Mon, 19 Mar 2018 14:01:21 +0100
parents 322b0e6298ea
children 45f1ad66560e
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthdev/FlowDepthDevelopmentCalculation.java	Mon Mar 19 09:12:17 2018 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthdev/FlowDepthDevelopmentCalculation.java	Mon Mar 19 14:01:21 2018 +0100
@@ -180,10 +180,26 @@
             }
         }
 
-        return new FlowDepthDevelopmentCalculationResult("", currentWstInfo, historicalWstInfo, currentSoundingInfo, historicalSoundingInfo,
+        final String label = buildLabel(currentWaterlevel, currentSoundingInfo, historicalWaterlevel, historicalSoundingInfo);
+
+        return new FlowDepthDevelopmentCalculationResult(label, currentWstInfo, historicalWstInfo, currentSoundingInfo, historicalSoundingInfo,
                 rows);
     }
 
+    private String buildLabel(final WaterlevelData currentWaterlevel, final BedHeightInfo currentSounding, final WaterlevelData historicalWaterlevel,
+            final BedHeightInfo historicalSounding) {
+
+        return new StringBuilder(). //
+                append(currentWaterlevel.getName()). //
+                append('/'). //
+                append(historicalWaterlevel.getName()). //
+                append(" - "). //
+                append(currentSounding.getDescription()). //
+                append('/'). //
+                append(historicalSounding.getDescription()). //
+                toString();
+    }
+
     /* REMARK: fetch ALL wst kms, because we need to determine the original reference gauge */
     private WaterlevelData loadWaterlevel(final WstSoundingIdPair pair, final Calculation problems) {
         final String wstId = pair.getWstId();

http://dive4elements.wald.intevation.org