Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/test/SinfoProof.java @ 9029:3e90c84f3aea
work on proof 2
author | gernotbelger |
---|---|
date | Thu, 26 Apr 2018 13:12:48 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9028:7f3818ec6eb6 | 9029:3e90c84f3aea |
---|---|
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 package org.dive4elements.river.client.test; | |
11 | |
12 import org.dive4elements.river.client.client.ui.NilDatacageTwinPanelInfo; | |
13 import org.dive4elements.river.client.client.ui.RecommandationUtils; | |
14 import org.dive4elements.river.client.shared.model.Artifact; | |
15 import org.dive4elements.river.client.shared.model.Data; | |
16 import org.dive4elements.river.client.shared.model.DataItem; | |
17 import org.dive4elements.river.client.shared.model.DataList; | |
18 import org.dive4elements.river.client.shared.model.DefaultDataItem; | |
19 import org.dive4elements.river.client.shared.model.OutputMode; | |
20 import org.dive4elements.river.client.shared.model.Recommendation; | |
21 import org.dive4elements.river.client.shared.model.StringOptionsData; | |
22 | |
23 /** | |
24 * @author Domenico Nardi Tironi | |
25 * | |
26 */ | |
27 public class SinfoProof extends SuperProof { | |
28 | |
29 public SinfoProof(final String username, final String password, final String infotype) { | |
30 super(username, password, infotype); | |
31 | |
32 } | |
33 | |
34 @Override | |
35 public void runTest() { | |
36 // TODO Auto-generated method stub | |
37 /* Select River */ | |
38 final Data data = new StringOptionsData("river", "river", new DataItem[] { new DefaultDataItem("Beispielfluss", "Beispielfluss", "Beispielfluss") }); | |
39 feedAndGo(new Data[] { data }, 0); | |
40 | |
41 /* Select CalcMode */ | |
42 final DataList calcModes = getArtifact().getArtifactDescription().getCurrentData(); // AUSWAHL-Möglichkeiten | |
43 final DataItem minMaxFlowdepth = calcModes.get(0).getItems()[2]; | |
44 final Data dataCalcMode = new StringOptionsData("calculation_mode", "calculation_mode", new DataItem[] { minMaxFlowdepth }); | |
45 feedAndGo(new Data[] { dataCalcMode }, 0); | |
46 | |
47 /* Select Range */ | |
48 | |
49 // entweder eine bestimmte Range | |
50 final Data dataFrom = new StringOptionsData("ld_from", "ld_from", new DataItem[] { new DefaultDataItem("10", "10", "10") }); | |
51 final Data dataTo = new StringOptionsData("ld_to", "ld_to", new DataItem[] { new DefaultDataItem("100", "100", "100") }); | |
52 final Data[] rangeFromToDetermined = new Data[] { dataFrom, dataTo }; | |
53 | |
54 // oder die maxRange | |
55 final DataList list = getArtifact().getArtifactDescription().getCurrentData(); | |
56 final Data[] rangeMax = new Data[] { list.get(0), list.get(1) }; | |
57 | |
58 feedAndGo(rangeFromToDetermined, 0); | |
59 | |
60 /* Select Fixpunkte */ | |
61 // TODO: Create Recoomendation-Generator | |
62 final Recommendation rec1 = new Recommendation("staticwqkms", "additionals-wstv-0-103", "sinfo_flowdepth_waterlevels"); | |
63 final Recommendation rec2 = new Recommendation("bedheight", "bedheight-single-36-2015-FP-2015_0-502", "sinfo_flowdepthminmax_heights"); | |
64 | |
65 final Artifact[] artifacts = loadMany(new Recommendation[] { rec1, rec2 }, null); | |
66 | |
67 // rec1.getDisplayName() TODO: makeDisplayName | |
68 final String rec1String = RecommandationUtils.createDataString(artifacts[0].getUuid(), rec1, new NilDatacageTwinPanelInfo("xxxx")); | |
69 final String rec2String = RecommandationUtils.createDataString(artifacts[1].getUuid(), rec2, new NilDatacageTwinPanelInfo("xxxx")); | |
70 // TODO: check display name | |
71 final String combinedIdNeu = rec1String + "#" + rec2String; | |
72 | |
73 final Data pair = new StringOptionsData("diffids", "diffids", new DataItem[] { new DefaultDataItem(combinedIdNeu, combinedIdNeu, combinedIdNeu) }); | |
74 feedAndGo(new Data[] { pair }, 0); | |
75 | |
76 // Describe collection | |
77 describeCollection(); // wichtig, damit die Facets erzeugt werden | |
78 | |
79 // /* Export calculation */ | |
80 final OutputMode[] modes = getArtifact().getArtifactDescription().getOutputModes(); | |
81 if (modes != null) { | |
82 final OutputMode mode = modes[1]; // output.sinfo_flowdepthminmax_export | |
83 doGet(mode.getName()); | |
84 } | |
85 } | |
86 | |
87 } |