Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresFailureMechanismProperties.cs =================================================================== diff -u -r62897474d0010cfce46ef62263c1ea2a2818ae35 -re4becae1b8fb60f86df5fc6e41dc0eea20b0fe60 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresFailureMechanismProperties.cs (.../StabilityPointStructuresFailureMechanismProperties.cs) (revision 62897474d0010cfce46ef62263c1ea2a2818ae35) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresFailureMechanismProperties.cs (.../StabilityPointStructuresFailureMechanismProperties.cs) (revision e4becae1b8fb60f86df5fc6e41dc0eea20b0fe60) @@ -39,13 +39,14 @@ { private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; - private const int isRelevantPropertyIndex = 3; - private const int gravitationalAccelerationPropertyIndex = 4; - private const int nPropertyIndex = 5; - private const int modelFactorStorageVolumePropertyIndex = 6; - private const int modelFactorSubCriticalFlowPropertyIndex = 7; - private const int modelFactorCollisionLoadPropertyIndex = 8; - private const int modelFactorLoadEffectPropertyIndex = 9; + private const int contributionPropertyIndex = 3; + private const int isRelevantPropertyIndex = 4; + private const int gravitationalAccelerationPropertyIndex = 5; + private const int nPropertyIndex = 6; + private const int modelFactorStorageVolumePropertyIndex = 7; + private const int modelFactorSubCriticalFlowPropertyIndex = 8; + private const int modelFactorCollisionLoadPropertyIndex = 9; + private const int modelFactorLoadEffectPropertyIndex = 10; /// /// Creates a new instance of . @@ -93,7 +94,8 @@ private bool ShouldHidePropertyWhenFailureMechanismIrrelevant(string propertyName) { - return nameof(N).Equals(propertyName) + return nameof(Contribution).Equals(propertyName) + || nameof(N).Equals(propertyName) || nameof(GravitationalAcceleration).Equals(propertyName) || nameof(ModelFactorStorageVolume).Equals(propertyName) || nameof(ModelFactorSubCriticalFlow).Equals(propertyName) @@ -127,6 +129,19 @@ } } + [DynamicVisible] + [PropertyOrder(contributionPropertyIndex)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.FailureMechanism_Contribution_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.FailureMechanism_Contribution_Description))] + public double Contribution + { + get + { + return data.Contribution; + } + } + [PropertyOrder(isRelevantPropertyIndex)] [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.FailureMechanism_IsRelevant_DisplayName))] Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismPropertiesTest.cs =================================================================== diff -u -r62897474d0010cfce46ef62263c1ea2a2818ae35 -re4becae1b8fb60f86df5fc6e41dc0eea20b0fe60 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismPropertiesTest.cs (.../StabilityPointStructuresFailureMechanismPropertiesTest.cs) (revision 62897474d0010cfce46ef62263c1ea2a2818ae35) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismPropertiesTest.cs (.../StabilityPointStructuresFailureMechanismPropertiesTest.cs) (revision e4becae1b8fb60f86df5fc6e41dc0eea20b0fe60) @@ -38,13 +38,14 @@ { private const int namePropertyIndex = 0; private const int codePropertyIndex = 1; - private const int isRelevantPropertyIndex = 2; - private const int gravitationalAccelerationPropertyIndex = 3; - private const int nPropertyIndex = 4; - private const int modelFactorStorageVolumePropertyIndex = 5; - private const int modelFactorSubCriticalFlowPropertyIndex = 6; - private const int modelFactorCollisionLoadPropertyIndex = 7; - private const int modelFactorLoadEffectPropertyIndex = 8; + private const int contributionPropertyIndex = 2; + private const int isRelevantPropertyIndex = 3; + private const int gravitationalAccelerationPropertyIndex = 4; + private const int nPropertyIndex = 5; + private const int modelFactorStorageVolumePropertyIndex = 6; + private const int modelFactorSubCriticalFlowPropertyIndex = 7; + private const int modelFactorCollisionLoadPropertyIndex = 8; + private const int modelFactorLoadEffectPropertyIndex = 9; [Test] public void Constructor_DataIsNull_ThrowArgumentNullException() @@ -74,9 +75,9 @@ // Assert Assert.IsInstanceOf>(properties); Assert.AreSame(failureMechanism, properties.Data); - - Assert.AreEqual("Kunstwerken - Sterkte en stabiliteit puntconstructies", properties.Name); - Assert.AreEqual("STKWp", properties.Code); + Assert.AreEqual(failureMechanism.Name, properties.Name); + Assert.AreEqual(failureMechanism.Code, properties.Code); + Assert.AreEqual(failureMechanism.Contribution, properties.Contribution); Assert.AreEqual(isRelevant, properties.IsRelevant); GeneralStabilityPointStructuresInput generalInput = failureMechanism.GeneralInput; @@ -110,7 +111,7 @@ const string modelSettingsCategory = "Modelinstellingen"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); - Assert.AreEqual(9, dynamicProperties.Count); + Assert.AreEqual(10, dynamicProperties.Count); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, @@ -126,6 +127,13 @@ "Het label van het toetsspoor.", true); + PropertyDescriptor contributionProperty = dynamicProperties[contributionPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(contributionProperty, + generalCategory, + "Faalkansbijdrage [%]", + "Procentuele bijdrage van dit toetsspoor aan de totale overstromingskans van het traject.", + true); + PropertyDescriptor isRelevantProperty = dynamicProperties[isRelevantPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(isRelevantProperty, generalCategory, @@ -211,7 +219,7 @@ "Het label van het toetsspoor.", true); - PropertyDescriptor isRelevantProperty = dynamicProperties[isRelevantPropertyIndex]; + PropertyDescriptor isRelevantProperty = dynamicProperties[isRelevantPropertyIndex - 1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(isRelevantProperty, generalCategory, "Is relevant", @@ -287,6 +295,7 @@ Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.Code))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.IsRelevant))); + Assert.AreEqual(isRelevant, properties.DynamicVisibleValidationMethod(nameof(properties.Contribution))); Assert.AreEqual(isRelevant, properties.DynamicVisibleValidationMethod(nameof(properties.N))); Assert.AreEqual(isRelevant, properties.DynamicVisibleValidationMethod(nameof(properties.GravitationalAcceleration))); Assert.AreEqual(isRelevant, properties.DynamicVisibleValidationMethod(nameof(properties.ModelFactorStorageVolume)));