changeset 9596:fbfd66e8fb81

Softwaretests...20181219 6.2.2: Sinfo/Ued Haupt-/Extremwerte update for current km, W/Q of selected WSPL initially visible
author mschaefer
date Tue, 05 Feb 2019 15:43:27 +0100
parents 9b39cfd39e59
children 5395c6d4ca50
files artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/SINFOArtifact.java artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/MainValuesArtifactWrapper.java
diffstat 2 files changed, 43 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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;
             }
--- /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

http://dive4elements.wald.intevation.org