Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r5df0d352c9b7b04b440c800f2786d4a5d98cde0a -r413bb72227ef5a4db07fe46622c3a1ae8c44f172 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 5df0d352c9b7b04b440c800f2786d4a5d98cde0a) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 413bb72227ef5a4db07fe46622c3a1ae8c44f172) @@ -109,6 +109,15 @@ } /// + /// Looks up a localized string similar to Instellingen. + /// + public static string Categories_Settings { + get { + return ResourceManager.GetString("Categories_Settings", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Dijktype van de geschematiseerde dijk.. /// public static string DikeSoilScenario_Description { @@ -567,6 +576,24 @@ } /// + /// Looks up a localized string similar to Maximale breedte van een lamel.. + /// + public static string MaximumSliceWidth_Description { + get { + return ResourceManager.GetString("MaximumSliceWidth_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Maximale lamelbreedte [m]. + /// + public static string MaximumSliceWidth_DisplayName { + get { + return ResourceManager.GetString("MaximumSliceWidth_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Minimale hoogte van de freatische lijn onder kruin binnentalud.. /// public static string MinimumLevelPhreaticLineAtDikeTopPolder_Description { @@ -747,6 +774,42 @@ } /// + /// Looks up a localized string similar to Minimale diepte van het berekende glijvlak ten opzichte van het maaiveld.. + /// + public static string SlipPlaneMinimumDepth_Description { + get { + return ResourceManager.GetString("SlipPlaneMinimumDepth_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Minimale glijvlakdiepte [m]. + /// + public static string SlipPlaneMinimumDepth_DisplayName { + get { + return ResourceManager.GetString("SlipPlaneMinimumDepth_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Minimale lengte van het berekende glijvlak.. + /// + public static string SlipPlaneMinimumLength_Description { + get { + return ResourceManager.GetString("SlipPlaneMinimumLength_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Minimale glijvlaklengte [m]. + /// + public static string SlipPlaneMinimumLength_DisplayName { + get { + return ResourceManager.GetString("SlipPlaneMinimumLength_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// public static System.Drawing.Bitmap SoilProfileIcon { Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.resx =================================================================== diff -u -r5df0d352c9b7b04b440c800f2786d4a5d98cde0a -r413bb72227ef5a4db07fe46622c3a1ae8c44f172 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 5df0d352c9b7b04b440c800f2786d4a5d98cde0a) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 413bb72227ef5a4db07fe46622c3a1ae8c44f172) @@ -433,4 +433,25 @@ Z [m+NAP] + + Instellingen + + + Maximale breedte van een lamel. + + + Maximale lamelbreedte [m] + + + Minimale diepte van het berekende glijvlak ten opzichte van het maaiveld. + + + Minimale glijvlakdiepte [m] + + + Minimale lengte van het berekende glijvlak. + + + Minimale glijvlaklengte [m] + \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsInputContextProperties.cs =================================================================== diff -u -r79b21a40895beb5fd233c3e3cb20d82e6ab5be56 -r413bb72227ef5a4db07fe46622c3a1ae8c44f172 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsInputContextProperties.cs (.../MacroStabilityInwardsInputContextProperties.cs) (revision 79b21a40895beb5fd233c3e3cb20d82e6ab5be56) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PropertyClasses/MacroStabilityInwardsInputContextProperties.cs (.../MacroStabilityInwardsInputContextProperties.cs) (revision 413bb72227ef5a4db07fe46622c3a1ae8c44f172) @@ -58,7 +58,15 @@ private const int surfaceLinePropertyIndex = 6; private const int stochasticSoilModelPropertyIndex = 7; private const int stochasticSoilProfilePropertyIndex = 8; + private const int slipPlaneMinimumDepthPropertyIndex = 9; + private const int slipPlaneMinimumLengthPropertyIndex = 10; + private const int maximumSliceWidthPropertyIndex = 11; + private const int hydraulicCategoryIndex = 1; + private const int schematizationCategoryIndex = 2; + private const int settingsCategoryIndex = 3; + private const int totalCategoryCount = 3; + private readonly IObservablePropertyChangeHandler propertyChangeHandler; /// @@ -148,7 +156,7 @@ [DynamicVisible] [PropertyOrder(selectedHydraulicBoundaryLocationPropertyIndex)] [Editor(typeof(HydraulicBoundaryLocationEditor), typeof(UITypeEditor))] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_HydraulicData))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_HydraulicData), hydraulicCategoryIndex, totalCategoryCount)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.MacroStabilityInwardsInput_HydraulicBoundaryLocation_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.MacroStabilityInwardsInput_HydraulicBoundaryLocation_Description))] public SelectableHydraulicBoundaryLocation SelectedHydraulicBoundaryLocation @@ -170,7 +178,7 @@ [DynamicReadOnly] [PropertyOrder(assessmentLevelPropertyIndex)] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_HydraulicData))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_HydraulicData), hydraulicCategoryIndex, totalCategoryCount)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.AssessmentLevel_DisplayName))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.AssessmentLevel_Description))] public RoundedDouble AssessmentLevel @@ -186,7 +194,7 @@ } [PropertyOrder(useHydraulicBoundaryLocationPropertyIndex)] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_HydraulicData))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_HydraulicData), hydraulicCategoryIndex, totalCategoryCount)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.MacroStabilityInwardsInput_UseAssessmentLevelManualInput_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.MacroStabilityInwardsInput_UseAssessmentLevelManualInput_Description))] public bool UseAssessmentLevelManualInput @@ -202,7 +210,7 @@ } [PropertyOrder(dikeSoilScenarioPropertyIndex)] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_HydraulicData))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_HydraulicData), hydraulicCategoryIndex, totalCategoryCount)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.DikeSoilScenario_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.DikeSoilScenario_Description))] [TypeConverter(typeof(EnumTypeConverter))] @@ -219,7 +227,7 @@ } [PropertyOrder(waterStressesPropertyIndex)] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_HydraulicData))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_HydraulicData), hydraulicCategoryIndex, totalCategoryCount)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Waterstresses_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Waterstresses_Description))] [TypeConverter(typeof(ExpandableObjectConverter))] @@ -237,7 +245,7 @@ [PropertyOrder(surfaceLinePropertyIndex)] [Editor(typeof(MacroStabilityInwardsInputContextSurfaceLineSelectionEditor), typeof(UITypeEditor))] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Schematization))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Schematization), schematizationCategoryIndex, totalCategoryCount)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.SurfaceLine_DisplayName))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.SurfaceLine_Description))] public MacroStabilityInwardsSurfaceLine SurfaceLine @@ -261,7 +269,7 @@ [PropertyOrder(stochasticSoilModelPropertyIndex)] [Editor(typeof(MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditor), typeof(UITypeEditor))] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Schematization))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Schematization), schematizationCategoryIndex, totalCategoryCount)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.MacroStabilityInwardsInput_StochasticSoilModel_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.MacroStabilityInwardsInput_StochasticSoilModel_Description))] public StochasticSoilModel StochasticSoilModel @@ -285,7 +293,7 @@ [PropertyOrder(stochasticSoilProfilePropertyIndex)] [Editor(typeof(MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditor), typeof(UITypeEditor))] - [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Schematization))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Schematization), schematizationCategoryIndex, totalCategoryCount)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.MacroStabilityInwardsInput_StochasticSoilProfile_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.MacroStabilityInwardsInput_StochasticSoilProfile_Description))] public StochasticSoilProfile StochasticSoilProfile @@ -304,5 +312,57 @@ } #endregion + + #region Settings + + [PropertyOrder(slipPlaneMinimumDepthPropertyIndex)] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Settings), settingsCategoryIndex, totalCategoryCount)] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.SlipPlaneMinimumDepth_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.SlipPlaneMinimumDepth_Description))] + public RoundedDouble SlipPlaneMinimumDepth + { + get + { + return data.WrappedData.SlipPlaneMinimumDepth; + } + set + { + PropertyChangeHelper.ChangePropertyAndNotify(() => data.WrappedData.SlipPlaneMinimumDepth = value, propertyChangeHandler); + } + } + + [PropertyOrder(slipPlaneMinimumLengthPropertyIndex)] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Settings), settingsCategoryIndex, totalCategoryCount)] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.SlipPlaneMinimumLength_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.SlipPlaneMinimumLength_Description))] + public RoundedDouble SlipPlaneMinimumLength + { + get + { + return data.WrappedData.SlipPlaneMinimumLength; + } + set + { + PropertyChangeHelper.ChangePropertyAndNotify(() => data.WrappedData.SlipPlaneMinimumLength = value, propertyChangeHandler); + } + } + + [PropertyOrder(maximumSliceWidthPropertyIndex)] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Settings), settingsCategoryIndex, totalCategoryCount)] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.MaximumSliceWidth_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.MaximumSliceWidth_Description))] + public RoundedDouble MaximumSliceWidth + { + get + { + return data.WrappedData.MaximumSliceWidth; + } + set + { + PropertyChangeHelper.ChangePropertyAndNotify(() => data.WrappedData.MaximumSliceWidth = value, propertyChangeHandler); + } + } + + #endregion } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsInputContextPropertiesTest.cs =================================================================== diff -u -r99f686f22091051a65ff1ee20abd68ffad713647 -r413bb72227ef5a4db07fe46622c3a1ae8c44f172 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsInputContextPropertiesTest.cs (.../MacroStabilityInwardsInputContextPropertiesTest.cs) (revision 99f686f22091051a65ff1ee20abd68ffad713647) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsInputContextPropertiesTest.cs (.../MacroStabilityInwardsInputContextPropertiesTest.cs) (revision 413bb72227ef5a4db07fe46622c3a1ae8c44f172) @@ -58,6 +58,9 @@ private const int expectedSurfaceLinePropertyIndex = 5; private const int expectedStochasticSoilModelPropertyIndex = 6; private const int expectedStochasticSoilProfilePropertyIndex = 7; + private const int expectedSlipPlaneMinimumDepthPropertyIndex = 8; + private const int expectedSlipPlaneMinimumLengthPropertyIndex = 9; + private const int expectedMaximumSliceWidthPropertyIndex = 10; [Test] public void Constructor_DataNull_ThrowArgumentNullException() @@ -160,10 +163,11 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(8, dynamicProperties.Count); + Assert.AreEqual(11, dynamicProperties.Count); - const string hydraulicDataCategory = "Hydraulische gegevens"; - const string schematizationCategory = "Schematisatie"; + const string hydraulicDataCategory = "\t\tHydraulische gegevens"; + const string schematizationCategory = "\tSchematisatie"; + const string settingsCategory = "Instellingen"; PropertyDescriptor hydraulicBoundaryLocationProperty = dynamicProperties[expectedSelectedHydraulicBoundaryLocationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( @@ -225,6 +229,27 @@ "Ondergrondschematisatie", "De opbouw van de ondergrond."); + PropertyDescriptor slipPlaneMinimumDepthProperty = dynamicProperties[expectedSlipPlaneMinimumDepthPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + slipPlaneMinimumDepthProperty, + settingsCategory, + "Minimale glijvlakdiepte [m]", + "Minimale diepte van het berekende glijvlak ten opzichte van het maaiveld."); + + PropertyDescriptor slipPlaneMinimumLengthProperty = dynamicProperties[expectedSlipPlaneMinimumLengthPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + slipPlaneMinimumLengthProperty, + settingsCategory, + "Minimale glijvlaklengte [m]", + "Minimale lengte van het berekende glijvlak."); + + PropertyDescriptor maximumSliceWidthProperty = dynamicProperties[expectedMaximumSliceWidthPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( + maximumSliceWidthProperty, + settingsCategory, + "Maximale lamelbreedte [m]", + "Maximale breedte van een lamel."); + mocks.VerifyAll(); } @@ -259,10 +284,10 @@ // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - const string hydraulicDataCategory = "Hydraulische gegevens"; + const string hydraulicDataCategory = "\t\tHydraulische gegevens"; if (!useManualAssessmentLevelInput) { - Assert.AreEqual(8, dynamicProperties.Count); + Assert.AreEqual(11, dynamicProperties.Count); PropertyDescriptor hydraulicBoundaryLocationProperty = dynamicProperties[expectedSelectedHydraulicBoundaryLocationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( @@ -281,7 +306,7 @@ } else { - Assert.AreEqual(7, dynamicProperties.Count); + Assert.AreEqual(10, dynamicProperties.Count); PropertyDescriptor assessmentLevelProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( @@ -359,6 +384,10 @@ Assert.AreSame(inputParameters, properties.WaterStressesProperties.Data); + Assert.AreEqual(inputParameters.SlipPlaneMinimumDepth, properties.SlipPlaneMinimumDepth); + Assert.AreEqual(inputParameters.SlipPlaneMinimumLength, properties.SlipPlaneMinimumLength); + Assert.AreEqual(inputParameters.MaximumSliceWidth, properties.MaximumSliceWidth); + mocks.VerifyAll(); } @@ -385,11 +414,15 @@ var handler = new ObservablePropertyChangeHandler(calculationItem, calculationItem.InputParameters); var properties = new MacroStabilityInwardsInputContextProperties(context, handler); + var random = new Random(); const double assessmentLevel = 0.36; MacroStabilityInwardsSurfaceLine surfaceLine = ValidSurfaceLine(0.0, 4.0); StochasticSoilModel soilModel = ValidStochasticSoilModel(0.0, 4.0); StochasticSoilProfile soilProfile = soilModel.StochasticSoilProfiles.First(); const MacroStabilityInwardsDikeSoilScenario dikeSoilScenario = MacroStabilityInwardsDikeSoilScenario.SandDikeOnSand; + double slipPlaneMinimumDepth = random.Next(); + double slipPlaneMinimumLength= random.Next(); + double maximumSliceWidth = random.Next(); // When properties.UseAssessmentLevelManualInput = true; @@ -398,13 +431,19 @@ properties.StochasticSoilModel = soilModel; properties.StochasticSoilProfile = soilProfile; properties.DikeSoilScenario = dikeSoilScenario; + properties.SlipPlaneMinimumDepth = (RoundedDouble) slipPlaneMinimumDepth; + properties.SlipPlaneMinimumLength = (RoundedDouble) slipPlaneMinimumLength; + properties.MaximumSliceWidth = (RoundedDouble) maximumSliceWidth; // Then Assert.AreEqual(assessmentLevel, inputParameters.AssessmentLevel.Value); Assert.AreSame(surfaceLine, inputParameters.SurfaceLine); Assert.AreSame(soilModel, inputParameters.StochasticSoilModel); Assert.AreSame(soilProfile, inputParameters.StochasticSoilProfile); Assert.AreEqual(dikeSoilScenario, inputParameters.DikeSoilScenario); + Assert.AreEqual(slipPlaneMinimumDepth, inputParameters.SlipPlaneMinimumDepth); + Assert.AreEqual(slipPlaneMinimumLength, inputParameters.SlipPlaneMinimumLength); + Assert.AreEqual(maximumSliceWidth, inputParameters.MaximumSliceWidth); mocks.VerifyAll(); } @@ -482,6 +521,39 @@ } [Test] + public void SlipPlaneMinimumDepth_SetNewValue_SetsValuesAndUpdatesObservers() + { + // Setup + var calculation = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()); + + // Call & Assert + SetPropertyAndVerifyNotifcationsForCalculation(properties => properties.SlipPlaneMinimumDepth = (RoundedDouble) 1, + calculation); + } + + [Test] + public void SlipPlaneMinimumLength_SetNewValue_SetsValuesAndUpdatesObservers() + { + // Setup + var calculation = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()); + + // Call & Assert + SetPropertyAndVerifyNotifcationsForCalculation(properties => properties.SlipPlaneMinimumLength = (RoundedDouble) 1, + calculation); + } + + [Test] + public void MaximumSliceWidth_SetNewValue_SetsValuesAndUpdatesObservers() + { + // Setup + var calculation = new MacroStabilityInwardsCalculationScenario(new GeneralMacroStabilityInwardsInput()); + + // Call & Assert + SetPropertyAndVerifyNotifcationsForCalculation(properties => properties.MaximumSliceWidth = (RoundedDouble) 1, + calculation); + } + + [Test] public void HydraulicBoundaryLocation_DesignWaterLevelIsNaN_AssessmentLevelSetToNaN() { // Setup