Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepthdev/FlowDepthDevelopmentCalculation.java @ 8997:d5802f22e4f5
Work on uinfo
author | gernotbelger |
---|---|
date | Thu, 12 Apr 2018 19:14:19 +0200 |
parents | b194fa64506a |
children | 5294114b1df4 |
comparison
equal
deleted
inserted
replaced
8996:fb9430250899 | 8997:d5802f22e4f5 |
---|---|
13 import java.util.Collection; | 13 import java.util.Collection; |
14 import java.util.TreeSet; | 14 import java.util.TreeSet; |
15 | 15 |
16 import org.apache.commons.lang.math.DoubleRange; | 16 import org.apache.commons.lang.math.DoubleRange; |
17 import org.dive4elements.artifacts.CallContext; | 17 import org.dive4elements.artifacts.CallContext; |
18 import org.dive4elements.river.artifacts.common.GeneralResultType; | |
19 import org.dive4elements.river.artifacts.common.ResultRow; | |
18 import org.dive4elements.river.artifacts.model.Calculation; | 20 import org.dive4elements.river.artifacts.model.Calculation; |
19 import org.dive4elements.river.artifacts.model.CalculationResult; | 21 import org.dive4elements.river.artifacts.model.CalculationResult; |
20 import org.dive4elements.river.artifacts.model.WKms; | 22 import org.dive4elements.river.artifacts.model.WKms; |
21 import org.dive4elements.river.artifacts.resources.Resources; | 23 import org.dive4elements.river.artifacts.resources.Resources; |
22 import org.dive4elements.river.artifacts.sinfo.SINFOArtifact; | 24 import org.dive4elements.river.artifacts.sinfo.SINFOArtifact; |
23 import org.dive4elements.river.artifacts.sinfo.common.RiverInfoProvider; | 25 import org.dive4elements.river.artifacts.sinfo.common.RiverInfoProvider; |
24 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultRow; | |
25 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultType; | 26 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultType; |
26 import org.dive4elements.river.artifacts.sinfo.flowdepth.FlowDepthUtils; | 27 import org.dive4elements.river.artifacts.sinfo.flowdepth.FlowDepthUtils; |
27 import org.dive4elements.river.artifacts.sinfo.flowdepth.WstSoundingIdPair; | 28 import org.dive4elements.river.artifacts.sinfo.flowdepth.WstSoundingIdPair; |
28 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.WaterlevelValuesFinder; | 29 import org.dive4elements.river.artifacts.sinfo.tkhcalculation.WaterlevelValuesFinder; |
29 import org.dive4elements.river.artifacts.sinfo.tkhstate.BedHeightsFinder; | 30 import org.dive4elements.river.artifacts.sinfo.tkhstate.BedHeightsFinder; |
140 final int historcialMeanYear = (historicalWstYear + historicalSoundingYear) / 2; | 141 final int historcialMeanYear = (historicalWstYear + historicalSoundingYear) / 2; |
141 | 142 |
142 final double diffYear = currentMeanYear - historcialMeanYear; | 143 final double diffYear = currentMeanYear - historcialMeanYear; |
143 | 144 |
144 /* real calculation loop */ | 145 /* real calculation loop */ |
145 final Collection<SInfoResultRow> rows = new ArrayList<>(); | 146 final Collection< ResultRow> rows = new ArrayList<>(); |
146 | 147 |
147 final Collection<Double> stations = determineCalculationSteps(currentSounding, historicalSounding); | 148 final Collection<Double> stations = determineCalculationSteps(currentSounding, historicalSounding); |
148 for (final double station : stations) { | 149 for (final double station : stations) { |
149 if (calcRange.containsDouble(station)) { | 150 if (calcRange.containsDouble(station)) { |
150 | 151 |
169 final double historicalFlowDepth = historicalWst - historicalBedHeight; | 170 final double historicalFlowDepth = historicalWst - historicalBedHeight; |
170 | 171 |
171 // REMARK: access the location once only during calculation | 172 // REMARK: access the location once only during calculation |
172 final String location = currentRiverInfoProvider.getLocation(station); | 173 final String location = currentRiverInfoProvider.getLocation(station); |
173 | 174 |
174 final SInfoResultRow row = SInfoResultRow.create().// | 175 final ResultRow row = ResultRow.create().// |
175 putValue(SInfoResultType.station, station). // | 176 putValue(GeneralResultType.station, station). // |
176 putValue(SInfoResultType.flowdepthDevelopment, flowDepthDevelopment). // | 177 putValue(SInfoResultType.flowdepthDevelopment, flowDepthDevelopment). // |
177 putValue(SInfoResultType.flowdepthDevelopmentPerYear, flowDepthDevelopmentPerYear). // | 178 putValue(SInfoResultType.flowdepthDevelopmentPerYear, flowDepthDevelopmentPerYear). // |
178 putValue(SInfoResultType.waterlevelDifference, diffWst). // | 179 putValue(SInfoResultType.waterlevelDifference, diffWst). // |
179 putValue(SInfoResultType.bedHeightDifference, diffBedHeight). // | 180 putValue(SInfoResultType.bedHeightDifference, diffBedHeight). // |
180 putValue(SInfoResultType.flowdepthCurrent, currentFlowDepth). // | 181 putValue(SInfoResultType.flowdepthCurrent, currentFlowDepth). // |