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