Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/BreakWaterType.cs =================================================================== diff -u -rd847955b7a8b9bd4cd80c5e10e6a055c9d5daa8b -r2e826fe82412e8333f9d4cb2e2eece2f3b3c6509 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/BreakWaterType.cs (.../BreakWaterType.cs) (revision d847955b7a8b9bd4cd80c5e10e6a055c9d5daa8b) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/BreakWaterType.cs (.../BreakWaterType.cs) (revision 2e826fe82412e8333f9d4cb2e2eece2f3b3c6509) @@ -29,16 +29,16 @@ /// /// A wall. /// - Wall, + Wall = 1, /// /// A watertight retaining structure. /// - Caisson, + Caisson = 2, /// /// A barrier that impounds water or underground streams. /// - Dam + Dam = 3 } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs =================================================================== diff -u -r4af59f05cb6ced6464d51c8dff8cb0b8bfca8edd -r2e826fe82412e8333f9d4cb2e2eece2f3b3c6509 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs (.../GrassCoverErosionInwardsInput.cs) (revision 4af59f05cb6ced6464d51c8dff8cb0b8bfca8edd) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs (.../GrassCoverErosionInwardsInput.cs) (revision 2e826fe82412e8333f9d4cb2e2eece2f3b3c6509) @@ -38,6 +38,14 @@ private IEnumerable geometry; /// + /// Creates a new instance of . + /// + public GrassCoverErosionInwardsInput() + { + BreakWater = new List(); + } + + /// /// The dike's geometry (without foreshore geometry). /// public IEnumerable DikeGeometry @@ -76,9 +84,14 @@ public bool ForeshorePresent { get; set; } /// + /// Gets or sets the dike height. + /// + public double DikeHeight { get; set; } + + /// /// Gets or sets the number of profile points of the dike geometry that form the foreshore geometry. /// - public int ForeshoreDikeGeometryPoints { get; set; } + public int ForeshoreDikeGeometryPoints { get; private set; } /// /// Defines if needs to be taken into account. @@ -88,7 +101,7 @@ /// /// Gets or sets the . /// - public BreakWater BreakWater { get; set; } + public IEnumerable BreakWater { get; set; } /// /// Gets or set the hydraulic boundary location from which to use the assessment level. Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsOutput.cs =================================================================== diff -u -rd847955b7a8b9bd4cd80c5e10e6a055c9d5daa8b -r2e826fe82412e8333f9d4cb2e2eece2f3b3c6509 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsOutput.cs (.../GrassCoverErosionInwardsOutput.cs) (revision d847955b7a8b9bd4cd80c5e10e6a055c9d5daa8b) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsOutput.cs (.../GrassCoverErosionInwardsOutput.cs) (revision 2e826fe82412e8333f9d4cb2e2eece2f3b3c6509) @@ -28,6 +28,10 @@ /// public class GrassCoverErosionInwardsOutput { + private RoundedDouble probability; + private RoundedDouble reliability; + private RoundedDouble factorOfSafety; + /// /// Creates a new instance of . /// @@ -40,9 +44,9 @@ { RequiredProbability = new RoundedDouble(2, requiredProbability); RequiredReliability = new RoundedDouble(3, requiredReliability); - Probability = new RoundedDouble(2, probability); - Reliability = new RoundedDouble(3, reliability); - FactorOfSafety = new RoundedDouble(3, factorOfSafety); + this.probability = new RoundedDouble(2, probability); + this.reliability = new RoundedDouble(3, reliability); + this.factorOfSafety = new RoundedDouble(3, factorOfSafety); } /// @@ -58,16 +62,46 @@ /// /// Gets the factor of safety of the failure mechanism. /// - public RoundedDouble FactorOfSafety { get; private set; } + public RoundedDouble FactorOfSafety + { + get + { + return factorOfSafety; + } + set + { + factorOfSafety = value.ToPrecision(factorOfSafety.NumberOfDecimalPlaces); + } + } /// /// Gets the reliability of the failure mechanism. /// - public RoundedDouble Reliability { get; private set; } + public RoundedDouble Reliability + { + get + { + return reliability; + } + set + { + reliability = value.ToPrecision(reliability.NumberOfDecimalPlaces); + } + } /// /// Gets the probability of failing.. /// - public RoundedDouble Probability { get; private set; } + public RoundedDouble Probability + { + get + { + return probability; + } + set + { + probability = value.ToPrecision(probability.NumberOfDecimalPlaces); + } + } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs =================================================================== diff -u -r684b8c0ca681ea2da3cc988bd60e9223037e5a16 -r2e826fe82412e8333f9d4cb2e2eece2f3b3c6509 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs (.../GrassCoverErosionInwardsGuiPlugin.cs) (revision 684b8c0ca681ea2da3cc988bd60e9223037e5a16) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs (.../GrassCoverErosionInwardsGuiPlugin.cs) (revision 2e826fe82412e8333f9d4cb2e2eece2f3b3c6509) @@ -19,14 +19,23 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; +using System.Linq; +using Core.Common.Base.Data; using Core.Common.Controls.TreeView; using Core.Common.Gui.Plugin; - using Ringtoets.Common.Forms.TreeNodeInfos; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects; +using Ringtoets.GrassCoverErosionInwards.Plugin.Properties; +using Ringtoets.HydraRing.Calculation.Activities; +using Ringtoets.HydraRing.Calculation.Data; +using Ringtoets.HydraRing.Calculation.Data.Input.Overtopping; +using Ringtoets.HydraRing.Calculation.Data.Output; +using Ringtoets.HydraRing.Data; using GrassCoverErosionInwardsFormsResources = Ringtoets.GrassCoverErosionInwards.Forms.Properties.Resources; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.GrassCoverErosionInwards.Plugin { @@ -39,5 +48,78 @@ { yield return new DefaultFailureMechanismTreeNodeInfo(null, null, Gui); } + + private static ExceedanceProbabilityCalculationActivity CreateHydraRingTargetProbabilityCalculationActivity(HydraulicBoundaryLocation hydraulicBoundaryLocation, + string hlcdDirectory, + GrassCoverErosionInwardsInput inwardsInput, + GrassCoverErosionInwardsOutput inwardsOutput + ) + { + var hydraulicBoundaryLocationId = (int) hydraulicBoundaryLocation.Id; + + // assessmentSection.FailureMechanismContribution.Norm ?? + return HydraRingActivityFactory.Create( + string.Format(Resources.GrassCoverErosionInwardsGuiPlugin_Calculate_overtopping_for_location_0_, hydraulicBoundaryLocationId), + hlcdDirectory, + hydraulicBoundaryLocationId.ToString(), + HydraRingTimeIntegrationSchemeType.FBC, + HydraRingUncertaintiesType.All, + new OvertoppingCalculationInput(hydraulicBoundaryLocationId, new HydraRingSection(hydraulicBoundaryLocationId, hydraulicBoundaryLocationId.ToString(), double.NaN, double.NaN, double.NaN, double.NaN, double.NaN, double.NaN), + inwardsInput.DikeHeight, inwardsInput.CriticalFlowRate.StandardDeviation, inwardsInput.CriticalFlowRate.Mean, + ParseProfilePoints(inwardsInput.DikeGeometry), ParseForeshore(inwardsInput), ParseBreakWater(inwardsInput) + ), + output => { ParseHydraRingOutput(inwardsOutput, output); }); + } + + private static IEnumerable ParseBreakWater(GrassCoverErosionInwardsInput input) + { + return input.BreakWaterPresent ? + input.BreakWater.Select(water => new HydraRingBreakWater((int) water.Type, water.Height)) : + Enumerable.Empty(); + } + + private static IEnumerable ParseForeshore(GrassCoverErosionInwardsInput input) + { + if (!input.ForeshorePresent) + { + yield break; + } + if (input.ForeshoreGeometry.Any()) + { + var first = input.ForeshoreGeometry.First(); + yield return new HydraRingForelandPoint(first.StartingPoint.X, first.StartingPoint.Y); + } + + foreach (var foreshore in input.ForeshoreGeometry) + { + yield return new HydraRingForelandPoint(foreshore.EndingPoint.X, foreshore.EndingPoint.Y); + } + } + + private static IEnumerable ParseProfilePoints(IEnumerable profileSections) + { + if (profileSections.Any()) + { + var first = profileSections.First(); + yield return new HydraRingRoughnessProfilePoint(first.StartingPoint.X, first.StartingPoint.Y, 0); + } + + foreach (var profileSection in profileSections) + { + yield return new HydraRingRoughnessProfilePoint(profileSection.EndingPoint.X, profileSection.EndingPoint.Y, profileSection.Roughness); + } + } + + private static void ParseHydraRingOutput(GrassCoverErosionInwardsOutput grassCoverErosionInwardsOutput, ExceedanceProbabilityCalculationOutput output) + { + if (output != null) + { + grassCoverErosionInwardsOutput.Probability = (RoundedDouble) output.Beta; + } + else + { + throw new InvalidOperationException(Resources.GrassCoverErosionInwardsGuiPlugin_Error_during_overtopping_calculation); + } + } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Properties/Resources.Designer.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Properties/Resources.Designer.cs (revision 0) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Properties/Resources.Designer.cs (revision 2e826fe82412e8333f9d4cb2e2eece2f3b3c6509) @@ -0,0 +1,81 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.GrassCoverErosionInwards.Plugin.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ringtoets.GrassCoverErosionInwards.Plugin.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Faalkans berekenen voor locatie '{0}'. + /// + internal static string GrassCoverErosionInwardsGuiPlugin_Calculate_overtopping_for_location_0_ { + get { + return ResourceManager.GetString("GrassCoverErosionInwardsGuiPlugin_Calculate_overtopping_for_location_0_", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Er is een fout opgetreden tijdens de berekening.. + /// + internal static string GrassCoverErosionInwardsGuiPlugin_Error_during_overtopping_calculation { + get { + return ResourceManager.GetString("GrassCoverErosionInwardsGuiPlugin_Error_during_overtopping_calculation", resourceCulture); + } + } + } +} Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Properties/Resources.resx =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Properties/Resources.resx (revision 0) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Properties/Resources.resx (revision 2e826fe82412e8333f9d4cb2e2eece2f3b3c6509) @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Er is een fout opgetreden tijdens de berekening. + + + Faalkans berekenen voor locatie '{0}' + + \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Ringtoets.GrassCoverErosionInwards.Plugin.csproj =================================================================== diff -u -r684b8c0ca681ea2da3cc988bd60e9223037e5a16 -r2e826fe82412e8333f9d4cb2e2eece2f3b3c6509 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Ringtoets.GrassCoverErosionInwards.Plugin.csproj (.../Ringtoets.GrassCoverErosionInwards.Plugin.csproj) (revision 684b8c0ca681ea2da3cc988bd60e9223037e5a16) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Ringtoets.GrassCoverErosionInwards.Plugin.csproj (.../Ringtoets.GrassCoverErosionInwards.Plugin.csproj) (revision 2e826fe82412e8333f9d4cb2e2eece2f3b3c6509) @@ -2,7 +2,6 @@ - {20955E2A-8CEB-46B0-ADC4-A97D4C6BBDF5} Library Properties @@ -49,6 +48,11 @@ + + True + True + Resources.resx + @@ -69,6 +73,7 @@ {9a2d67e6-26ac-4d17-b11a-2b4372f2f572} Core.Common.Controls + False {30E4C2AE-719E-4D70-9FA9-668A9767FBFA} @@ -85,6 +90,16 @@ Ringtoets.Common.Forms False + + {888D4097-8BC2-4703-9FB1-8744C94D525E} + Ringtoets.HydraRing.Calculation + False + + + {70F8CC9C-5BC8-4FB2-B201-EAE7FA8088C2} + Ringtoets.HydraRing.Data + False + {90de728e-48ef-4665-ab38-3d88e41d9f4d} Ringtoets.GrassCoverErosionInwards.Data @@ -96,6 +111,12 @@ False + + + ResXFileCodeGenerator + Resources.Designer.cs + +