Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs =================================================================== diff -u -r9d781268ca54cba6a02715876d34a775396407b5 -ra50f8fe4c13956d52e563e1f9e154f1bd186edad --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision 9d781268ca54cba6a02715876d34a775396407b5) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision a50f8fe4c13956d52e563e1f9e154f1bd186edad) @@ -44,8 +44,8 @@ private RoundedDouble exitPointL; private RoundedDouble entryPointL; private RingtoetsPipingSurfaceLine surfaceLine; - private HydraulicBoundaryLocation hydraulicBoundaryLocation; private RoundedDouble assessmentLevel; + private bool useAssessmentLevelManualInput; /// /// Initializes a new instance of the class. @@ -77,6 +77,7 @@ }; assessmentLevel = new RoundedDouble(2, double.NaN); + useAssessmentLevelManualInput = false; } /// @@ -186,16 +187,25 @@ /// /// Gets or sets the hydraulic boundary location from which to use the assessment level. /// - public HydraulicBoundaryLocation HydraulicBoundaryLocation + public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; set; } + + /// + /// Gets or sets whether the assessment level is manual input for the calculation. + /// + public bool UseAssessmentLevelManualInput { get { - return hydraulicBoundaryLocation; + return useAssessmentLevelManualInput; } set { - hydraulicBoundaryLocation = value; - UpdateAssessmentLevel(); + useAssessmentLevelManualInput = value; + + if (useAssessmentLevelManualInput) + { + HydraulicBoundaryLocation = null; + } } } @@ -249,18 +259,6 @@ } } - private void UpdateAssessmentLevel() - { - assessmentLevel = hydraulicBoundaryLocation != null - ? hydraulicBoundaryLocation.DesignWaterLevel - : new RoundedDouble(2, double.NaN); - } - - private void UpdateHydraulicBoundaryLocation() - { - hydraulicBoundaryLocation = null; - } - #region Derived input /// @@ -271,12 +269,18 @@ { get { + if (!UseAssessmentLevelManualInput) + { + return HydraulicBoundaryLocation != null + ? HydraulicBoundaryLocation.DesignWaterLevel + : new RoundedDouble(2, double.NaN); + } + return assessmentLevel; } set { assessmentLevel = value.ToPrecision(assessmentLevel.NumberOfDecimalPlaces); - UpdateHydraulicBoundaryLocation(); } }