[PATCH 2 of 2] work on proof 2
Wald Commits
scm-commit at wald.intevation.org
Thu Apr 26 13:12:56 CEST 2018
# HG changeset patch
# User gernotbelger
# Date 1524741168 -7200
# Node ID 3e90c84f3aea30d8aa344d7e18ccbb52c452e192
# Parent 7f3818ec6eb68843a9230054831fe6342f3b65a0
work on proof 2
diff -r 7f3818ec6eb6 -r 3e90c84f3aea gwt-client/src/main/java/org/dive4elements/river/client/test/SinfoProof.java
--- /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());
+ }
+ }
+
+}
More information about the Dive4Elements-commits
mailing list