Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs =================================================================== diff -u -rde24943cc5de951dd42ba93671c9816046ae7607 -r68004dbc5a33be0b6343844bb6706ab2931cbe5c --- Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs (.../WaveConditionsInput.cs) (revision de24943cc5de951dd42ba93671c9816046ae7607) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs (.../WaveConditionsInput.cs) (revision 68004dbc5a33be0b6343844bb6706ab2931cbe5c) @@ -154,6 +154,7 @@ /// Gets or sets the lower boundary of the revetment. /// /// Thrown when value is larger than or equal to . + /// When the value is smaller than -50, it will be set to -50. public RoundedDouble LowerBoundaryRevetment { get @@ -164,6 +165,8 @@ { var newLowerBoundaryRevetment = value.ToPrecision(lowerBoundaryRevetment.NumberOfDecimalPlaces); + newLowerBoundaryRevetment = ValidateLowerBoundaryInRange(newLowerBoundaryRevetment); + ValidateRevetmentBoundaries(newLowerBoundaryRevetment, UpperBoundaryRevetment); lowerBoundaryRevetment = newLowerBoundaryRevetment; @@ -174,6 +177,7 @@ /// Gets or sets the upper boundary of the revetment. /// /// Thrown when value is smaller than or equal to . + /// When the value is larger than 1000, it will be set to 1000. public RoundedDouble UpperBoundaryRevetment { get @@ -184,6 +188,8 @@ { var newUpperBoundaryRevetment = value.ToPrecision(upperBoundaryRevetment.NumberOfDecimalPlaces); + newUpperBoundaryRevetment = ValidateUpperBoundaryInRange(newUpperBoundaryRevetment); + ValidateRevetmentBoundaries(LowerBoundaryRevetment, newUpperBoundaryRevetment); upperBoundaryRevetment = newUpperBoundaryRevetment; @@ -200,8 +206,11 @@ /// /// Thrown when value is larger than or equal to . /// - /// Setting this property is optional when it comes to determining ; if the value - /// equals , only will be taken into account. + /// + /// Setting this property is optional when it comes to determining ; if the value + /// equals , only will be taken into account. + /// When the value is smaller than -50, it will be set to -50. + /// /// public RoundedDouble LowerBoundaryWaterLevels { @@ -213,6 +222,8 @@ { var newLowerBoundaryWaterLevels = value.ToPrecision(lowerBoundaryWaterLevels.NumberOfDecimalPlaces); + newLowerBoundaryWaterLevels = ValidateLowerBoundaryInRange(newLowerBoundaryWaterLevels); + ValidateWaterLevelBoundaries(newLowerBoundaryWaterLevels, UpperBoundaryWaterLevels); lowerBoundaryWaterLevels = newLowerBoundaryWaterLevels; @@ -224,9 +235,12 @@ /// /// Thrown when value is smaller than or equal to . /// - /// Setting this property is optional when it comes to determining ; if the value + /// + /// Setting this property is optional when it comes to determining ; if the value /// equals , only and - /// will be taken into account. + /// will be taken into account. + /// When the value is larger than 1000, it will be set to 1000. + /// /// public RoundedDouble UpperBoundaryWaterLevels { @@ -238,6 +252,8 @@ { var newUpperBoundaryWaterLevels = value.ToPrecision(upperBoundaryWaterLevels.NumberOfDecimalPlaces); + newUpperBoundaryWaterLevels = ValidateUpperBoundaryInRange(newUpperBoundaryWaterLevels); + ValidateWaterLevelBoundaries(LowerBoundaryWaterLevels, newUpperBoundaryWaterLevels); upperBoundaryWaterLevels = newUpperBoundaryWaterLevels; @@ -255,6 +271,24 @@ } } + private static RoundedDouble ValidateUpperBoundaryInRange(RoundedDouble boundary) + { + if (boundary > 1000) + { + boundary = new RoundedDouble(boundary.NumberOfDecimalPlaces, 1000); + } + return boundary; + } + + private static RoundedDouble ValidateLowerBoundaryInRange(RoundedDouble boundary) + { + if (boundary < -50) + { + boundary = new RoundedDouble(boundary.NumberOfDecimalPlaces, -50); + } + return boundary; + } + private static void ValidateRevetmentBoundaries(RoundedDouble lowerBoundary, RoundedDouble upperBoundary) { ValidateBoundaries(lowerBoundary, upperBoundary, Resources.WaveConditionsInput_ValidateRevetmentBoundaries_Upper_boundary_revetment_must_be_above_lower_boundary_revetment);