Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructureProperties.cs =================================================================== diff -u -r44837ec463259677b2bc84d05e020de9fb5b782c -r5d268a104c381c59f78c97583ad783fc6ccf99f8 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructureProperties.cs (.../StabilityPointStructureProperties.cs) (revision 44837ec463259677b2bc84d05e020de9fb5b782c) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructureProperties.cs (.../StabilityPointStructureProperties.cs) (revision 5d268a104c381c59f78c97583ad783fc6ccf99f8) @@ -19,11 +19,15 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.ComponentModel; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; +using Core.Common.Utils; using Core.Common.Utils.Attributes; +using Ringtoets.Common.Forms.Helpers; +using Ringtoets.Common.Forms.PropertyClasses; using Ringtoets.StabilityPointStructures.Data; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; @@ -37,6 +41,36 @@ private const int namePropertyIndex = 1; private const int locationPropertyIndex = 2; + private const int insideWaterLevelPropertyIndex = 3; + private const int insideWaterLevelFailureConstructionPropertyIndex = 4; + + private const int structureNormalOrientationPropertyIndex = 5; + private const int stabilityPointStructureInflowModelTypePropertyIndex = 6; + private const int widthFlowAperturesPropertyIndex = 7; + private const int areaFlowAperturesPropertyIndex = 8; + private const int flowWidthAtBottomProtectionPropertyIndex = 9; + private const int storageStructureAreaPropertyIndex = 10; + private const int allowedLevelIncreaseStoragePropertyIndex = 11; + private const int levelCrestStructurePropertyIndex = 12; + private const int thresholdHeightOpenWeirPropertyIndex = 13; + private const int criticalOvertoppingDischargePropertyIndex = 14; + private const int constructiveStrengthLinearModelPropertyIndex = 15; + private const int constructiveStrengthQuadraticModelPropertyIndex = 16; + private const int bankWidthPropertyIndex = 17; + private const int evaluationLevelPropertyIndex = 18; + private const int verticalDistancePropertyIndex = 19; + private const int failureProbabilityReparationPropertyIndex = 20; + private const int failureCollisionEnergyPropertyIndex = 21; + private const int shipMassPropertyIndex = 22; + private const int shipVelocityPropertyIndex = 23; + private const int levellingCountPropertyIndex = 24; + private const int probabilityCollisionSecondaryStructurePropertyIndex = 25; + private const int flowVelocityStructureClosablePropertyIndex = 26; + private const int stabilityLinearModelPropertyIndex = 27; + private const int stabilityQuadraticModelPropertyIndex = 28; + + #region General + [PropertyOrder(namePropertyIndex)] [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_General")] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "Structure_Name_DisplayName")] @@ -61,5 +95,366 @@ new RoundedDouble(0, data.Location.Y)); } } + + #endregion + + #region HydraulicData + + [PropertyOrder(insideWaterLevelPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_HydraulicData")] + public NormalDistributionProperties InsideWaterLevel + { + get + { + return new NormalDistributionProperties + { + Data = data.InsideWaterLevel + }; + } + } + + [PropertyOrder(insideWaterLevelFailureConstructionPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_HydraulicData")] + public NormalDistributionProperties InsideWaterLevelFailureConstruction + { + get + { + return new NormalDistributionProperties + { + Data = data.InsideWaterLevelFailureConstruction + }; + } + } + + #endregion + + #region Schematization + + [PropertyOrder(structureNormalOrientationPropertyIndex)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "Structure_StructureNormalOrientation_DisplayName")] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), "Structure_StructureNormalOrientation_Description")] + public RoundedDouble StructureNormalOrientation + { + get + { + return data.StructureNormalOrientation; + } + } + + [PropertyOrder(stabilityPointStructureInflowModelTypePropertyIndex)] + [TypeConverter(typeof(EnumTypeConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public StabilityPointStructureInflowModelType InflowModelType + { + get + { + return data.InflowModelType; + } + } + + [PropertyOrder(widthFlowAperturesPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "Structure_WidthFlowApertures_DisplayName")] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), "Structure_WidthFlowApertures_Description")] + public NormalDistributionVariationProperties WidthFlowApertures + { + get + { + return new NormalDistributionVariationProperties + { + Data = data.WidthFlowApertures + }; + } + } + + [PropertyOrder(areaFlowAperturesPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "Structure_AreaFlowApertures_DisplayName")] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), "Structure_AreaFlowApertures_Description")] + public LogNormalDistributionProperties AreaFlowApertures + { + get + { + return new LogNormalDistributionProperties + { + Data = data.AreaFlowApertures + }; + } + } + + [PropertyOrder(flowWidthAtBottomProtectionPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "Structure_FlowWidthAtBottomProtection_DisplayName")] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), "Structure_FlowWidthAtBottomProtection_Description")] + public LogNormalDistributionProperties FlowWidthAtBottomProtection + { + get + { + return new LogNormalDistributionProperties + { + Data = data.FlowWidthAtBottomProtection + }; + } + } + + [PropertyOrder(storageStructureAreaPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "Structure_StorageStructureArea_DisplayName")] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), "Structure_StorageStructureArea_Description")] + public LogNormalDistributionVariationProperties StorageStructureArea + { + get + { + return new LogNormalDistributionVariationProperties + { + Data = data.StorageStructureArea + }; + } + } + + [PropertyOrder(allowedLevelIncreaseStoragePropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "Structure_AllowedLevelIncreaseStorage_DisplayName")] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), "Structure_AllowedLevelIncreaseStorage_Description")] + public LogNormalDistributionProperties AllowedLevelIncreaseStorage + { + get + { + return new LogNormalDistributionProperties + { + Data = data.AllowedLevelIncreaseStorage + }; + } + } + + [PropertyOrder(levelCrestStructurePropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public NormalDistributionProperties LevelCrestStructure + { + get + { + return new NormalDistributionProperties + { + Data = data.LevelCrestStructure + }; + } + } + + [PropertyOrder(thresholdHeightOpenWeirPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public NormalDistributionProperties ThresholdHeightOpenWeir + { + get + { + return new NormalDistributionProperties + { + Data = data.ThresholdHeightOpenWeir + }; + } + } + + [PropertyOrder(criticalOvertoppingDischargePropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "Structure_CriticalOvertoppingDischarge_DisplayName")] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), "Structure_CriticalOvertoppingDischarge_Description")] + public LogNormalDistributionVariationProperties CriticalOvertoppingDischarge + { + get + { + return new LogNormalDistributionVariationProperties + { + Data = data.CriticalOvertoppingDischarge + }; + } + } + + [PropertyOrder(constructiveStrengthLinearModelPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public LogNormalDistributionVariationProperties ConstructiveStrengthLinearModel + { + get + { + return new LogNormalDistributionVariationProperties + { + Data = data.ConstructiveStrengthLinearModel + }; + } + } + + [PropertyOrder(constructiveStrengthQuadraticModelPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public LogNormalDistributionVariationProperties ConstructiveStrengthQuadraticModel + { + get + { + return new LogNormalDistributionVariationProperties + { + Data = data.ConstructiveStrengthQuadraticModel + }; + } + } + + [PropertyOrder(bankWidthPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public NormalDistributionProperties BankWidth + { + get + { + return new NormalDistributionProperties + { + Data = data.BankWidth + }; + } + } + + [PropertyOrder(evaluationLevelPropertyIndex)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public RoundedDouble EvaluationLevel + { + get + { + return data.EvaluationLevel; + } + } + + [PropertyOrder(verticalDistancePropertyIndex)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public RoundedDouble VerticalDistance + { + get + { + return data.VerticalDistance; + } + } + + [PropertyOrder(failureProbabilityReparationPropertyIndex)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public string FailureProbabilityReparation + { + get + { + return ProbabilityFormattingHelper.Format(data.FailureProbabilityReparation); + } + } + + [PropertyOrder(failureCollisionEnergyPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public LogNormalDistributionVariationProperties FailureCollisionEnergy + { + get + { + return new LogNormalDistributionVariationProperties + { + Data = data.FailureCollisionEnergy + }; + } + } + + [PropertyOrder(shipMassPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public NormalDistributionVariationProperties ShipMass + { + get + { + return new NormalDistributionVariationProperties + { + Data = data.ShipMass + }; + } + } + + [PropertyOrder(shipVelocityPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public NormalDistributionVariationProperties ShipVelocity + { + get + { + return new NormalDistributionVariationProperties + { + Data = data.ShipVelocity + }; + } + } + + [PropertyOrder(levellingCountPropertyIndex)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public string LevellingCount + { + get + { + return ProbabilityFormattingHelper.Format(data.LevellingCount); + } + } + + [PropertyOrder(probabilityCollisionSecondaryStructurePropertyIndex)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public string ProbabilityCollisionSecondaryStructure + { + get + { + return ProbabilityFormattingHelper.Format(data.ProbabilityCollisionSecondaryStructure); + } + } + + [PropertyOrder(flowVelocityStructureClosablePropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public NormalDistributionProperties FlowVelocityStructureClosable + { + get + { + return new NormalDistributionProperties + { + Data = data.FlowVelocityStructureClosable + }; + } + } + + [PropertyOrder(stabilityLinearModelPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public LogNormalDistributionVariationProperties StabilityLinearModel + { + get + { + return new LogNormalDistributionVariationProperties + { + Data = data.StabilityLinearModel + }; + } + } + + [PropertyOrder(stabilityQuadraticModelPropertyIndex)] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Schematization")] + public LogNormalDistributionVariationProperties StabilityQuadraticModel + { + get + { + return new LogNormalDistributionVariationProperties + { + Data = data.StabilityQuadraticModel + }; + } + } + + #endregion } } \ No newline at end of file Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructurePropertiesTest.cs =================================================================== diff -u -r9e3639e810a22019da1a9fdf5aa5c433a43520c1 -r5d268a104c381c59f78c97583ad783fc6ccf99f8 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructurePropertiesTest.cs (.../StabilityPointStructurePropertiesTest.cs) (revision 9e3639e810a22019da1a9fdf5aa5c433a43520c1) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructurePropertiesTest.cs (.../StabilityPointStructurePropertiesTest.cs) (revision 5d268a104c381c59f78c97583ad783fc6ccf99f8) @@ -25,6 +25,7 @@ using Core.Common.Base.Geometry; using Core.Common.Gui.PropertyBag; using NUnit.Framework; +using Ringtoets.Common.Forms.Helpers; using Ringtoets.StabilityPointStructures.Data; using Ringtoets.StabilityPointStructures.Forms.PropertyClasses; @@ -36,6 +37,34 @@ private const int namePropertyIndex = 0; private const int locationPropertyIndex = 1; + private const int insideWaterLevelPropertyIndex = 2; + private const int insideWaterLevelFailureConstructionPropertyIndex = 3; + + private const int structureNormalOrientationPropertyIndex = 4; + private const int stabilityPointStructureInflowModelTypePropertyIndex = 5; + private const int widthFlowAperturesPropertyIndex = 6; + private const int areaFlowAperturesPropertyIndex = 7; + private const int flowWidthAtBottomProtectionPropertyIndex = 8; + private const int storageStructureAreaPropertyIndex = 9; + private const int allowedLevelIncreaseStoragePropertyIndex = 10; + private const int levelCrestStructurePropertyIndex = 11; + private const int thresholdHeightOpenWeirPropertyIndex = 12; + private const int criticalOvertoppingDischargePropertyIndex = 13; + private const int constructiveStrengthLinearModelPropertyIndex = 14; + private const int constructiveStrengthQuadraticModelPropertyIndex = 15; + private const int bankWidthPropertyIndex = 16; + private const int evaluationLevelPropertyIndex = 17; + private const int verticalDistancePropertyIndex = 18; + private const int failureProbabilityReparationPropertyIndex = 19; + private const int failureCollisionEnergyPropertyIndex = 20; + private const int shipMassPropertyIndex = 21; + private const int shipVelocityPropertyIndex = 22; + private const int levellingCountPropertyIndex = 23; + private const int probabilityCollisionSecondaryStructurePropertyIndex = 24; + private const int flowVelocityStructureClosablePropertyIndex = 25; + private const int stabilityLinearModelPropertyIndex = 26; + private const int stabilityQuadraticModelPropertyIndex = 27; + [Test] public void Constructor_ExpectedValues() { @@ -62,6 +91,111 @@ var expectedLocation = new Point2D(new RoundedDouble(0, structure.Location.X), new RoundedDouble(0, structure.Location.Y)); Assert.AreEqual(expectedLocation, properties.Location); + + Assert.AreEqual("Normaal", properties.InsideWaterLevel.DistributionType); + Assert.AreEqual(structure.InsideWaterLevel, properties.InsideWaterLevel.Data); + Assert.IsTrue(properties.InsideWaterLevel.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.InsideWaterLevel.DynamicReadOnlyValidationMethod("StandardDeviation")); + + Assert.AreEqual("Normaal", properties.InsideWaterLevelFailureConstruction.DistributionType); + Assert.AreEqual(structure.InsideWaterLevelFailureConstruction, properties.InsideWaterLevelFailureConstruction.Data); + Assert.IsTrue(properties.InsideWaterLevelFailureConstruction.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.InsideWaterLevelFailureConstruction.DynamicReadOnlyValidationMethod("StandardDeviation")); + + Assert.AreEqual(structure.StructureNormalOrientation, properties.StructureNormalOrientation); + Assert.AreEqual(structure.InflowModelType, properties.InflowModelType); + + Assert.AreEqual("Normaal", properties.WidthFlowApertures.DistributionType); + Assert.AreEqual(structure.WidthFlowApertures, properties.WidthFlowApertures.Data); + Assert.IsTrue(properties.WidthFlowApertures.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.WidthFlowApertures.DynamicReadOnlyValidationMethod("CoefficientOfVariation")); + + Assert.AreEqual("Lognormaal", properties.AreaFlowApertures.DistributionType); + Assert.AreEqual(structure.AreaFlowApertures, properties.AreaFlowApertures.Data); + Assert.IsTrue(properties.AreaFlowApertures.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.AreaFlowApertures.DynamicReadOnlyValidationMethod("StandardDeviation")); + + Assert.AreEqual("Lognormaal", properties.FlowWidthAtBottomProtection.DistributionType); + Assert.AreEqual(structure.FlowWidthAtBottomProtection, properties.FlowWidthAtBottomProtection.Data); + Assert.IsTrue(properties.FlowWidthAtBottomProtection.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.FlowWidthAtBottomProtection.DynamicReadOnlyValidationMethod("StandardDeviation")); + + Assert.AreEqual("Lognormaal", properties.StorageStructureArea.DistributionType); + Assert.AreEqual(structure.StorageStructureArea, properties.StorageStructureArea.Data); + Assert.IsTrue(properties.StorageStructureArea.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.StorageStructureArea.DynamicReadOnlyValidationMethod("CoefficientOfVariation")); + + Assert.AreEqual("Lognormaal", properties.AllowedLevelIncreaseStorage.DistributionType); + Assert.AreEqual(structure.AllowedLevelIncreaseStorage, properties.AllowedLevelIncreaseStorage.Data); + Assert.IsTrue(properties.AllowedLevelIncreaseStorage.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.AllowedLevelIncreaseStorage.DynamicReadOnlyValidationMethod("StandardDeviation")); + + Assert.AreEqual("Normaal", properties.LevelCrestStructure.DistributionType); + Assert.AreEqual(structure.LevelCrestStructure, properties.LevelCrestStructure.Data); + Assert.IsTrue(properties.LevelCrestStructure.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.LevelCrestStructure.DynamicReadOnlyValidationMethod("StandardDeviation")); + + Assert.AreEqual("Normaal", properties.ThresholdHeightOpenWeir.DistributionType); + Assert.AreEqual(structure.ThresholdHeightOpenWeir, properties.ThresholdHeightOpenWeir.Data); + Assert.IsTrue(properties.ThresholdHeightOpenWeir.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.ThresholdHeightOpenWeir.DynamicReadOnlyValidationMethod("StandardDeviation")); + + Assert.AreEqual("Lognormaal", properties.CriticalOvertoppingDischarge.DistributionType); + Assert.AreEqual(structure.CriticalOvertoppingDischarge, properties.CriticalOvertoppingDischarge.Data); + Assert.IsTrue(properties.CriticalOvertoppingDischarge.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.CriticalOvertoppingDischarge.DynamicReadOnlyValidationMethod("CoefficientOfVariation")); + + Assert.AreEqual("Lognormaal", properties.ConstructiveStrengthLinearModel.DistributionType); + Assert.AreEqual(structure.ConstructiveStrengthLinearModel, properties.ConstructiveStrengthLinearModel.Data); + Assert.IsTrue(properties.ConstructiveStrengthLinearModel.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.ConstructiveStrengthLinearModel.DynamicReadOnlyValidationMethod("CoefficientOfVariation")); + + Assert.AreEqual("Lognormaal", properties.ConstructiveStrengthQuadraticModel.DistributionType); + Assert.AreEqual(structure.ConstructiveStrengthQuadraticModel, properties.ConstructiveStrengthQuadraticModel.Data); + Assert.IsTrue(properties.ConstructiveStrengthQuadraticModel.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.ConstructiveStrengthQuadraticModel.DynamicReadOnlyValidationMethod("CoefficientOfVariation")); + + Assert.AreEqual("Normaal", properties.BankWidth.DistributionType); + Assert.AreEqual(structure.BankWidth, properties.BankWidth.Data); + Assert.IsTrue(properties.BankWidth.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.BankWidth.DynamicReadOnlyValidationMethod("StandardDeviation")); + + Assert.AreEqual(structure.EvaluationLevel, properties.EvaluationLevel); + Assert.AreEqual(structure.VerticalDistance, properties.VerticalDistance); + Assert.AreEqual(ProbabilityFormattingHelper.Format(structure.FailureProbabilityReparation), properties.FailureProbabilityReparation); + + Assert.AreEqual("Lognormaal", properties.FailureCollisionEnergy.DistributionType); + Assert.AreEqual(structure.FailureCollisionEnergy, properties.FailureCollisionEnergy.Data); + Assert.IsTrue(properties.FailureCollisionEnergy.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.FailureCollisionEnergy.DynamicReadOnlyValidationMethod("CoefficientOfVariation")); + + Assert.AreEqual("Normaal", properties.ShipMass.DistributionType); + Assert.AreEqual(structure.ShipMass, properties.ShipMass.Data); + Assert.IsTrue(properties.ShipMass.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.ShipMass.DynamicReadOnlyValidationMethod("CoefficientOfVariation")); + + Assert.AreEqual("Normaal", properties.ShipVelocity.DistributionType); + Assert.AreEqual(structure.ShipVelocity, properties.ShipVelocity.Data); + Assert.IsTrue(properties.ShipVelocity.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.ShipVelocity.DynamicReadOnlyValidationMethod("CoefficientOfVariation")); + + Assert.AreEqual(ProbabilityFormattingHelper.Format(structure.LevellingCount), properties.LevellingCount); + Assert.AreEqual(ProbabilityFormattingHelper.Format(structure.ProbabilityCollisionSecondaryStructure), properties.ProbabilityCollisionSecondaryStructure); + + Assert.AreEqual("Normaal", properties.FlowVelocityStructureClosable.DistributionType); + Assert.AreEqual(structure.FlowVelocityStructureClosable, properties.FlowVelocityStructureClosable.Data); + Assert.IsTrue(properties.FlowVelocityStructureClosable.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.FlowVelocityStructureClosable.DynamicReadOnlyValidationMethod("StandardDeviation")); + + Assert.AreEqual("Lognormaal", properties.StabilityLinearModel.DistributionType); + Assert.AreEqual(structure.StabilityLinearModel, properties.StabilityLinearModel.Data); + Assert.IsTrue(properties.StabilityLinearModel.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.StabilityLinearModel.DynamicReadOnlyValidationMethod("CoefficientOfVariation")); + + Assert.AreEqual("Lognormaal", properties.StabilityQuadraticModel.DistributionType); + Assert.AreEqual(structure.StabilityQuadraticModel, properties.StabilityQuadraticModel.Data); + Assert.IsTrue(properties.StabilityQuadraticModel.DynamicReadOnlyValidationMethod("Mean")); + Assert.IsTrue(properties.StabilityQuadraticModel.DynamicReadOnlyValidationMethod("CoefficientOfVariation")); } [Test] @@ -82,8 +216,10 @@ { BrowsableAttribute.Yes }); - Assert.AreEqual(2, dynamicProperties.Count); + Assert.AreEqual(28, dynamicProperties.Count); + const string schematizationCategory = "Schematisatie"; + const string hydraulicDataCategory = "Hydraulische gegevens"; const string generalCategory = "Algemeen"; PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; @@ -98,6 +234,118 @@ Assert.AreEqual("Locatie (RD) [m]", locationProperty.DisplayName); Assert.AreEqual("De coördinaten van de locatie van het kunstwerk in het Rijksdriehoeksstelsel.", locationProperty.Description); + PropertyDescriptor insideWaterLevelProperty = dynamicProperties[insideWaterLevelPropertyIndex]; + Assert.IsInstanceOf(insideWaterLevelProperty.Converter); + Assert.AreEqual(hydraulicDataCategory, insideWaterLevelProperty.Category); + + PropertyDescriptor insideWaterLevelFailureConstructionProperty = dynamicProperties[insideWaterLevelFailureConstructionPropertyIndex]; + Assert.IsInstanceOf(insideWaterLevelFailureConstructionProperty.Converter); + Assert.AreEqual(hydraulicDataCategory, insideWaterLevelFailureConstructionProperty.Category); + + PropertyDescriptor structureNormalOrientationProperty = dynamicProperties[structureNormalOrientationPropertyIndex]; + Assert.IsTrue(structureNormalOrientationProperty.IsReadOnly); + Assert.AreEqual(schematizationCategory, structureNormalOrientationProperty.Category); + Assert.AreEqual("Oriëntatie [°]", structureNormalOrientationProperty.DisplayName); + Assert.AreEqual("Oriëntatie van de normaal van het kunstwerk ten opzichte van het noorden.", structureNormalOrientationProperty.Description); + + PropertyDescriptor stabilityPointStructureTypeProperty = dynamicProperties[stabilityPointStructureInflowModelTypePropertyIndex]; + Assert.IsInstanceOf(stabilityPointStructureTypeProperty.Converter); + Assert.AreEqual(schematizationCategory, stabilityPointStructureTypeProperty.Category); + + PropertyDescriptor widthFlowAperturesProperty = dynamicProperties[widthFlowAperturesPropertyIndex]; + Assert.IsInstanceOf(widthFlowAperturesProperty.Converter); + Assert.AreEqual(schematizationCategory, widthFlowAperturesProperty.Category); + Assert.AreEqual("Breedte van doorstroomopening [m]", widthFlowAperturesProperty.DisplayName); + Assert.AreEqual("Breedte van de doorstroomopening.", widthFlowAperturesProperty.Description); + + PropertyDescriptor areaFlowAperturesProperty = dynamicProperties[areaFlowAperturesPropertyIndex]; + Assert.IsInstanceOf(areaFlowAperturesProperty.Converter); + Assert.AreEqual(schematizationCategory, areaFlowAperturesProperty.Category); + Assert.AreEqual("Doorstroomoppervlak [m²]", areaFlowAperturesProperty.DisplayName); + Assert.AreEqual("Doorstroomoppervlak van doorstroomopeningen.", areaFlowAperturesProperty.Description); + + PropertyDescriptor flowWidthAtBottomProtectionProperty = dynamicProperties[flowWidthAtBottomProtectionPropertyIndex]; + Assert.IsInstanceOf(flowWidthAtBottomProtectionProperty.Converter); + Assert.AreEqual(schematizationCategory, flowWidthAtBottomProtectionProperty.Category); + Assert.AreEqual("Stroomvoerende breedte bodembescherming [m]", flowWidthAtBottomProtectionProperty.DisplayName); + Assert.AreEqual("Stroomvoerende breedte bodembescherming.", flowWidthAtBottomProtectionProperty.Description); + + PropertyDescriptor storageStructureAreaProperty = dynamicProperties[storageStructureAreaPropertyIndex]; + Assert.IsInstanceOf(storageStructureAreaProperty.Converter); + Assert.AreEqual(schematizationCategory, storageStructureAreaProperty.Category); + Assert.AreEqual("Kombergend oppervlak [m²]", storageStructureAreaProperty.DisplayName); + Assert.AreEqual("Kombergend oppervlak.", storageStructureAreaProperty.Description); + + PropertyDescriptor allowedLevelIncreaseStorageProperty = dynamicProperties[allowedLevelIncreaseStoragePropertyIndex]; + Assert.IsInstanceOf(allowedLevelIncreaseStorageProperty.Converter); + Assert.AreEqual(schematizationCategory, allowedLevelIncreaseStorageProperty.Category); + Assert.AreEqual("Toegestane peilverhoging komberging [m]", allowedLevelIncreaseStorageProperty.DisplayName); + Assert.AreEqual("Toegestane peilverhoging komberging.", allowedLevelIncreaseStorageProperty.Description); + + PropertyDescriptor levelCrestStructureProperty = dynamicProperties[levelCrestStructurePropertyIndex]; + Assert.IsInstanceOf(levelCrestStructureProperty.Converter); + Assert.AreEqual(schematizationCategory, levelCrestStructureProperty.Category); + + PropertyDescriptor thresholdHeightOpenWeirProperty = dynamicProperties[thresholdHeightOpenWeirPropertyIndex]; + Assert.IsInstanceOf(thresholdHeightOpenWeirProperty.Converter); + Assert.AreEqual(schematizationCategory, thresholdHeightOpenWeirProperty.Category); + + PropertyDescriptor criticalOvertoppingDischargeProperty = dynamicProperties[criticalOvertoppingDischargePropertyIndex]; + Assert.IsInstanceOf(criticalOvertoppingDischargeProperty.Converter); + Assert.AreEqual(schematizationCategory, criticalOvertoppingDischargeProperty.Category); + Assert.AreEqual("Kritiek instromend debiet [m³/s/m]", criticalOvertoppingDischargeProperty.DisplayName); + Assert.AreEqual("Kritiek instromend debiet directe invoer.", criticalOvertoppingDischargeProperty.Description); + + PropertyDescriptor constructiveStrengthLinearModelProperty = dynamicProperties[constructiveStrengthLinearModelPropertyIndex]; + Assert.IsInstanceOf(constructiveStrengthLinearModelProperty.Converter); + Assert.AreEqual(schematizationCategory, constructiveStrengthLinearModelProperty.Category); + + PropertyDescriptor constructiveStrengthQuadraticModelProperty = dynamicProperties[constructiveStrengthQuadraticModelPropertyIndex]; + Assert.IsInstanceOf(constructiveStrengthQuadraticModelProperty.Converter); + Assert.AreEqual(schematizationCategory, constructiveStrengthQuadraticModelProperty.Category); + + PropertyDescriptor bankWidthProperty = dynamicProperties[bankWidthPropertyIndex]; + Assert.IsInstanceOf(bankWidthProperty.Converter); + Assert.AreEqual(schematizationCategory, bankWidthProperty.Category); + + PropertyDescriptor evaluationLevelProperty = dynamicProperties[evaluationLevelPropertyIndex]; + Assert.AreEqual(schematizationCategory, evaluationLevelProperty.Category); + + PropertyDescriptor verticalDistanceProperty = dynamicProperties[verticalDistancePropertyIndex]; + Assert.AreEqual(schematizationCategory, verticalDistanceProperty.Category); + + PropertyDescriptor failureProbabilityReparationProperty = dynamicProperties[failureProbabilityReparationPropertyIndex]; + Assert.AreEqual(schematizationCategory, failureProbabilityReparationProperty.Category); + + PropertyDescriptor failureCollisionEnergyProperty = dynamicProperties[failureCollisionEnergyPropertyIndex]; + Assert.IsInstanceOf(failureCollisionEnergyProperty.Converter); + Assert.AreEqual(schematizationCategory, failureCollisionEnergyProperty.Category); + + PropertyDescriptor shipMassProperty = dynamicProperties[shipMassPropertyIndex]; + Assert.IsInstanceOf(shipMassProperty.Converter); + Assert.AreEqual(schematizationCategory, shipMassProperty.Category); + + PropertyDescriptor shipVelocityProperty = dynamicProperties[shipVelocityPropertyIndex]; + Assert.IsInstanceOf(shipVelocityProperty.Converter); + Assert.AreEqual(schematizationCategory, shipVelocityProperty.Category); + + PropertyDescriptor levellingCountProperty = dynamicProperties[levellingCountPropertyIndex]; + Assert.AreEqual(schematizationCategory, levellingCountProperty.Category); + + PropertyDescriptor probabilityCollisionSecondaryStructureProperty = dynamicProperties[probabilityCollisionSecondaryStructurePropertyIndex]; + Assert.AreEqual(schematizationCategory, probabilityCollisionSecondaryStructureProperty.Category); + + PropertyDescriptor flowVelocityStructureClosableProperty = dynamicProperties[flowVelocityStructureClosablePropertyIndex]; + Assert.IsInstanceOf(flowVelocityStructureClosableProperty.Converter); + Assert.AreEqual(schematizationCategory, flowVelocityStructureClosableProperty.Category); + + PropertyDescriptor stabilityLinearModelProperty = dynamicProperties[stabilityLinearModelPropertyIndex]; + Assert.IsInstanceOf(stabilityLinearModelProperty.Converter); + Assert.AreEqual(schematizationCategory, stabilityLinearModelProperty.Category); + + PropertyDescriptor stabilityQuadraticModelProperty = dynamicProperties[stabilityQuadraticModelPropertyIndex]; + Assert.IsInstanceOf(stabilityQuadraticModelProperty.Converter); + Assert.AreEqual(schematizationCategory, stabilityQuadraticModelProperty.Category); } private static StabilityPointStructure CreateSimpleStabilityPointStructure()