Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs =================================================================== diff -u -r9850308f656f62eb130bc70debd17f588b1ae4a5 -r8142644ec1337be8032e9214b1f103c85d9037f7 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision 9850308f656f62eb130bc70debd17f588b1ae4a5) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision 8142644ec1337be8032e9214b1f103c85d9037f7) @@ -44,6 +44,8 @@ private RoundedDouble exitPointL; private RoundedDouble entryPointL; private RingtoetsPipingSurfaceLine surfaceLine; + private HydraulicBoundaryLocation hydraulicBoundaryLocation; + private RoundedDouble assessmentLevel; /// /// Initializes a new instance of the class. @@ -73,6 +75,8 @@ Mean = (RoundedDouble) 0.7, StandardDeviation = (RoundedDouble) 0.1 }; + + assessmentLevel = new RoundedDouble(2, double.NaN); } /// @@ -182,7 +186,18 @@ /// /// Gets or sets the hydraulic boundary location from which to use the assessment level. /// - public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; set; } + public HydraulicBoundaryLocation HydraulicBoundaryLocation + { + get + { + return hydraulicBoundaryLocation; + } + set + { + hydraulicBoundaryLocation = value; + UpdateAssessmentLevel(); + } + } private void ValidateEntryExitPoint(RoundedDouble entryPointLocalXCoordinate, RoundedDouble exitPointLocalXCoordinate) { @@ -234,6 +249,13 @@ } } + private void UpdateAssessmentLevel() + { + assessmentLevel = hydraulicBoundaryLocation != null + ? hydraulicBoundaryLocation.DesignWaterLevel + : new RoundedDouble(2, double.NaN); + } + #region Derived input /// @@ -244,8 +266,12 @@ { get { - return new DerivedPipingInput(this).AssessmentLevel; + return assessmentLevel; } + set + { + assessmentLevel = value.ToPrecision(assessmentLevel.NumberOfDecimalPlaces); + } } ///