comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java @ 9215:0fc9c82e744e

work on collison, flood_duration
author gernotbelger
date Tue, 03 Jul 2018 17:00:48 +0200
parents 3dae6b78e1da
children 0dcd1cd41915
comparison
equal deleted inserted replaced
9214:091fd9676496 9215:0fc9c82e744e
80 calcRange.getMaximumDouble(), bankKey); 80 calcRange.getMaximumDouble(), bankKey);
81 81
82 // Merge all stations (range/step, borders of gauge ranges, infrastructures) 82 // Merge all stations (range/step, borders of gauge ranges, infrastructures)
83 final Map<Double, InfrastructureValue> allStations = new HashMap<>(); 83 final Map<Double, InfrastructureValue> allStations = new HashMap<>();
84 final Map<Double, InfrastructureValue> secondBank = new HashMap<>(); // any second infrastructure in case of both-banks-option 84 final Map<Double, InfrastructureValue> secondBank = new HashMap<>(); // any second infrastructure in case of both-banks-option
85 // FIXME: check, do we really need all stations? compare with tkh...
85 addRangeStations(allStations, winfo); 86 addRangeStations(allStations, winfo);
86 addGaugeLimits(allStations, durFinders.keySet(), calcRange.getMinimumDouble(), calcRange.getMaximumDouble()); 87 addGaugeLimits(allStations, durFinders.keySet(), calcRange.getMinimumDouble(), calcRange.getMaximumDouble());
87 addInfrastructures(allStations, secondBank, infras); 88 addInfrastructures(allStations, secondBank, infras);
88 final double[] stationsSorted = sortStations(allStations.keySet()); 89 final double[] stationsSorted = sortStations(allStations.keySet());
89 90
195 // FIXME: use WaterlevelDescriptionBuilder instead! 196 // FIXME: use WaterlevelDescriptionBuilder instead!
196 private String[] findMainValueLabels(final WQKms[] wqkmsArray, final double[] qs, final Gauge gauge, final Calculation problems) { 197 private String[] findMainValueLabels(final WQKms[] wqkmsArray, final double[] qs, final Gauge gauge, final Calculation problems) {
197 198
198 final String[] mainValueLabels = new String[wqkmsArray.length]; 199 final String[] mainValueLabels = new String[wqkmsArray.length];
199 if (wqkmsArray.length >= 1) { 200 if (wqkmsArray.length >= 1) {
201
202 // FIXME
203 // WaterlevelDescriptionBuilder builder = new WaterlevelDescriptionBuilder(artifact, context);
204
200 // Labels like Q=123 or W=123 205 // Labels like Q=123 or W=123
201 for (int i = 0; i <= wqkmsArray.length - 1; i++) 206 for (int i = 0; i <= wqkmsArray.length - 1; i++) {
207 // FIXME
208 // String label = builder.getDesc(wqkmsArray[i]);
209
202 mainValueLabels[i] = wqkmsArray[i].getName(); 210 mainValueLabels[i] = wqkmsArray[i].getName();
211 }
203 // Replace labels for named main Q values 212 // Replace labels for named main Q values
204 final GaugeMainValueFinder zoneFinder = GaugeMainValueFinder.loadValues(MainValueTypeKey.Q, gauge, problems); 213 final GaugeMainValueFinder zoneFinder = GaugeMainValueFinder.loadValues(MainValueTypeKey.Q, gauge, problems);
205 if ((zoneFinder != null) && (qs != null)) { 214 if ((zoneFinder != null) && (qs != null)) {
206 for (int i = 0; i <= qs.length - 1; i++) 215 for (int i = 0; i <= qs.length - 1; i++)
207 mainValueLabels[i] = zoneFinder.findExactZoneName(qs[i], mainValueLabels[i]); 216 mainValueLabels[i] = zoneFinder.findExactZoneName(qs[i], mainValueLabels[i]);

http://dive4elements.wald.intevation.org