Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs =================================================================== diff -u -ra8ffe20fbe684f5020f5158354b33fad488baac9 -r547267b70fbf09e80c59b252b4660300cc370c74 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs (.../HeightStructuresInput.cs) (revision a8ffe20fbe684f5020f5158354b33fad488baac9) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs (.../HeightStructuresInput.cs) (revision 547267b70fbf09e80c59b252b4660300cc370c74) @@ -185,6 +185,10 @@ /// /// Gets or sets the orientation of the normal of the structure. /// + /// + /// 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 OrientationOfTheNormalOfTheStructure { get @@ -193,10 +197,30 @@ } set { - orientationOfTheNormalOfTheStructure = value.ToPrecision(orientationOfTheNormalOfTheStructure.NumberOfDecimalPlaces); + RoundedDouble newOrientationValue = value.ToPrecision(orientationOfTheNormalOfTheStructure.NumberOfDecimalPlaces); + newOrientationValue = ValidateStructureNormalOrientationInRange(newOrientationValue); + + orientationOfTheNormalOfTheStructure = newOrientationValue; } } + private RoundedDouble ValidateStructureNormalOrientationInRange(RoundedDouble newOrientationValue) + { + const double upperBoundaryRange = 360; + const double lowerBoundaryRange = 0.0; + + if (newOrientationValue > upperBoundaryRange) + { + newOrientationValue = new RoundedDouble(2, upperBoundaryRange); + } + else if (newOrientationValue < lowerBoundaryRange) + { + newOrientationValue = new RoundedDouble(2, lowerBoundaryRange); + } + + return newOrientationValue; + } + /// /// Gets or sets the allowable increase of level for the storage. ///