Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs =================================================================== diff -u -rf53b435bc3cb5fb70ffac3844ae56e90373cf4d3 -rf6499e54fc85bea790ed538103f34948f8285fbf --- Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs (.../WaveConditionsInput.cs) (revision f53b435bc3cb5fb70ffac3844ae56e90373cf4d3) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs (.../WaveConditionsInput.cs) (revision f6499e54fc85bea790ed538103f34948f8285fbf) @@ -99,6 +99,11 @@ /// Gets or sets the orientation of the foreshore profile geometry with respect to North /// in degrees. A positive value equals a clockwise rotation. /// + /// + /// When the value is smaller than 0, it will be set to 0. + /// When the value is larger than 360, it will be set to 360. + /// + /// public RoundedDouble Orientation { get @@ -107,7 +112,11 @@ } set { - orientation = value.ToPrecision(orientation.NumberOfDecimalPlaces); + var newOrientation = value.ToPrecision(orientation.NumberOfDecimalPlaces); + + newOrientation = ValidateOrientationInRange(newOrientation); + + orientation = newOrientation; } } @@ -271,6 +280,24 @@ } } + private RoundedDouble ValidateOrientationInRange(RoundedDouble newOrientation) + { + const int lowerBoundaryRange = 0; + const int upperBoundaryRange = 360; + + if (newOrientation < lowerBoundaryRange) + { + newOrientation = new RoundedDouble(2); + } + + if (newOrientation > upperBoundaryRange) + { + newOrientation = new RoundedDouble(2, upperBoundaryRange); + } + + return newOrientation; + } + private static RoundedDouble ValidateUpperBoundaryInRange(RoundedDouble boundary) { if (boundary > 1000)