comparison artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BezugswstCalculation.java @ 9444:ecadc9ed0ba0

Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
author mschaefer
date Tue, 21 Aug 2018 13:41:18 +0200
parents d2f5375ede26
children e60584f2a531
comparison
equal deleted inserted replaced
9443:515643b2c49a 9444:ecadc9ed0ba0
32 import org.dive4elements.river.artifacts.sinfo.tkhstate.WinfoArtifactWrapper; 32 import org.dive4elements.river.artifacts.sinfo.tkhstate.WinfoArtifactWrapper;
33 import org.dive4elements.river.artifacts.sinfo.util.CalculationUtils; 33 import org.dive4elements.river.artifacts.sinfo.util.CalculationUtils;
34 import org.dive4elements.river.artifacts.sinfo.util.RiverInfo; 34 import org.dive4elements.river.artifacts.sinfo.util.RiverInfo;
35 import org.dive4elements.river.artifacts.sinfo.util.WstInfo; 35 import org.dive4elements.river.artifacts.sinfo.util.WstInfo;
36 import org.dive4elements.river.exports.WaterlevelDescriptionBuilder; 36 import org.dive4elements.river.exports.WaterlevelDescriptionBuilder;
37 import org.dive4elements.river.model.BedHeightValueType;
37 import org.dive4elements.river.model.River; 38 import org.dive4elements.river.model.River;
38 import org.dive4elements.river.utils.Formatter; 39 import org.dive4elements.river.utils.Formatter;
39 40
40 class BezugswstCalculation { 41 class BezugswstCalculation {
41 42
222 row.putValue(BunduResultType.channelDepth, channelDepth); 223 row.putValue(BunduResultType.channelDepth, channelDepth);
223 if (!Double.isNaN(w) && !Double.isNaN(channelDepth)) 224 if (!Double.isNaN(w) && !Double.isNaN(channelDepth))
224 row.putValue(BunduResultType.channelLowerEdge, Formatter.roundFlowDepth(w).subtract(Formatter.roundFlowDepth(channelDepth)).doubleValue()); 225 row.putValue(BunduResultType.channelLowerEdge, Formatter.roundFlowDepth(w).subtract(Formatter.roundFlowDepth(channelDepth)).doubleValue());
225 else 226 else
226 row.putValue(BunduResultType.channelLowerEdge, Double.NaN); 227 row.putValue(BunduResultType.channelLowerEdge, Double.NaN);
228 final List<Double> fieldHeights = new ArrayList<>();
229 final List<Double> fieldDepths = new ArrayList<>();
230 for (int i = BedHeightValueType.FIELD_FIRST_INDEX; i <= BedHeightValueType.FIELD_LAST_INDEX; i++) {
231 final double h = bedHeightsFinder.getFieldHeight(station, i);
232 fieldHeights.add(Double.valueOf(h));
233 fieldDepths.add(w - h);
234 }
235 row.putValue(BunduResultType.bedHeightFields, fieldHeights);
236 row.putValue(BunduResultType.depthFields, fieldDepths);
227 return row; 237 return row;
228 } 238 }
229 } 239 }

http://dive4elements.wald.intevation.org