Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/PipingStructureFailureMechanism.cs =================================================================== diff -u -r0320ab3a413cb6a55e3f615d8c62706a48121588 -r4e11185058b30d0fc525382d015112be4a2e84f8 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/PipingStructureFailureMechanism.cs (.../PipingStructureFailureMechanism.cs) (revision 0320ab3a413cb6a55e3f615d8c62706a48121588) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/PipingStructureFailureMechanism.cs (.../PipingStructureFailureMechanism.cs) (revision 4e11185058b30d0fc525382d015112be4a2e84f8) @@ -19,11 +19,14 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; +using Core.Common.Base.Data; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Integration.Data.Properties; using Ringtoets.Integration.Data.StandAlone.SectionResults; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; namespace Ringtoets.Integration.Data.StandAlone { @@ -33,7 +36,13 @@ /// public class PipingStructureFailureMechanism : FailureMechanismBase, IHasSectionResults { + private const int numberOfDecimalPlacesN = 2; + + private static readonly Range validityRangeN = new Range(new RoundedDouble(numberOfDecimalPlacesN, 1), + new RoundedDouble(numberOfDecimalPlacesN, 20)); + private readonly List sectionResults; + private RoundedDouble n; /// /// Initializes a new instance of the class. @@ -42,6 +51,7 @@ : base(Resources.PipingStructureFailureMechanism_DisplayName, Resources.PipingStructureFailureMechanism_Code) { sectionResults = new List(); + n = new RoundedDouble(numberOfDecimalPlacesN, 1.0); } public override IEnumerable Calculations @@ -52,6 +62,25 @@ } } + public RoundedDouble N + { + get + { + return n; + } + set + { + RoundedDouble newValue = value.ToPrecision(n.NumberOfDecimalPlaces); + if (!validityRangeN.InRange(newValue)) + { + throw new ArgumentOutOfRangeException(nameof(value), string.Format(RingtoetsCommonDataResources.N_Value_should_be_in_Range_0_, + validityRangeN)); + } + + n = newValue; + } + } + public IEnumerable SectionResults { get