Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/TkhCalculation.java @ 8996:fb9430250899
Work on uinfo
author | gernotbelger |
---|---|
date | Thu, 12 Apr 2018 19:13:39 +0200 |
parents | b194fa64506a |
children | 5488166d32ee |
comparison
equal
deleted
inserted
replaced
8995:8c3e5682cb60 | 8996:fb9430250899 |
---|---|
20 | 20 |
21 import org.apache.commons.lang.math.DoubleRange; | 21 import org.apache.commons.lang.math.DoubleRange; |
22 import org.apache.commons.lang.math.NumberRange; | 22 import org.apache.commons.lang.math.NumberRange; |
23 import org.dive4elements.artifacts.CallContext; | 23 import org.dive4elements.artifacts.CallContext; |
24 import org.dive4elements.river.artifacts.WINFOArtifact; | 24 import org.dive4elements.river.artifacts.WINFOArtifact; |
25 import org.dive4elements.river.artifacts.common.ResultRow; | |
25 import org.dive4elements.river.artifacts.model.Calculation; | 26 import org.dive4elements.river.artifacts.model.Calculation; |
26 import org.dive4elements.river.artifacts.model.Calculation.Problem; | 27 import org.dive4elements.river.artifacts.model.Calculation.Problem; |
27 import org.dive4elements.river.artifacts.model.CalculationResult; | 28 import org.dive4elements.river.artifacts.model.CalculationResult; |
28 import org.dive4elements.river.artifacts.model.WQKms; | 29 import org.dive4elements.river.artifacts.model.WQKms; |
29 import org.dive4elements.river.artifacts.resources.Resources; | 30 import org.dive4elements.river.artifacts.resources.Resources; |
30 import org.dive4elements.river.artifacts.sinfo.SINFOArtifact; | 31 import org.dive4elements.river.artifacts.sinfo.SINFOArtifact; |
31 import org.dive4elements.river.artifacts.sinfo.common.RiverInfoProvider; | 32 import org.dive4elements.river.artifacts.sinfo.common.RiverInfoProvider; |
32 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultRow; | |
33 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultType; | 33 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultType; |
34 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.DischargeValuesFinder; | 34 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.DischargeValuesFinder; |
35 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.TkhCalculator; | 35 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.TkhCalculator; |
36 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.WaterlevelValuesFinder; | 36 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.WaterlevelValuesFinder; |
37 import org.dive4elements.river.artifacts.sinfo.util.BedHeightInfo; | 37 import org.dive4elements.river.artifacts.sinfo.util.BedHeightInfo; |
149 if (calculatorsByRanges.isEmpty()) { | 149 if (calculatorsByRanges.isEmpty()) { |
150 /* there should already be some problems, so just abort */ | 150 /* there should already be some problems, so just abort */ |
151 return null; | 151 return null; |
152 } | 152 } |
153 | 153 |
154 final Collection<SInfoResultRow> rows = new ArrayList<>(); | 154 final Collection<ResultRow> rows = new ArrayList<>(); |
155 | 155 |
156 for (final Double stationDbl : allStations) { | 156 for (final Double stationDbl : allStations) { |
157 | 157 |
158 final double station = stationDbl; | 158 final double station = stationDbl; |
159 | 159 |
160 /* find the right calculator (i.e. bed height) depending on station, there should only be one maximal */ | 160 /* find the right calculator (i.e. bed height) depending on station, there should only be one maximal */ |
161 final TkhCalculator tkhCalculator = findCalculator(calculatorsByRanges, station); | 161 final TkhCalculator tkhCalculator = findCalculator(calculatorsByRanges, station); |
162 if (tkhCalculator == null) | 162 if (tkhCalculator == null) |
163 continue; | 163 continue; |
164 | 164 |
165 final SInfoResultRow row = SInfoResultRow.create(); | 165 final ResultRow row = ResultRow.create(); |
166 | 166 |
167 row.putValue(SInfoResultType.waterlevelLabel, descBuilder.getDesc(wkms)); | 167 row.putValue(SInfoResultType.waterlevelLabel, descBuilder.getDesc(wkms)); |
168 row.putValue(SInfoResultType.gaugeLabel, riverInfoProvider.findGauge(station)); | 168 row.putValue(SInfoResultType.gaugeLabel, riverInfoProvider.findGauge(station)); |
169 row.putValue(SInfoResultType.location, riverInfoProvider.getLocation(station)); | 169 row.putValue(SInfoResultType.location, riverInfoProvider.getLocation(station)); |
170 | 170 |