Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs =================================================================== diff -u -rfa851b16b32a7255c860355147a3ed4deaa10cef -r1ff2522d2926fb866808be62c4bb25540bd30f33 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs (.../GrassCoverErosionInwardsInput.cs) (revision fa851b16b32a7255c860355147a3ed4deaa10cef) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs (.../GrassCoverErosionInwardsInput.cs) (revision 1ff2522d2926fb866808be62c4bb25540bd30f33) @@ -171,6 +171,11 @@ /// public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; set; } + /// + /// Gets or sets whether the dike height should be calculated. + /// + public bool CalculateDikeHeight { get; set; } + private void UpdateProfileParameters() { if (dikeProfile == null) Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r2c02ce70cceb9e22c740df034c94782e44eded33 -r1ff2522d2926fb866808be62c4bb25540bd30f33 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 2c02ce70cceb9e22c740df034c94782e44eded33) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1ff2522d2926fb866808be62c4bb25540bd30f33) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -151,6 +151,24 @@ } /// + /// Looks up a localized string similar to Bereken de dijkhoogte in hydra ring.. + /// + public static string CalculateDikeHeight_Description { + get { + return ResourceManager.GetString("CalculateDikeHeight_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bereken dijkhoogte. + /// + public static string CalculateDikeHeight_DisplayName { + get { + return ResourceManager.GetString("CalculateDikeHeight_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// public static System.Drawing.Bitmap CalculationIcon { Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx =================================================================== diff -u -r2c02ce70cceb9e22c740df034c94782e44eded33 -r1ff2522d2926fb866808be62c4bb25540bd30f33 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 2c02ce70cceb9e22c740df034c94782e44eded33) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 1ff2522d2926fb866808be62c4bb25540bd30f33) @@ -310,4 +310,10 @@ Indicatieve golfhoogte + + Bereken de dijkhoogte in hydra ring. + + + Bereken dijkhoogte + \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsInputContextProperties.cs =================================================================== diff -u -r695dc056718910d43896faab4b65a09944ad18cb -r1ff2522d2926fb866808be62c4bb25540bd30f33 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsInputContextProperties.cs (.../GrassCoverErosionInwardsInputContextProperties.cs) (revision 695dc056718910d43896faab4b65a09944ad18cb) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsInputContextProperties.cs (.../GrassCoverErosionInwardsInputContextProperties.cs) (revision 1ff2522d2926fb866808be62c4bb25540bd30f33) @@ -48,6 +48,7 @@ private const int dikeHeightPropertyIndex = 6; private const int criticalFlowRatePropertyIndex = 7; private const int hydraulicBoundaryLocationPropertyIndex = 8; + private const int calculateDikeHeightPropertyIndex = 9; [PropertyOrder(dikeProfilePropertyIndex)] [Editor(typeof(GrassCoverErosionInwardsInputContextDikeProfileEditor), typeof(UITypeEditor))] @@ -185,6 +186,23 @@ } } + [PropertyOrder(calculateDikeHeightPropertyIndex)] + [ResourcesCategory(typeof(Resources), "Categories_Schematisation")] + [ResourcesDisplayName(typeof(Resources), "CalculateDikeHeight_DisplayName")] + [ResourcesDescription(typeof(Resources), "CalculateDikeHeight_Description")] + public bool CalculateDikeHeight + { + get + { + return data.WrappedData.CalculateDikeHeight; + } + set + { + data.WrappedData.CalculateDikeHeight = value; + data.WrappedData.NotifyObservers(); + } + } + [DynamicReadOnlyValidationMethod] public bool DynamicReadOnlyValidationMethod(string propertyName) { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsInputTest.cs =================================================================== diff -u -rd77bf27adb60cd7f4ad18ddb184e836f0fc45265 -r1ff2522d2926fb866808be62c4bb25540bd30f33 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsInputTest.cs (.../GrassCoverErosionInwardsInputTest.cs) (revision d77bf27adb60cd7f4ad18ddb184e836f0fc45265) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsInputTest.cs (.../GrassCoverErosionInwardsInputTest.cs) (revision 1ff2522d2926fb866808be62c4bb25540bd30f33) @@ -53,6 +53,7 @@ CollectionAssert.IsEmpty(input.DikeGeometry); Assert.AreEqual(new RoundedDouble(2), input.DikeHeight); Assert.IsNull(input.HydraulicBoundaryLocation); + Assert.IsFalse(input.CalculateDikeHeight); var criticalFlowRate = new LogNormalDistribution(4) { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextPropertiesTest.cs =================================================================== diff -u -r39496fd42e53a9fb20fec4f2a1b4dcdfadcaea3d -r1ff2522d2926fb866808be62c4bb25540bd30f33 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextPropertiesTest.cs (.../GrassCoverErosionInwardsInputContextPropertiesTest.cs) (revision 39496fd42e53a9fb20fec4f2a1b4dcdfadcaea3d) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextPropertiesTest.cs (.../GrassCoverErosionInwardsInputContextPropertiesTest.cs) (revision 1ff2522d2926fb866808be62c4bb25540bd30f33) @@ -90,6 +90,7 @@ Assert.AreEqual(input.CriticalFlowRate.Mean, properties.CriticalFlowRate.Mean); Assert.AreEqual(input.CriticalFlowRate.StandardDeviation, properties.CriticalFlowRate.StandardDeviation); Assert.AreSame(input.HydraulicBoundaryLocation, properties.HydraulicBoundaryLocation); + Assert.AreEqual(input.CalculateDikeHeight, properties.CalculateDikeHeight); mockRepository.VerifyAll(); } @@ -98,7 +99,7 @@ { // Setup var observerMock = mockRepository.StrictMock(); - const int numberProperties = 4; + const int numberProperties = 5; observerMock.Expect(o => o.UpdateObserver()).Repeat.Times(numberProperties); var assessmentSectionMock = mockRepository.StrictMock(); var failureMechanismMock = mockRepository.StrictMock(); @@ -116,18 +117,21 @@ var newDikeHeight = new RoundedDouble(2, 9); var newOrientation = new RoundedDouble(2, 5); var newHydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, "name", 0.0, 1.1); + var newCalculateDikeHeight = true; // Call properties.DikeProfile = newDikeProfile; properties.Orientation = newOrientation; properties.DikeHeight = newDikeHeight; properties.HydraulicBoundaryLocation = newHydraulicBoundaryLocation; + properties.CalculateDikeHeight = newCalculateDikeHeight; // Assert Assert.AreSame(newDikeProfile, input.DikeProfile); Assert.AreEqual(newOrientation, input.Orientation); Assert.AreEqual(newDikeHeight, input.DikeHeight); Assert.AreSame(newHydraulicBoundaryLocation, input.HydraulicBoundaryLocation); + Assert.AreEqual(newCalculateDikeHeight, input.CalculateDikeHeight); mockRepository.VerifyAll(); } @@ -157,7 +161,7 @@ // Assert var dynamicPropertyBag = new DynamicPropertyBag(properties); PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties(); - Assert.AreEqual(9, dynamicProperties.Count); + Assert.AreEqual(10, dynamicProperties.Count); PropertyDescriptor dikeProfileProperty = dynamicProperties[dikeProfilePropertyIndex]; Assert.IsNotNull(dikeProfileProperty); @@ -218,6 +222,12 @@ Assert.AreEqual("Hydraulische gegevens", hydraulicBoundaryLocationProperty.Category); Assert.AreEqual("Locatie met hydraulische randvoorwaarden", hydraulicBoundaryLocationProperty.DisplayName); Assert.AreEqual("De locatie met hydraulische randvoorwaarden.", hydraulicBoundaryLocationProperty.Description); + + PropertyDescriptor calculateDikeHeightProperty = dynamicProperties[calculateDikeHeightPropertyIndex]; + Assert.IsNotNull(calculateDikeHeightProperty); + Assert.AreEqual("Schematisatie", calculateDikeHeightProperty.Category); + Assert.AreEqual("Bereken dijkhoogte", calculateDikeHeightProperty.DisplayName); + Assert.AreEqual("Bereken de dijkhoogte in hydra ring.", calculateDikeHeightProperty.Description); mockRepository.VerifyAll(); } @@ -229,5 +239,6 @@ private const int dikeHeightPropertyIndex = 5; private const int criticalFlowRatePropertyIndex = 6; private const int hydraulicBoundaryLocationPropertyIndex = 7; + private const int calculateDikeHeightPropertyIndex = 8; } } \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/HydraRingCalculationService.cs =================================================================== diff -u -r2c02ce70cceb9e22c740df034c94782e44eded33 -r1ff2522d2926fb866808be62c4bb25540bd30f33 --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/HydraRingCalculationService.cs (.../HydraRingCalculationService.cs) (revision 2c02ce70cceb9e22c740df034c94782e44eded33) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/HydraRingCalculationService.cs (.../HydraRingCalculationService.cs) (revision 1ff2522d2926fb866808be62c4bb25540bd30f33) @@ -44,30 +44,30 @@ /// The id of the ring to perform the calculation for. /// The to use while executing the calculation. /// The to use while executing the calculation. - /// The input of the calculation to perform. + /// The input of the calculation to perform. /// Parsers that will be invoked after the Hydra-Ring calculation has ran. /// A on a successful calculation, null otherwise. public static void PerformCalculation( string hlcdDirectory, string ringId, HydraRingTimeIntegrationSchemeType timeIntegrationSchemeType, HydraRingUncertaintiesType uncertaintiesType, - HydraRingCalculationInput targetProbabilityCalculationInput, + HydraRingCalculationInput hydraRingCalculationInput, IEnumerable parsers) { - var sectionId = targetProbabilityCalculationInput.Section.SectionId; + var sectionId = hydraRingCalculationInput.Section.SectionId; var workingDirectory = CreateWorkingDirectory(); var hydraRingConfigurationService = new HydraRingConfigurationService(ringId, timeIntegrationSchemeType, uncertaintiesType); - hydraRingConfigurationService.AddHydraRingCalculationInput(targetProbabilityCalculationInput); + hydraRingConfigurationService.AddHydraRingCalculationInput(hydraRingCalculationInput); - var hydraRingInitializationService = new HydraRingInitializationService(targetProbabilityCalculationInput.FailureMechanismType, sectionId, hlcdDirectory, workingDirectory); + var hydraRingInitializationService = new HydraRingInitializationService(hydraRingCalculationInput.FailureMechanismType, sectionId, hlcdDirectory, workingDirectory); hydraRingInitializationService.WriteInitializationScript(); hydraRingConfigurationService.WriteDataBaseCreationScript(hydraRingInitializationService.DatabaseCreationScriptFilePath); PerformCalculation(workingDirectory, hydraRingInitializationService); - ExecuteParsers(parsers, hydraRingInitializationService.TemporaryWorkingDirectory, targetProbabilityCalculationInput.Section.SectionId); + ExecuteParsers(parsers, hydraRingInitializationService.TemporaryWorkingDirectory, hydraRingCalculationInput.Section.SectionId); } ///