Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhcalculation/TkhCalculator.java @ 9503:83e6acdf8fc6
Fixed: no rounding during calculations (Meilenstein-2 2.9)
author | mschaefer |
---|---|
date | Fri, 28 Sep 2018 10:11:06 +0200 |
parents | 787fc085459b |
children | 23d97d60b889 |
comparison
equal
deleted
inserted
replaced
9502:69a7edd7d1e1 | 9503:83e6acdf8fc6 |
---|---|
14 import org.dive4elements.river.artifacts.common.ResultRow; | 14 import org.dive4elements.river.artifacts.common.ResultRow; |
15 import org.dive4elements.river.artifacts.model.Calculation; | 15 import org.dive4elements.river.artifacts.model.Calculation; |
16 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultType; | 16 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultType; |
17 import org.dive4elements.river.artifacts.sinfo.tkhstate.BedHeightsFinder; | 17 import org.dive4elements.river.artifacts.sinfo.tkhstate.BedHeightsFinder; |
18 import org.dive4elements.river.model.River; | 18 import org.dive4elements.river.model.River; |
19 import org.dive4elements.river.utils.Formatter; | |
20 | 19 |
21 /** | 20 /** |
22 * @author Gernot Belger | 21 * @author Gernot Belger |
23 */ | 22 */ |
24 public final class TkhCalculator { | 23 public final class TkhCalculator { |
138 final double meanBedHeight = this.bedHeightsProvider.getMeanBedHeight(km); | 137 final double meanBedHeight = this.bedHeightsProvider.getMeanBedHeight(km); |
139 row.putValue(SInfoResultType.meanBedHeight, meanBedHeight); | 138 row.putValue(SInfoResultType.meanBedHeight, meanBedHeight); |
140 if (Double.isNaN(meanBedHeight)) | 139 if (Double.isNaN(meanBedHeight)) |
141 return TkhCalculateState.NO_BED_HEIGHT; | 140 return TkhCalculateState.NO_BED_HEIGHT; |
142 | 141 |
143 final double flowDepth = Formatter.roundFlowDepth(wst).subtract(Formatter.roundFlowDepth(meanBedHeight)).doubleValue(); | 142 final double flowDepth = wst - meanBedHeight; |
144 row.putValue(SInfoResultType.flowdepth, flowDepth); | 143 row.putValue(SInfoResultType.flowdepth, flowDepth); |
145 | 144 |
146 final double discharge = this.dischargeProvider.getDischarge(km); | 145 final double discharge = this.dischargeProvider.getDischarge(km); |
147 row.putValue(SInfoResultType.discharge, discharge); | 146 row.putValue(SInfoResultType.discharge, discharge); |
148 | 147 |