comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationCalculator.java @ 9631:6ecd1a28017f

Nachtrag Pos. 20: Q theme for height chart added, calculator corrected (rows for km without any infrastructure)
author mschaefer
date Tue, 15 Oct 2019 12:26:13 +0200
parents 07f02019065e
children
comparison
equal deleted inserted replaced
9630:8da911b5169c 9631:6ecd1a28017f
112 final WstValueTable wst = WstValueTableFactory.getTable(this.riverInfoProvider2.getRiver()); 112 final WstValueTable wst = WstValueTableFactory.getTable(this.riverInfoProvider2.getRiver());
113 113
114 final Set<FloodDurationInfrastructureChoice> infrastructures = new HashSet<>(); 114 final Set<FloodDurationInfrastructureChoice> infrastructures = new HashSet<>();
115 115
116 // Create the result rows, and calculate and add the flood durations etc. 116 // Create the result rows, and calculate and add the flood durations etc.
117 ResultRow row;
118 boolean starting;
117 for (int i = 0; i <= stationsSorted.length - 1; i++) { 119 for (int i = 0; i <= stationsSorted.length - 1; i++) {
118 final Gauge gauge = this.riverInfoProvider2.getGauge(stationsSorted[i], true); 120 final Gauge gauge = this.riverInfoProvider2.getGauge(stationsSorted[i], true);
121 row = createRow(stationsSorted[i], wqkmsArray, gaugeWstDurations.get(gauge), i);
122 starting = true;
119 if (this.stationInfras.containsKey(stationsSorted[i])) { 123 if (this.stationInfras.containsKey(stationsSorted[i])) {
120 for (final InfrastructureValue infra : this.stationInfras.get(stationsSorted[i])) { 124 for (final InfrastructureValue infra : this.stationInfras.get(stationsSorted[i])) {
121 final ResultRow row = createRow(stationsSorted[i], wqkmsArray, gaugeWstDurations.get(gauge), i); 125 if (!starting)
126 row = createRow(stationsSorted[i], wqkmsArray, gaugeWstDurations.get(gauge), i);
122 calculateInfrastructure(row, gauge, infra, wst, durFinders, infrastructures); 127 calculateInfrastructure(row, gauge, infra, wst, durFinders, infrastructures);
123 this.rows.add(row); 128 this.rows.add(row);
129 starting = false;
124 } 130 }
125 } 131 }
132 if (starting)
133 this.rows.add(row);
126 } 134 }
127 135
128 // Get the labels of the selected waterlevels 136 // Get the labels of the selected waterlevels
129 final String[] wstLabels = new String[wqkmsArray.length]; 137 final String[] wstLabels = new String[wqkmsArray.length];
130 for (int i = 0; i <= wqkmsArray.length - 1; i++) 138 for (int i = 0; i <= wqkmsArray.length - 1; i++)

http://dive4elements.wald.intevation.org