Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs =================================================================== diff -u -r7a7964c2eb9844cb44c4c02a807bae60e67c4bfe -rc7da0846a135f849273407e16fe52237371e8f7a --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs (.../ClosingStructuresInput.cs) (revision 7a7964c2eb9844cb44c4c02a807bae60e67c4bfe) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresInput.cs (.../ClosingStructuresInput.cs) (revision c7da0846a135f849273407e16fe52237371e8f7a) @@ -32,6 +32,9 @@ namespace Ringtoets.ClosingStructures.Data { + /// + /// Class that holds all closing structures calculation specific input parameters. + /// public class ClosingStructuresInput : Observable, ICalculationInput { private readonly NormalDistribution modelFactorSuperCriticalFlow; @@ -55,6 +58,9 @@ private RoundedDouble deviationWaveDirection; private ForeshoreProfile foreshoreProfile; + /// + /// Creates a new instance of the class. + /// public ClosingStructuresInput() { structureNormalOrientation = new RoundedDouble(2); @@ -137,12 +143,95 @@ UpdateForeshoreProperties(); } - #region Hydraulic Boundary Location + #region Hydraulic load and data properties public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; set; } + #region Foreshore Profile + + /// + /// Gets or sets the foreshore profile. + /// + public ForeshoreProfile ForeshoreProfile + { + get + { + return foreshoreProfile; + } + set + { + foreshoreProfile = value; + UpdateForeshoreProperties(); + } + } + + /// + /// Gets or sets whether the needs to be taken into account. + /// + public bool UseBreakWater { get; set; } + + /// + /// Gets or sets whether the needs to be taken into account. + /// + public bool UseForeshore { get; set; } + + /// + /// Gets the geometry of the foreshore. + /// + public RoundedPoint2DCollection ForeshoreGeometry + { + get + { + return foreshoreProfile != null + ? foreshoreProfile.Geometry + : new RoundedPoint2DCollection(2, Enumerable.Empty()); + } + } + + /// + /// Gets the . + /// + public BreakWater BreakWater { get; private set; } + + private void UpdateForeshoreProperties() + { + if (foreshoreProfile == null) + { + UseForeshore = false; + UseBreakWater = false; + BreakWater = GetDefaultBreakWaterProperties(); + } + else + { + UseForeshore = foreshoreProfile.Geometry.Count() > 1; + UseBreakWater = foreshoreProfile.HasBreakWater; + BreakWater = foreshoreProfile.HasBreakWater ? + new BreakWater(foreshoreProfile.BreakWater.Type, foreshoreProfile.BreakWater.Height) : + GetDefaultBreakWaterProperties(); + } + } + + private BreakWater GetDefaultBreakWaterProperties() + { + return new BreakWater(BreakWaterType.Dam, 0.0); + } + #endregion + #endregion + + #region Model inputs + + #endregion + + #region Schematization + + #endregion + + #region Hydraulic Boundary Location + + #endregion + #region Structure properties /// @@ -176,11 +265,10 @@ } set { - RoundedDouble newOrientationValue = value.ToPrecision(structureNormalOrientation.NumberOfDecimalPlaces); newOrientationValue = ValidateStructureNormalOrientationInRange(newOrientationValue); - structureNormalOrientation = newOrientationValue; + structureNormalOrientation = newOrientationValue; } } @@ -236,7 +324,7 @@ } set { - if (value < 0 || value > 1) + if (!ValidProbabilityValue(value)) { throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } @@ -257,7 +345,7 @@ } set { - if (value < 0 || value > 1) + if (!ValidProbabilityValue(value)) { throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } @@ -278,7 +366,7 @@ } set { - if (value < 0 || value > 1) + if (!ValidProbabilityValue(value)) { throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } @@ -314,7 +402,7 @@ } set { - if (value < 0 || value > 1) + if (!ValidProbabilityValue(value)) { throw new ArgumentException(RingtoetsCommonDataResources.FailureProbability_Value_needs_to_be_between_0_and_1); } @@ -375,7 +463,7 @@ } /// - /// Gets or sets the area flow apertures normal distribution. + /// Gets or sets the area flow apertures. /// public LogNormalDistribution AreaFlowApertures { @@ -391,7 +479,7 @@ } /// - /// Gets or sets the level crest of structure not closing normal distribution. + /// Gets or sets the level crest of structure not closing. /// public NormalDistribution LevelCrestStructureNotClosing { @@ -407,7 +495,7 @@ } /// - /// Gets or sets the water level inside normal distribution. + /// Gets or sets the inside water level. /// public NormalDistribution InsideWaterLevel { @@ -423,7 +511,7 @@ } /// - /// Gets or sets the allowable increase of level for storage log normal distribution. + /// Gets or sets the allowable increase of level for storage. /// public LogNormalDistribution AllowedLevelIncreaseStorage { @@ -439,7 +527,7 @@ } /// - /// Gets or sets the storage structure area log normal distribution. + /// Gets or sets the storage structure area. /// public LogNormalDistribution StorageStructureArea { @@ -455,7 +543,7 @@ } /// - /// Gets or sets the flow widt at bottom protection log normal distribution. + /// Gets or sets the flow widt at bottom protection. /// public LogNormalDistribution FlowWidthAtBottomProtection { @@ -471,7 +559,7 @@ } /// - /// Gets or sets the critical overtopping discharge normal distribution. + /// Gets or sets the critical overtopping discharge. /// public LogNormalDistribution CriticalOverToppingDischarge { @@ -487,7 +575,7 @@ } /// - /// Gets or sets the width of flow apertures normal distribution. + /// Gets or sets the width of flow apertures. /// public NormalDistribution WidthFlowApertures { @@ -520,75 +608,9 @@ #endregion - #region Foreshore Profile - - /// - /// Gets or sets the foreshore profile. - /// - public ForeshoreProfile ForeshoreProfile + private bool ValidProbabilityValue(double probability) { - get - { - return foreshoreProfile; - } - set - { - foreshoreProfile = value; - UpdateForeshoreProperties(); - } + return !double.IsNaN(probability) && probability <= 1 && probability >= 0; } - - /// - /// Gets or sets whether the needs to be taken into account. - /// - public bool UseBreakWater { get; set; } - - /// - /// Gets or sets whether the needs to be taken into account. - /// - public bool UseForeshore { get; set; } - - /// - /// Gets the geometry of the foreshore. - /// - public RoundedPoint2DCollection ForeshoreGeometry - { - get - { - return foreshoreProfile != null - ? foreshoreProfile.Geometry - : new RoundedPoint2DCollection(2, Enumerable.Empty()); - } - } - - /// - /// Gets the . - /// - public BreakWater BreakWater { get; private set; } - - private void UpdateForeshoreProperties() - { - if (foreshoreProfile == null) - { - UseForeshore = false; - UseBreakWater = false; - BreakWater = GetDefaultBreakWaterProperties(); - } - else - { - UseForeshore = foreshoreProfile.Geometry.Count() > 1; - UseBreakWater = foreshoreProfile.HasBreakWater; - BreakWater = foreshoreProfile.HasBreakWater ? - new BreakWater(foreshoreProfile.BreakWater.Type, foreshoreProfile.BreakWater.Height) : - GetDefaultBreakWaterProperties(); - } - } - - private BreakWater GetDefaultBreakWaterProperties() - { - return new BreakWater(BreakWaterType.Dam, 0.0); - } - - #endregion } } \ No newline at end of file