[PATCH 3 of 5] Softwaretests...20181219 6.2.2: Sinfo/Ued Haupt-/Extremwerte update for current km, W/Q of selected WSPL initially visible

Wald Commits scm-commit at wald.intevation.org
Tue Feb 5 15:52:18 CET 2019


# HG changeset patch
# User mschaefer
# Date 1549377807 -3600
# Node ID fbfd66e8fb811753e030eb04bfe2dec4dbba927d
# Parent  9b39cfd39e591fc2a21c5ce37ddb1aea7e0d4eff
Softwaretests...20181219 6.2.2: Sinfo/Ued Haupt-/Extremwerte update for current km, W/Q of selected WSPL initially visible

diff -r 9b39cfd39e59 -r fbfd66e8fb81 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/SINFOArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/SINFOArtifact.java	Tue Feb 05 15:31:13 2019 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/SINFOArtifact.java	Tue Feb 05 15:43:27 2019 +0100
@@ -20,7 +20,6 @@
 import org.dive4elements.river.artifacts.sinfo.common.FlowDepthProcessor;
 import org.dive4elements.river.artifacts.sinfo.common.TauProcessor;
 import org.dive4elements.river.artifacts.sinfo.common.VelocityProcessor;
-import org.dive4elements.river.artifacts.sinfo.flood_duration.FloodDurationCurveProcessor;
 
 /**
  * The default SINFO artifact.
@@ -96,10 +95,10 @@
                 if (FlowDepthDevelopmentPerYearProcessor.FACET_FLOW_DEPTH_DEVELOPMENT_PER_YEAR_RAW.equals(name))
                     return Boolean.FALSE;
 
-                if (FloodDurationCurveProcessor.FACET_FLOOD_DURATION_MAINVALUES_W.equals(name))
-                    return Boolean.FALSE;
-                if (FloodDurationCurveProcessor.FACET_FLOOD_DURATION_MAINVALUES_Q.equals(name))
-                    return Boolean.FALSE;
+                // if (FloodDurationCurveProcessor.FACET_FLOOD_DURATION_MAINVALUES_W.equals(name))
+                // return Boolean.FALSE;
+                // if (FloodDurationCurveProcessor.FACET_FLOOD_DURATION_MAINVALUES_Q.equals(name))
+                // return Boolean.FALSE;
 
                 return null;
             }
diff -r 9b39cfd39e59 -r fbfd66e8fb81 artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/MainValuesArtifactWrapper.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/MainValuesArtifactWrapper.java	Tue Feb 05 15:43:27 2019 +0100
@@ -0,0 +1,39 @@
+/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
+ * Software engineering by
+ *  Björnsen Beratende Ingenieure GmbH
+ *  Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+package org.dive4elements.river.artifacts.sinfo.flood_duration;
+
+import java.util.Collection;
+
+import org.dive4elements.artifactdatabase.data.DefaultStateData;
+import org.dive4elements.artifactdatabase.data.StateData;
+import org.dive4elements.river.artifacts.D4EArtifact;
+import org.dive4elements.river.artifacts.MainValuesArtifact;
+
+/**
+ * Ugly wrapper around MainValuesArtifact in order to a) not to break serialization of WInfoArtifact b) be able to copy
+ * data into it.
+ *
+ * @author Matthias Schäfer
+ */
+public final class MainValuesArtifactWrapper extends MainValuesArtifact {
+
+    private static final long serialVersionUID = 1L;
+
+    public MainValuesArtifactWrapper(final D4EArtifact dataSource) {
+
+        final Collection<StateData> allData = dataSource.getAllData();
+
+        for (final StateData stateData : allData) {
+            final DefaultStateData clonedData = new DefaultStateData();
+            clonedData.set(stateData);
+            addData(clonedData.getName(), clonedData);
+        }
+    }
+}
\ No newline at end of file


More information about the Dive4Elements-commits mailing list