Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs =================================================================== diff -u -r9b3a37b954fab3dd61b73794d641d709b609dcc5 -r45b29eccca0f5d21a82f7c4ac07abc17acc0df59 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs (.../GrassCoverErosionInwardsInput.cs) (revision 9b3a37b954fab3dd61b73794d641d709b609dcc5) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs (.../GrassCoverErosionInwardsInput.cs) (revision 45b29eccca0f5d21a82f7c4ac07abc17acc0df59) @@ -38,6 +38,7 @@ private readonly LogNormalDistribution criticalFlowRate; private RoundedDouble orientation; private RoundedDouble dikeHeight; + private DikeProfile dikeProfile; /// /// Creates a new instance of . @@ -46,64 +47,76 @@ { orientation = new RoundedDouble(2); dikeHeight = new RoundedDouble(2); - BreakWater = new BreakWater(BreakWaterType.Caisson, 0); + + UpdateProfileParameters(); + criticalFlowRate = new LogNormalDistribution(4) { Mean = (RoundedDouble) 0.004, StandardDeviation = (RoundedDouble) 0.0006 }; + DikeGeometry = Enumerable.Empty(); ForeshoreGeometry = Enumerable.Empty(); } /// - /// Gets the dike's geometry (without foreshore geometry). + /// Gets or set the dike profile. /// - public IEnumerable DikeGeometry { get; private set; } - - /// - /// Gets the dike's foreshore geometry. - /// - public IEnumerable ForeshoreGeometry { get; private set; } - - /// - /// Gets or sets the dike's orientation - /// - public RoundedDouble Orientation + public DikeProfile DikeProfile { get { - return orientation; + return dikeProfile; } set { - orientation = value.ToPrecision(orientation.NumberOfDecimalPlaces); + dikeProfile = value; + UpdateProfileParameters(); } } /// - /// Gets or sets the dike's critical flow rate. + /// Gets or sets the dike's orientation /// - public LogNormalDistribution CriticalFlowRate + public RoundedDouble Orientation { get { - return criticalFlowRate; + return orientation; } set { - criticalFlowRate.Mean = value.Mean; - criticalFlowRate.StandardDeviation = value.StandardDeviation; + orientation = value.ToPrecision(orientation.NumberOfDecimalPlaces); } } /// - /// Gets or sets if needs to be taken into account. + /// Gets or sets if the needs to be taken into account. /// - /// Value of must not be reset when is set to false. public bool UseForeshore { get; set; } /// + /// Gets the geometry of the foreshore. + /// + public IEnumerable ForeshoreGeometry { get; private set; } + + /// + /// Gets or sets if needs to be taken into account. + /// + public bool UseBreakWater { get; set; } + + /// + /// Gets the . + /// + public BreakWater BreakWater { get; private set; } + + /// + /// Gets the geometry of the dike with roughness data. + /// + public IEnumerable DikeGeometry { get; private set; } + + /// /// Gets or sets the dike height. /// public RoundedDouble DikeHeight @@ -119,16 +132,22 @@ } /// - /// Gets or sets if needs to be taken into account. + /// Gets or sets the dike's critical flow rate. /// - public bool UseBreakWater { get; set; } + public LogNormalDistribution CriticalFlowRate + { + get + { + return criticalFlowRate; + } + set + { + criticalFlowRate.Mean = value.Mean; + criticalFlowRate.StandardDeviation = value.StandardDeviation; + } + } /// - /// Gets the . - /// - public BreakWater BreakWater { get; private set; } - - /// /// Gets or set the hydraulic boundary location from which to use the assessment level. /// public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; set; } @@ -158,5 +177,32 @@ } ForeshoreGeometry = profileSections; } + + private void UpdateProfileParameters() + { + if (dikeProfile == null) + { + Orientation = (RoundedDouble) 0.0; + UseForeshore = false; + UseBreakWater = false; + BreakWater = GetDefaultBreakWater(); + DikeHeight = (RoundedDouble) 0.0; + } + else + { + Orientation = dikeProfile.Orientation; + UseForeshore = dikeProfile.ForeshoreGeometry.Any(); + UseBreakWater = dikeProfile.HasBreakWater; + BreakWater = dikeProfile.HasBreakWater + ? new BreakWater(dikeProfile.BreakWater.Type, dikeProfile.BreakWater.Height) + : GetDefaultBreakWater(); + DikeHeight = dikeProfile.CrestLevel; + } + } + + private static BreakWater GetDefaultBreakWater() + { + return new BreakWater(BreakWaterType.Dam, 0.0); + } } } \ No newline at end of file