9422
|
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 test.sinfo; |
|
11 |
|
12 import java.io.IOException; |
|
13 |
|
14 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException; |
|
15 import org.dive4elements.river.client.shared.exceptions.ServerException; |
|
16 import org.dive4elements.river.client.shared.model.Data; |
|
17 import org.dive4elements.river.client.shared.model.DataItem; |
|
18 import org.dive4elements.river.client.shared.model.DefaultDataItem; |
|
19 import org.dive4elements.river.client.shared.model.StringOptionsData; |
|
20 |
|
21 import test.AbstractBerechnungsartenTester.River; |
|
22 import test.AbstractModuleRunner; |
|
23 import test.ICalcMode; |
|
24 import test.WQInputHelper; |
|
25 import test.sinfo.SinfoFloodDurationRiversideChoice.RiversideChoiceKey; |
|
26 |
|
27 /** |
|
28 * @author Domenico Nardi Tironi |
|
29 * |
|
30 */ |
|
31 final class SinfoFloodDurationRunner extends AbstractModuleRunner { |
|
32 |
|
33 private final double[] wasserspiegellage; |
|
34 private final boolean showWspl; |
|
35 private final RiversideChoiceKey riverside; |
|
36 |
9567
|
37 public SinfoFloodDurationRunner(final ICalcMode calcmode, final double from, final double to, final River river, final double[] wasserspiegellage, |
|
38 final RiversideChoiceKey riverside, final boolean showWspl) throws ConnectionException, ServerException { |
|
39 super(AbstractModuleRunner.Infotype.sinfo, calcmode, from, to, river); |
9422
|
40 this.wasserspiegellage = wasserspiegellage; |
|
41 this.showWspl = showWspl; |
|
42 this.riverside = riverside; |
|
43 } |
|
44 |
|
45 @Override |
9567
|
46 public void runTest() throws ServerException, IOException { |
9422
|
47 /* Select River */ |
|
48 super.selectRiver(); |
|
49 |
|
50 /* Select ICalcMode */ |
|
51 super.selectCalcMode(); |
|
52 |
|
53 super.feed(new Data[] { |
|
54 new StringOptionsData("ld_mode", "ld_mode", new DataItem[] { new DefaultDataItem("distance_only", "distance_only", "distance_only") }) }); // |
|
55 |
|
56 /* Select Range */ |
|
57 super.selectRange(); |
|
58 |
|
59 final Data riversideData = new StringOptionsData("riverside", "riverside", |
|
60 new DataItem[] { new DefaultDataItem("riverside", "riverside", this.riverside.toString()) }); |
|
61 feedAndGo(new Data[] { riversideData }, 0); |
|
62 |
|
63 final Data showWsplData = new StringOptionsData("wspl", "wspl", new DataItem[] { new DefaultDataItem("wspl", "wspl", String.valueOf(this.showWspl)) }); |
|
64 feedAndGo(new Data[] { showWsplData }, 0); |
|
65 |
9567
|
66 if (this.showWspl) { |
|
67 final WQInputHelper helper = new WQInputHelper(this.wasserspiegellage); |
|
68 super.feedAndGo(helper.getDataforFeed(), // |
|
69 0);// reachable state index |
|
70 } |
9422
|
71 |
|
72 describeCollection(); |
|
73 |
9567
|
74 super.runTests(); |
9422
|
75 } |
|
76 } |