changeset 9029:3e90c84f3aea

work on proof 2
author gernotbelger
date Thu, 26 Apr 2018 13:12:48 +0200
parents 7f3818ec6eb6
children 4dc047fb3633
files gwt-client/src/main/java/org/dive4elements/river/client/test/SinfoProof.java
diffstat 1 files changed, 87 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/test/SinfoProof.java	Thu Apr 26 13:12:48 2018 +0200
@@ -0,0 +1,87 @@
+/** 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.client.test;
+
+import org.dive4elements.river.client.client.ui.NilDatacageTwinPanelInfo;
+import org.dive4elements.river.client.client.ui.RecommandationUtils;
+import org.dive4elements.river.client.shared.model.Artifact;
+import org.dive4elements.river.client.shared.model.Data;
+import org.dive4elements.river.client.shared.model.DataItem;
+import org.dive4elements.river.client.shared.model.DataList;
+import org.dive4elements.river.client.shared.model.DefaultDataItem;
+import org.dive4elements.river.client.shared.model.OutputMode;
+import org.dive4elements.river.client.shared.model.Recommendation;
+import org.dive4elements.river.client.shared.model.StringOptionsData;
+
+/**
+ * @author Domenico Nardi Tironi
+ *
+ */
+public class SinfoProof extends SuperProof {
+
+    public SinfoProof(final String username, final String password, final String infotype) {
+        super(username, password, infotype);
+
+    }
+
+    @Override
+    public void runTest() {
+        // TODO Auto-generated method stub
+        /* Select River */
+        final Data data = new StringOptionsData("river", "river", new DataItem[] { new DefaultDataItem("Beispielfluss", "Beispielfluss", "Beispielfluss") });
+        feedAndGo(new Data[] { data }, 0);
+
+        /* Select CalcMode */
+        final DataList calcModes = getArtifact().getArtifactDescription().getCurrentData(); // AUSWAHL-Möglichkeiten
+        final DataItem minMaxFlowdepth = calcModes.get(0).getItems()[2];
+        final Data dataCalcMode = new StringOptionsData("calculation_mode", "calculation_mode", new DataItem[] { minMaxFlowdepth });
+        feedAndGo(new Data[] { dataCalcMode }, 0);
+
+        /* Select Range */
+
+        // entweder eine bestimmte Range
+        final Data dataFrom = new StringOptionsData("ld_from", "ld_from", new DataItem[] { new DefaultDataItem("10", "10", "10") });
+        final Data dataTo = new StringOptionsData("ld_to", "ld_to", new DataItem[] { new DefaultDataItem("100", "100", "100") });
+        final Data[] rangeFromToDetermined = new Data[] { dataFrom, dataTo };
+
+        // oder die maxRange
+        final DataList list = getArtifact().getArtifactDescription().getCurrentData();
+        final Data[] rangeMax = new Data[] { list.get(0), list.get(1) };
+
+        feedAndGo(rangeFromToDetermined, 0);
+
+        /* Select Fixpunkte */
+        // TODO: Create Recoomendation-Generator
+        final Recommendation rec1 = new Recommendation("staticwqkms", "additionals-wstv-0-103", "sinfo_flowdepth_waterlevels");
+        final Recommendation rec2 = new Recommendation("bedheight", "bedheight-single-36-2015-FP-2015_0-502", "sinfo_flowdepthminmax_heights");
+
+        final Artifact[] artifacts = loadMany(new Recommendation[] { rec1, rec2 }, null);
+
+        // rec1.getDisplayName() TODO: makeDisplayName
+        final String rec1String = RecommandationUtils.createDataString(artifacts[0].getUuid(), rec1, new NilDatacageTwinPanelInfo("xxxx"));
+        final String rec2String = RecommandationUtils.createDataString(artifacts[1].getUuid(), rec2, new NilDatacageTwinPanelInfo("xxxx"));
+        // TODO: check display name
+        final String combinedIdNeu = rec1String + "#" + rec2String;
+
+        final Data pair = new StringOptionsData("diffids", "diffids", new DataItem[] { new DefaultDataItem(combinedIdNeu, combinedIdNeu, combinedIdNeu) });
+        feedAndGo(new Data[] { pair }, 0);
+
+        // Describe collection
+        describeCollection(); // wichtig, damit die Facets erzeugt werden
+
+        // /* Export calculation */
+        final OutputMode[] modes = getArtifact().getArtifactDescription().getOutputModes();
+        if (modes != null) {
+            final OutputMode mode = modes[1]; // output.sinfo_flowdepthminmax_export
+            doGet(mode.getName());
+        }
+    }
+
+}

http://dive4elements.wald.intevation.org