Mercurial > dive4elements > river
comparison gwt-client/src/test/java/test/bundu/BunduBerechnungsartenTester.java @ 9442:173f188569c6
little improvements
author | gernotbelger |
---|---|
date | Mon, 20 Aug 2018 18:20:15 +0200 |
parents | ce0a48b93f4b |
children | 86e522bc7f36 |
comparison
equal
deleted
inserted
replaced
9441:e75afd693f78 | 9442:173f188569c6 |
---|---|
3 import java.io.IOException; | 3 import java.io.IOException; |
4 import java.util.ArrayList; | 4 import java.util.ArrayList; |
5 import java.util.List; | 5 import java.util.List; |
6 | 6 |
7 import org.dive4elements.river.client.shared.exceptions.ServerException; | 7 import org.dive4elements.river.client.shared.exceptions.ServerException; |
8 import org.junit.Ignore; | |
8 import org.junit.Test; | 9 import org.junit.Test; |
9 | 10 |
10 import test.AbstractBerechnungsartenTester; | 11 import test.AbstractBerechnungsartenTester; |
11 import test.ICalcMode; | 12 import test.ICalcMode; |
12 import test.IFilenameMapper; | 13 import test.IFilenameMapper; |
13 | 14 |
14 //@Ignore | 15 @Ignore |
15 public class BunduBerechnungsartenTester extends AbstractBerechnungsartenTester { | 16 public class BunduBerechnungsartenTester extends AbstractBerechnungsartenTester { |
16 | 17 |
17 public static enum CalcMode implements ICalcMode { | 18 public static enum CalcMode implements ICalcMode { |
18 bundu_bezugswst, // | 19 bundu_bezugswst, // |
19 // der Vollständigkeit halber | 20 // der Vollständigkeit halber |
32 public String getFilename() { | 33 public String getFilename() { |
33 return this.filename; | 34 return this.filename; |
34 } | 35 } |
35 } | 36 } |
36 | 37 |
37 // FixChoice | 38 // public static final LinkedHashMap<String, String> getMapValues(final FLYSConstants MSG) { |
38 // "state.bundu.wst.fix.auto" | 39 // final LinkedHashMap<String, String> mapValues = new LinkedHashMap<String, String>(); |
39 // state.bundu.wst.fix.manual; | 40 // mapValues.put("0", MSG.gauge_mnq()); |
40 | 41 // mapValues.put("1", MSG.gauge_mq()); |
41 // CalcChoice: | 42 // mapValues.put("2", MSG.gauge_mhq()); |
42 // state.bundu.wst.calc.manual | 43 // mapValues.put("3", MSG.gauge_hq5()); |
43 // state.bundu.wst.calc.auto | 44 // return mapValues; |
44 | 45 // } |
45 // SOUNDINGS: SIehe ParameterMatrixPanel.getData | |
46 | 46 |
47 @Test | 47 @Test |
48 public void testBezugswstAuto() throws ServerException, IOException { | 48 public void testBezugswstAuto() throws ServerException, IOException { |
49 /* WQ-Input */ | |
49 final List<Segment> segments = new ArrayList<Segment>(); | 50 final List<Segment> segments = new ArrayList<Segment>(); |
51 // gauge, fromKm, toKm, Q-Input | |
50 segments.add(new Segment("Köln", 670., 703.3, 1090.)); | 52 segments.add(new Segment("Köln", 670., 703.3, 1090.)); |
51 segments.add(new Segment("Düsseldorf", 703.3, 710., 1060.)); | 53 segments.add(new Segment("Düsseldorf", 703.3, 710., 1060.)); |
52 | 54 |
53 final int abflussklasseFrom = 0; | 55 /* Abflussklassen */ |
54 final int abflussklasseTo = 3; // TODO: Make map here | 56 // MSG won't work here! |
57 // final LinkedHashMap<String, String> map = FixGaugeSelectPanel.getMapValues(MSG); | |
58 // final String mnq = MSG.gauge_mnq(); | |
59 // final String hq5 = MSG.gauge_hq5(); | |
55 | 60 |
61 final String abflussklasseFrom = "0"; // map.get(mnq); | |
62 final String abflussklasseTo = "3";// map.get(hq5); | |
63 | |
64 /* Function */ | |
65 // from FixFunctionSelect: | |
66 // funcDesc.put("log", "W(Q) = m*ln(Q + b)"); | |
67 // funcDesc.put("linear", "W(Q) = m * Q + b"); | |
68 // funcDesc.put("log-linear", "W(Q) = a*ln(m*Q+b)"); | |
69 // funcDesc.put("exp", "W(Q) = m * a^Q + b"); | |
70 // funcDesc.put("quad", "W(Q) = n*Q^2+m*Q+b"); | |
71 // funcDesc.put("pow", "W(Q) = a * Q^c + d"); | |
72 // funcDesc.put("sq-pow", "S(Q) = a * Q^b"); | |
73 | |
74 final String function = "log"; | |
75 | |
76 /* calc-choice (has to be set due to state-transition-conditions) */ | |
77 // state.bundu.wst.calc.manual | |
78 // state.bundu.wst.calc.auto | |
79 final String calcChoice = "state.bundu.wst.calc.auto"; | |
80 | |
81 /* fixation-choice (has to be set due to state-transition-conditions) */ | |
82 // "state.bundu.wst.fix.auto" | |
83 // state.bundu.wst.fix.manual; | |
84 final String fixChoice = "state.bundu.wst.fix.auto"; | |
85 | |
86 /* Soundings */ | |
87 // --> Debug at ParameterMatrixPanel.getData | |
88 final String sounding = "single-95"; // Todo: make multiple if needed | |
89 | |
90 /* events - have to be set also when auto is selected */ | |
91 // --> get ids by debugging FixCalculation line 73 (constructor) | |
56 final int[] events = new int[] { 1465, 1466, 1452, 1453, 1472, 1473, 1478, 1479, 1604, 1605, 1317, 1318, 1353, 1354, 1596, 1597, 1323, 1324, 1345, 1346, | 92 final int[] events = new int[] { 1465, 1466, 1452, 1453, 1472, 1473, 1478, 1479, 1604, 1605, 1317, 1318, 1353, 1354, 1596, 1597, 1323, 1324, 1345, 1346, |
57 1330, 1331, 1458, 1459 }; // get ids by debugging FixCalculation line 73 (constructor) | 93 1330, 1331, 1458, 1459 }; |
58 | 94 |
59 new BunduBezugswstRunner(FilenameMapper.BEZUGSWST_FILE, 670., 710., 100, River.Rhein, 2015, "state.bundu.wst.fix.auto", abflussklasseFrom, | 95 new BunduBezugswstRunner(FilenameMapper.BEZUGSWST_FILE, 670., 710., 100, River.Rhein, 2015, fixChoice, function, abflussklasseFrom, abflussklasseTo, |
60 abflussklasseTo, events, 10, segments, "state.bundu.wst.calc.auto", false, "single-95") | 96 events, 10, segments, calcChoice, false, sounding).runTest(overrideFileExport() != null ? overrideFileExport() : true); |
61 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
62 } | 97 } |
63 } | 98 } |