Index: Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresInputContextProperties.cs =================================================================== diff -u -r470c4cf48e458c3654386e7ad751781a0fc886a3 -r889dc5080d60eeeec6fe4d4cfba286b59be83497 --- Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresInputContextProperties.cs (.../StabilityPointStructuresInputContextProperties.cs) (revision 470c4cf48e458c3654386e7ad751781a0fc886a3) +++ Riskeer/StabilityPointStructures/src/Riskeer.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresInputContextProperties.cs (.../StabilityPointStructuresInputContextProperties.cs) (revision 889dc5080d60eeeec6fe4d4cfba286b59be83497) @@ -23,12 +23,14 @@ using System.Collections.Generic; using System.ComponentModel; using Core.Common.Base.Data; +using Core.Common.Base.Geometry; using Core.Common.Gui.Attributes; using Core.Common.Util; using Core.Common.Util.Attributes; using Riskeer.Common.Data.DikeProfiles; using Riskeer.Common.Data.Structures; using Riskeer.Common.Forms.ChangeHandlers; +using Riskeer.Common.Forms.PresentationObjects; using Riskeer.Common.Forms.PropertyClasses; using Riskeer.Common.Forms.TypeConverters; using Riskeer.StabilityPointStructures.Data; @@ -48,6 +50,18 @@ StructuresCalculation, StabilityPointStructuresFailureMechanism> { + private const int generalDataCategoryIndex = 1; + private const int hydraulicLoadsCategoryIndex = 2; + private const int constructiveFailureCategoryIndex = 3; + private const int schematizationIncomingFlowCategoryIndex = 4; + private const int schematizationGroundErosionCategoryIndex = 5; + private const int schematizationStorageStructureCategoryIndex = 6; + private const int constructiveInstabilityCategoryIndex = 7; + private const int collisionSecondaryStructureCategoryIndex = 8; + private const int foreshoreCategoryIndex = 9; + private const int outputSettingsCategoryIndex = 10; + private const int totalNrOfCategories = 10; + private const int structurePropertyIndex = 0; private const int structureLocationPropertyIndex = 1; private const int hydraulicBoundaryLocationPropertyIndex = 2; @@ -120,6 +134,24 @@ StormDurationPropertyIndex = stormDurationPropertyIndex }, propertyChangeHandler) {} + #region Output Settings + + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_OutputSettings), + outputSettingsCategoryIndex, totalNrOfCategories)] + public override bool ShouldIllustrationPointsBeCalculated + { + get + { + return base.ShouldIllustrationPointsBeCalculated; + } + set + { + base.ShouldIllustrationPointsBeCalculated = value; + } + } + + #endregion + [DynamicVisibleValidationMethod] public bool DynamicVisibleValidationMethod(string propertyName) { @@ -198,12 +230,55 @@ || base.ShouldPropertyBeReadOnlyInAbsenseOfStructure(property); } + #region General data + + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_GeneralData), + generalDataCategoryIndex, totalNrOfCategories)] + public override SelectableHydraulicBoundaryLocation SelectedHydraulicBoundaryLocation + { + get + { + return base.SelectedHydraulicBoundaryLocation; + } + set + { + base.SelectedHydraulicBoundaryLocation = value; + } + } + + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_GeneralData), + generalDataCategoryIndex, totalNrOfCategories)] + public override StabilityPointStructure Structure + { + get + { + return base.Structure; + } + set + { + base.Structure = value; + } + } + + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_GeneralData), + generalDataCategoryIndex, totalNrOfCategories)] + public override Point2D StructureLocation + { + get + { + return base.StructureLocation; + } + } + + #endregion + #region Schematization #region Hydraulic loads [PropertyOrder(volumicWeightWaterPropertyIndex)] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_HydraulicLoads))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_HydraulicLoads), + hydraulicLoadsCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_VolumicWeightWater_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_VolumicWeightWater_Description))] public RoundedDouble VolumicWeightWater @@ -220,7 +295,8 @@ [PropertyOrder(insideWaterLevelFailureConstructionPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_HydraulicLoads))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_HydraulicLoads), + hydraulicLoadsCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_InsideWaterLevelFailureConstruction_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_InsideWaterLevelFailureConstruction_Description))] public NormalDistributionProperties InsideWaterLevelFailureConstruction @@ -238,7 +314,8 @@ [PropertyOrder(bankWidthPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_HydraulicLoads))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_HydraulicLoads), + hydraulicLoadsCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_BankWidth_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_BankWidth_Description))] public NormalDistributionProperties BankWidth @@ -256,7 +333,8 @@ [DynamicReadOnly] [PropertyOrder(verticalDistancePropertyIndex)] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_HydraulicLoads))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_HydraulicLoads), + hydraulicLoadsCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_VerticalDistance_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_VerticalDistance_Description))] public RoundedDouble VerticalDistance @@ -278,7 +356,8 @@ [DynamicReadOnly] [PropertyOrder(loadSchematizationTypePropertyIndex)] [TypeConverter(typeof(EnumTypeConverter))] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_ConstructiveFailure))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_ConstructiveFailure), + constructiveFailureCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_LoadSchematizationType_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_LoadSchematizationType_Description))] public LoadSchematizationType LoadSchematizationType @@ -296,7 +375,8 @@ [DynamicVisible] [PropertyOrder(constructiveStrengthLinearLoadModelPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_ConstructiveFailure))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_ConstructiveFailure), + constructiveFailureCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_ConstructiveStrengthLinearLoadModel_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_ConstructiveStrengthLinearLoadModel_Description))] public VariationCoefficientLogNormalDistributionProperties ConstructiveStrengthLinearLoadModel @@ -315,7 +395,8 @@ [DynamicVisible] [PropertyOrder(constructiveStrengthQuadraticLoadModelPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_ConstructiveFailure))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_ConstructiveFailure), + constructiveFailureCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_ConstructiveStrengthQuadraticLoadModel_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_ConstructiveStrengthQuadraticLoadModel_Description))] public VariationCoefficientLogNormalDistributionProperties ConstructiveStrengthQuadraticLoadModel @@ -333,7 +414,8 @@ [DynamicReadOnly] [PropertyOrder(evaluationLevelPropertyIndex)] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_ConstructiveFailure))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_ConstructiveFailure), + constructiveFailureCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_EvaluationLevel_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_EvaluationLevel_Description))] public RoundedDouble EvaluationLevel @@ -351,7 +433,8 @@ [DynamicReadOnly] [PropertyOrder(failureProbabilityRepairClosurePropertyIndex)] [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_ConstructiveFailure))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematization_ConstructiveFailure), + constructiveFailureCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_FailureProbabilityRepairClosure_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_FailureProbabilityRepairClosure_Description))] public double FailureProbabilityRepairClosure @@ -373,7 +456,8 @@ [DynamicReadOnly] [PropertyOrder(inflowModelTypePropertyIndex)] [TypeConverter(typeof(EnumTypeConverter))] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow))] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow), + schematizationIncomingFlowCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_InflowModelType_DisplayName))] [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_InflowModelType_Description))] public StabilityPointStructureInflowModelType InflowModelType @@ -389,6 +473,8 @@ } [DynamicVisible] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow), + schematizationIncomingFlowCategoryIndex, totalNrOfCategories)] public override NormalDistributionProperties WidthFlowApertures { get @@ -399,7 +485,8 @@ [PropertyOrder(levelCrestStructurePropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow))] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow), + schematizationIncomingFlowCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_LevelCrestStructure_DisplayName))] [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_LevelCrestStructure_Description))] public NormalDistributionProperties LevelCrestStructure @@ -417,7 +504,8 @@ [PropertyOrder(insideWaterLevelPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow))] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow), + schematizationIncomingFlowCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_InsideWaterLevel_DisplayName))] [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_InsideWaterLevel_Description))] public NormalDistributionProperties InsideWaterLevel @@ -435,7 +523,8 @@ [PropertyOrder(thresholdHeightOpenWeirPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow))] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow), + schematizationIncomingFlowCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_ThresholdHeightOpenWeir_DisplayName))] [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_ThresholdHeightOpenWeir_Description))] public NormalDistributionProperties ThresholdHeightOpenWeir @@ -454,7 +543,8 @@ [DynamicVisible] [PropertyOrder(areaFlowAperturesPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow))] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow), + schematizationIncomingFlowCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_AreaFlowApertures_DisplayName))] [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_AreaFlowApertures_Description))] public LogNormalDistributionProperties AreaFlowApertures @@ -473,7 +563,8 @@ [DynamicVisible] [PropertyOrder(drainCoefficientPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow))] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow), + schematizationIncomingFlowCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_DrainCoefficient_DisplayName))] [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_DrainCoefficient_Description))] public NormalDistributionProperties DrainCoefficient @@ -488,7 +579,8 @@ } [PropertyOrder(factorStormDurationOpenStructurePropertyIndex)] - [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow))] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow), + schematizationIncomingFlowCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_FactorStormDurationOpenStructure_DisplayName))] [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Structure_FactorStormDurationOpenStructure_Description))] public RoundedDouble FactorStormDurationOpenStructure @@ -503,14 +595,39 @@ } } + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow), + schematizationIncomingFlowCategoryIndex, totalNrOfCategories)] + public override RoundedDouble StructureNormalOrientation + { + get + { + return base.StructureNormalOrientation; + } + set + { + base.StructureNormalOrientation = value; + } + } + + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Incoming_flow), + schematizationIncomingFlowCategoryIndex, totalNrOfCategories)] + public override VariationCoefficientLogNormalDistributionProperties StormDuration + { + get + { + return base.StormDuration; + } + } + #endregion #region Constructive Instability [DynamicVisible] [PropertyOrder(stabilityLinearLoadModelPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematizatization_ConstructionInstability))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematizatization_ConstructionInstability), + constructiveInstabilityCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_StabilityLinearLoadModel_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_StabilityLinearLoadModel_Description))] public VariationCoefficientLogNormalDistributionProperties StabilityLinearLoadModel @@ -529,7 +646,8 @@ [DynamicVisible] [PropertyOrder(stabilityQuadraticLoadModelPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematizatization_ConstructionInstability))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Schematizatization_ConstructionInstability), + constructiveInstabilityCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_StabilityQuadraticLoadModel_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_StabilityQuadraticLoadModel_Description))] public VariationCoefficientLogNormalDistributionProperties StabilityQuadraticLoadModel @@ -551,7 +669,8 @@ [PropertyOrder(failureCollisionEnergyPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categoties_Schematization_CollisionSecondaryStructure))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categoties_Schematization_CollisionSecondaryStructure), + collisionSecondaryStructureCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_FailureCollisionEnergy_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_FailureCollisionEnergy_Description))] public VariationCoefficientLogNormalDistributionProperties FailureCollisionEnergy @@ -569,7 +688,8 @@ [PropertyOrder(shipMassPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categoties_Schematization_CollisionSecondaryStructure))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categoties_Schematization_CollisionSecondaryStructure), + collisionSecondaryStructureCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_ShipMass_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_ShipMass_Description))] public VariationCoefficientNormalDistributionProperties ShipMass @@ -587,7 +707,8 @@ [PropertyOrder(shipVelocityPropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categoties_Schematization_CollisionSecondaryStructure))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categoties_Schematization_CollisionSecondaryStructure), + collisionSecondaryStructureCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_ShipVelocity_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_ShipVelocity_Description))] public VariationCoefficientNormalDistributionProperties ShipVelocity @@ -605,7 +726,8 @@ [DynamicReadOnly] [PropertyOrder(levellingCountPropertyIndex)] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categoties_Schematization_CollisionSecondaryStructure))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categoties_Schematization_CollisionSecondaryStructure), + collisionSecondaryStructureCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_LevellingCount_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_LevellingCount_Description))] public int LevellingCount @@ -623,7 +745,8 @@ [DynamicReadOnly] [PropertyOrder(probabilityCollisionSecondaryStructurePropertyIndex)] [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categoties_Schematization_CollisionSecondaryStructure))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categoties_Schematization_CollisionSecondaryStructure), + collisionSecondaryStructureCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_ProbabilityCollisionSecondaryStructure_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_ProbabilityCollisionSecondaryStructure_Description))] public double ProbabilityCollisionSecondaryStructure @@ -640,7 +763,8 @@ [PropertyOrder(flowVelocityStructureClosablePropertyIndex)] [TypeConverter(typeof(ExpandableObjectConverter))] - [ResourcesCategory(typeof(Resources), nameof(Resources.Categoties_Schematization_CollisionSecondaryStructure))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categoties_Schematization_CollisionSecondaryStructure), + collisionSecondaryStructureCategoryIndex, totalNrOfCategories)] [ResourcesDisplayName(typeof(Resources), nameof(Resources.Structure_FlowVelocityStructureClosable_DisplayName))] [ResourcesDescription(typeof(Resources), nameof(Resources.Structure_FlowVelocityStructureClosable_Description))] public VariationCoefficientNormalDistributionProperties FlowVelocityStructureClosable @@ -658,6 +782,110 @@ #endregion + #region Ground erosion + + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Ground_erosion), + schematizationGroundErosionCategoryIndex, totalNrOfCategories)] + public override VariationCoefficientLogNormalDistributionProperties CriticalOvertoppingDischarge + { + get + { + return base.CriticalOvertoppingDischarge; + } + } + + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Ground_erosion), + schematizationGroundErosionCategoryIndex, totalNrOfCategories)] + public override LogNormalDistributionProperties FlowWidthAtBottomProtection + { + get + { + return base.FlowWidthAtBottomProtection; + } + } + + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Ground_erosion), + schematizationGroundErosionCategoryIndex, totalNrOfCategories)] + public override double FailureProbabilityStructureWithErosion + { + get + { + return base.FailureProbabilityStructureWithErosion; + } + set + { + base.FailureProbabilityStructureWithErosion = value; + } + } + #endregion + + #region Storage structure + + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Storage_structure), + schematizationStorageStructureCategoryIndex, totalNrOfCategories)] + public override VariationCoefficientLogNormalDistributionProperties StorageStructureArea + { + get + { + return base.StorageStructureArea; + } + } + + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Storage_structure), + schematizationStorageStructureCategoryIndex, totalNrOfCategories)] + public override LogNormalDistributionProperties AllowedLevelIncreaseStorage + { + get + { + return base.AllowedLevelIncreaseStorage; + } + } + + #endregion + + #region Foreshore profile + + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Foreshore), + foreshoreCategoryIndex, totalNrOfCategories)] + public override ForeshoreProfile ForeshoreProfile + { + get + { + return base.ForeshoreProfile; + } + set + { + base.ForeshoreProfile = value; + } + } + + [DynamicPropertyOrder] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Foreshore), + foreshoreCategoryIndex, totalNrOfCategories)] + public override UseBreakWaterProperties UseBreakWater + { + get + { + return base.UseBreakWater; + } + } + + [DynamicPropertyOrder] + [TypeConverter(typeof(ExpandableObjectConverter))] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_Schematization_Foreshore), + foreshoreCategoryIndex, totalNrOfCategories)] + public override UseForeshoreProperties UseForeshore + { + get + { + return base.UseForeshore; + } + } + + #endregion + + #endregion } } \ No newline at end of file Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresInputContextPropertiesTest.cs =================================================================== diff -u -r470c4cf48e458c3654386e7ad751781a0fc886a3 -r889dc5080d60eeeec6fe4d4cfba286b59be83497 --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresInputContextPropertiesTest.cs (.../StabilityPointStructuresInputContextPropertiesTest.cs) (revision 470c4cf48e458c3654386e7ad751781a0fc886a3) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresInputContextPropertiesTest.cs (.../StabilityPointStructuresInputContextPropertiesTest.cs) (revision 889dc5080d60eeeec6fe4d4cfba286b59be83497) @@ -33,6 +33,7 @@ using Riskeer.Common.Data.DikeProfiles; using Riskeer.Common.Data.Structures; using Riskeer.Common.Data.TestUtil; +using Riskeer.Common.Forms.PresentationObjects; using Riskeer.Common.Forms.PropertyClasses; using Riskeer.Common.Forms.TestUtil; using Riskeer.Common.Forms.TypeConverters; @@ -149,6 +150,7 @@ Assert.AreSame(input.BankWidth, properties.BankWidth.Data); Assert.AreEqual(input.EvaluationLevel, properties.EvaluationLevel); Assert.AreEqual(input.VerticalDistance, properties.VerticalDistance); + Assert.AreEqual(input.ShouldIllustrationPointsBeCalculated, properties.ShouldIllustrationPointsBeCalculated); TestHelper.AssertTypeConverter( nameof(StabilityPointStructuresInputContextProperties.FailureProbabilityStructureWithErosion)); @@ -163,6 +165,148 @@ } [Test] + [TestCaseSource(nameof(GetGeneralPropertyIndices))] + public void Constructor_VariousInflowType_GeneralPropertiesHaveExpectedAttributeValues( + StabilityPointStructureInflowModelType inflowModelType, + LoadSchematizationType loadSchematizationType, + GeneralPropertyIndices generalPropertyIndices) + { + // Setup + var handler = mockRepository.Stub(); + mockRepository.ReplayAll(); + + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + var calculation = new StructuresCalculation + { + InputParameters = + { + Structure = new TestStabilityPointStructure(), + InflowModelType = inflowModelType, + LoadSchematizationType = loadSchematizationType + } + }; + var inputContext = new StabilityPointStructuresInputContext(calculation.InputParameters, + calculation, + failureMechanism, + assessmentSection); + + // Call + var properties = new StabilityPointStructuresInputContextProperties(inputContext, handler); + + // Assert + const string generalDataCategory = "\t\t\t\t\t\t\t\t\tBasisgegevens"; + const string schematizationIncomingFlowCategory = "\t\t\t\t\t\tSchematisering instromend debiet/volume"; + const string schematizationGroundErosionCategory = "\t\t\t\t\tSchematisering bodembescherming"; + const string schematizationStorageStructureCategory = "\t\t\t\tSchematisering komberging"; + const string foreshoreCategory = "\tSchematisering voorland en (haven)dam"; + const string outputSettingsCategory = "Uitvoer"; + + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + + PropertyDescriptor structureProperty = dynamicProperties[generalPropertyIndices.StructurePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(structureProperty, + generalDataCategory, + "Kunstwerk", + "Het kunstwerk dat gebruikt wordt in de berekening."); + + PropertyDescriptor structureLocationProperty = dynamicProperties[generalPropertyIndices.StructureLocationPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(structureLocationProperty, + generalDataCategory, + "Locatie (RD) [m]", + "De coördinaten van de locatie van het kunstwerk in het Rijksdriehoeksstelsel.", + true); + + PropertyDescriptor hydraulicBoundaryLocationProperty = dynamicProperties[generalPropertyIndices.HydraulicBoundaryLocationPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(hydraulicBoundaryLocationProperty, + generalDataCategory, + "Hydraulische belastingenlocatie", + "De hydraulische belastingenlocatie."); + + PropertyDescriptor structureNormalOrientationProperty = dynamicProperties[generalPropertyIndices.StructureNormalOrientationPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(structureNormalOrientationProperty, + schematizationIncomingFlowCategory, + "Oriëntatie [°]", + "Oriëntatie van de normaal van het kunstwerk ten opzichte van het noorden."); + + if (generalPropertyIndices.WidthFlowAperturesPropertyIndex.HasValue) + { + PropertyDescriptor widthFlowAperturesProperty = dynamicProperties[generalPropertyIndices.WidthFlowAperturesPropertyIndex.Value]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(widthFlowAperturesProperty, + schematizationIncomingFlowCategory, + "Breedte van doorstroomopening [m]", + "Breedte van de doorstroomopening.", + true); + } + + PropertyDescriptor stormDurationProperty = dynamicProperties[generalPropertyIndices.StormDurationPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(stormDurationProperty, + schematizationIncomingFlowCategory, + "Stormduur [uur]", + "Stormduur.", + true); + + PropertyDescriptor criticalOvertoppingDischargeProperty = dynamicProperties[generalPropertyIndices.CriticalOverToppingDischargePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(criticalOvertoppingDischargeProperty, + schematizationGroundErosionCategory, + "Kritiek instromend debiet [m³/s/m]", + "Kritiek instromend debiet directe invoer per strekkende meter.", + true); + + PropertyDescriptor flowWidthAtBottomProtectionProperty = dynamicProperties[generalPropertyIndices.FlowWidthAtBottomProtectionPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(flowWidthAtBottomProtectionProperty, + schematizationGroundErosionCategory, + "Stroomvoerende breedte bodembescherming [m]", + "Stroomvoerende breedte bodembescherming.", + true); + + PropertyDescriptor failureProbabilityStructureWithErosionProperty = dynamicProperties[generalPropertyIndices.FailureProbabilityStructureWithErosionPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(failureProbabilityStructureWithErosionProperty, + schematizationGroundErosionCategory, + "Faalkans gegeven erosie bodem [-]", + "Faalkans kunstwerk gegeven erosie bodem."); + + PropertyDescriptor storageStructureAreaProperty = dynamicProperties[generalPropertyIndices.StorageStructureAreaPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(storageStructureAreaProperty, + schematizationStorageStructureCategory, + "Kombergend oppervlak [m²]", + "Kombergend oppervlak.", + true); + + PropertyDescriptor allowedLevelIncreaseStorageProperty = dynamicProperties[generalPropertyIndices.AllowedLevelIncreaseStoragePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(allowedLevelIncreaseStorageProperty, + schematizationStorageStructureCategory, + "Toegestane peilverhoging komberging [m]", + "Toegestane peilverhoging komberging.", + true); + + PropertyDescriptor foreshoreProfileProperty = dynamicProperties[generalPropertyIndices.ForeShoreProfilePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(foreshoreProfileProperty, + foreshoreCategory, + "Voorlandprofiel", + "De schematisatie van het voorlandprofiel."); + + PropertyDescriptor useBreakWaterProperty = dynamicProperties[generalPropertyIndices.UseBreakWaterPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(useBreakWaterProperty, + foreshoreCategory, + "Dam", + "Eigenschappen van de dam.", + true); + + PropertyDescriptor useForeshoreProperty = dynamicProperties[generalPropertyIndices.UseForeshorePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(useForeshoreProperty, + foreshoreCategory, + "Voorlandgeometrie", + "Eigenschappen van de voorlandgeometrie.", + true); + + PropertyDescriptor shouldIllustrationPointsBeCalculatedProperty = dynamicProperties[generalPropertyIndices.ShouldIllustrationPointsBeCalculatedPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(shouldIllustrationPointsBeCalculatedProperty, + outputSettingsCategory, + "Illustratiepunten inlezen", + "Neem de informatie over de illustratiepunten op in het berekeningsresultaat."); + } + + [Test] public void Constructor_LinearLowSillStructure_PropertiesHaveExpectedAttributesValues() { // Setup @@ -188,11 +332,11 @@ var properties = new StabilityPointStructuresInputContextProperties(inputContext, handler); // Assert - const string schematizationHydraulicLoadsCategory = "Schematisering hydraulische belastingen op constructie"; - const string schematizationConstructiveFailureCategory = "Schematisering bezwijken waterkerende constructie-onderdelen"; - const string schematizationConstructiveInstabilityCategory = "Schematisering instabiliteit constructie en grondlichaam"; - const string schematizationCollisionSecondaryStructureCategory = "Schematisering aanvaring tweede keermiddel"; - const string schematizationInflowCategory = "Schematisering instromend debiet/volume"; + const string schematizationHydraulicLoadsCategory = "\t\t\t\t\t\t\t\tSchematisering hydraulische belastingen op constructie"; + const string schematizationConstructiveFailureCategory = "\t\t\t\t\t\t\tSchematisering bezwijken waterkerende constructie-onderdelen"; + const string schematizationConstructiveInstabilityCategory = "\t\t\tSchematisering instabiliteit constructie en grondlichaam"; + const string schematizationCollisionSecondaryStructureCategory = "\t\tSchematisering aanvaring tweede keermiddel"; + const string schematizationInflowCategory = "\t\t\t\t\t\tSchematisering instromend debiet/volume"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(35, dynamicProperties.Count); @@ -372,23 +516,6 @@ true); DistributionPropertiesTestHelper.AssertPropertiesAreReadOnly(properties.FlowVelocityStructureClosable, false, true); - // Only check the order of the base properties - Assert.AreEqual("Kunstwerk", dynamicProperties[linearLowSillStructurePropertyIndex].DisplayName); - Assert.AreEqual("Locatie (RD) [m]", dynamicProperties[linearLowSillStructureLocationPropertyIndex].DisplayName); - Assert.AreEqual("Oriëntatie [°]", dynamicProperties[linearLowSillStructureNormalOrientationPropertyIndex].DisplayName); - Assert.AreEqual("Stroomvoerende breedte bodembescherming [m]", dynamicProperties[linearLowSillFlowWidthAtBottomProtectionPropertyIndex].DisplayName); - Assert.AreEqual("Breedte van doorstroomopening [m]", dynamicProperties[linearLowSillWidthFlowAperturesPropertyIndex].DisplayName); - Assert.AreEqual("Kombergend oppervlak [m²]", dynamicProperties[linearLowSillStorageStructureAreaPropertyIndex].DisplayName); - Assert.AreEqual("Toegestane peilverhoging komberging [m]", dynamicProperties[linearLowSillAllowedLevelIncreaseStoragePropertyIndex].DisplayName); - Assert.AreEqual("Kritiek instromend debiet [m³/s/m]", dynamicProperties[linearLowSillCriticalOvertoppingDischargePropertyIndex].DisplayName); - Assert.AreEqual("Faalkans gegeven erosie bodem [-]", dynamicProperties[linearLowSillFailureProbabilityStructureWithErosionPropertyIndex].DisplayName); - Assert.AreEqual("Voorlandprofiel", dynamicProperties[linearLowSillForeshoreProfilePropertyIndex].DisplayName); - Assert.AreEqual("Dam", dynamicProperties[linearLowSillUseBreakWaterPropertyIndex].DisplayName); - Assert.AreEqual("Voorlandgeometrie", dynamicProperties[linearLowSillUseForeshorePropertyIndex].DisplayName); - Assert.AreEqual("Hydraulische belastingenlocatie", dynamicProperties[linearLowSillHydraulicBoundaryLocationPropertyIndex].DisplayName); - Assert.AreEqual("Stormduur [uur]", dynamicProperties[linearLowSillStormDurationPropertyIndex].DisplayName); - Assert.AreEqual("Illustratiepunten inlezen", dynamicProperties[linearLowSillCalculateIllustrationPointsPropertyIndex].DisplayName); - mockRepository.VerifyAll(); } @@ -418,11 +545,11 @@ var properties = new StabilityPointStructuresInputContextProperties(inputContext, handler); // Assert - const string schematizationHydraulicLoadsCategory = "Schematisering hydraulische belastingen op constructie"; - const string schematizationConstructiveFailureCategory = "Schematisering bezwijken waterkerende constructie-onderdelen"; - const string schematizationConstructiveInstabilityCategory = "Schematisering instabiliteit constructie en grondlichaam"; - const string schematizationCollisionSecondaryStructureCategory = "Schematisering aanvaring tweede keermiddel"; - const string schematizationInflowCategory = "Schematisering instromend debiet/volume"; + const string schematizationHydraulicLoadsCategory = "\t\t\t\t\t\t\t\tSchematisering hydraulische belastingen op constructie"; + const string schematizationConstructiveFailureCategory = "\t\t\t\t\t\t\tSchematisering bezwijken waterkerende constructie-onderdelen"; + const string schematizationConstructiveInstabilityCategory = "\t\t\tSchematisering instabiliteit constructie en grondlichaam"; + const string schematizationCollisionSecondaryStructureCategory = "\t\tSchematisering aanvaring tweede keermiddel"; + const string schematizationInflowCategory = "\t\t\t\t\t\tSchematisering instromend debiet/volume"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(35, dynamicProperties.Count); @@ -602,23 +729,6 @@ true); DistributionPropertiesTestHelper.AssertPropertiesAreReadOnly(properties.FlowVelocityStructureClosable, false, true); - // Only check the order of the base properties - Assert.AreEqual("Kunstwerk", dynamicProperties[quadraticLowSillStructurePropertyIndex].DisplayName); - Assert.AreEqual("Locatie (RD) [m]", dynamicProperties[quadraticLowSillStructureLocationPropertyIndex].DisplayName); - Assert.AreEqual("Oriëntatie [°]", dynamicProperties[quadraticLowSillStructureNormalOrientationPropertyIndex].DisplayName); - Assert.AreEqual("Stroomvoerende breedte bodembescherming [m]", dynamicProperties[quadraticLowSillFlowWidthAtBottomProtectionPropertyIndex].DisplayName); - Assert.AreEqual("Breedte van doorstroomopening [m]", dynamicProperties[quadraticLowSillWidthFlowAperturesPropertyIndex].DisplayName); - Assert.AreEqual("Kombergend oppervlak [m²]", dynamicProperties[quadraticLowSillStorageStructureAreaPropertyIndex].DisplayName); - Assert.AreEqual("Toegestane peilverhoging komberging [m]", dynamicProperties[quadraticLowSillAllowedLevelIncreaseStoragePropertyIndex].DisplayName); - Assert.AreEqual("Kritiek instromend debiet [m³/s/m]", dynamicProperties[quadraticLowSillCriticalOvertoppingDischargePropertyIndex].DisplayName); - Assert.AreEqual("Faalkans gegeven erosie bodem [-]", dynamicProperties[quadraticLowSillFailureProbabilityStructureWithErosionPropertyIndex].DisplayName); - Assert.AreEqual("Voorlandprofiel", dynamicProperties[quadraticLowSillForeshoreProfilePropertyIndex].DisplayName); - Assert.AreEqual("Dam", dynamicProperties[quadraticLowSillUseBreakWaterPropertyIndex].DisplayName); - Assert.AreEqual("Voorlandgeometrie", dynamicProperties[quadraticLowSillUseForeshorePropertyIndex].DisplayName); - Assert.AreEqual("Hydraulische belastingenlocatie", dynamicProperties[quadraticLowSillHydraulicBoundaryLocationPropertyIndex].DisplayName); - Assert.AreEqual("Stormduur [uur]", dynamicProperties[quadraticLowSillStormDurationPropertyIndex].DisplayName); - Assert.AreEqual("Illustratiepunten inlezen", dynamicProperties[quadraticLowSillCalculateIllustrationPointsPropertyIndex].DisplayName); - mockRepository.VerifyAll(); } @@ -648,11 +758,11 @@ var properties = new StabilityPointStructuresInputContextProperties(inputContext, handler); // Assert - const string schematizationHydraulicLoadsCategory = "Schematisering hydraulische belastingen op constructie"; - const string schematizationConstructiveFailureCategory = "Schematisering bezwijken waterkerende constructie-onderdelen"; - const string schematizationConstructiveInstabilityCategory = "Schematisering instabiliteit constructie en grondlichaam"; - const string schematizationCollisionSecondaryStructureCategory = "Schematisering aanvaring tweede keermiddel"; - const string schematizationInflowCategory = "Schematisering instromend debiet/volume"; + const string schematizationHydraulicLoadsCategory = "\t\t\t\t\t\t\t\tSchematisering hydraulische belastingen op constructie"; + const string schematizationConstructiveFailureCategory = "\t\t\t\t\t\t\tSchematisering bezwijken waterkerende constructie-onderdelen"; + const string schematizationConstructiveInstabilityCategory = "\t\t\tSchematisering instabiliteit constructie en grondlichaam"; + const string schematizationCollisionSecondaryStructureCategory = "\t\tSchematisering aanvaring tweede keermiddel"; + const string schematizationInflowCategory = "\t\t\t\t\t\tSchematisering instromend debiet/volume"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(36, dynamicProperties.Count); @@ -852,22 +962,6 @@ true); DistributionPropertiesTestHelper.AssertPropertiesAreReadOnly(properties.FlowVelocityStructureClosable, false, true); - // Only check the order of the base properties - Assert.AreEqual("Kunstwerk", dynamicProperties[linearFloodedCulvertStructurePropertyIndex].DisplayName); - Assert.AreEqual("Locatie (RD) [m]", dynamicProperties[linearFloodedCulvertStructureLocationPropertyIndex].DisplayName); - Assert.AreEqual("Oriëntatie [°]", dynamicProperties[linearFloodedCulvertStructureNormalOrientationPropertyIndex].DisplayName); - Assert.AreEqual("Stroomvoerende breedte bodembescherming [m]", dynamicProperties[linearFloodedCulvertFlowWidthAtBottomProtectionPropertyIndex].DisplayName); - Assert.AreEqual("Kombergend oppervlak [m²]", dynamicProperties[linearFloodedCulvertStorageStructureAreaPropertyIndex].DisplayName); - Assert.AreEqual("Toegestane peilverhoging komberging [m]", dynamicProperties[linearFloodedCulvertAllowedLevelIncreaseStoragePropertyIndex].DisplayName); - Assert.AreEqual("Kritiek instromend debiet [m³/s/m]", dynamicProperties[linearFloodedCulvertCriticalOvertoppingDischargePropertyIndex].DisplayName); - Assert.AreEqual("Faalkans gegeven erosie bodem [-]", dynamicProperties[linearFloodedCulvertFailureProbabilityStructureWithErosionPropertyIndex].DisplayName); - Assert.AreEqual("Voorlandprofiel", dynamicProperties[linearFloodedCulvertForeshoreProfilePropertyIndex].DisplayName); - Assert.AreEqual("Dam", dynamicProperties[linearFloodedCulvertUseBreakWaterPropertyIndex].DisplayName); - Assert.AreEqual("Voorlandgeometrie", dynamicProperties[linearFloodedCulvertUseForeshorePropertyIndex].DisplayName); - Assert.AreEqual("Hydraulische belastingenlocatie", dynamicProperties[linearFloodedCulvertHydraulicBoundaryLocationPropertyIndex].DisplayName); - Assert.AreEqual("Stormduur [uur]", dynamicProperties[linearFloodedCulvertStormDurationPropertyIndex].DisplayName); - Assert.AreEqual("Illustratiepunten inlezen", dynamicProperties[linearFloodedCulvertCalculateIllustrationPointsPropertyIndex].DisplayName); - mockRepository.VerifyAll(); } @@ -897,11 +991,11 @@ var properties = new StabilityPointStructuresInputContextProperties(inputContext, handler); // Assert - const string schematizationHydraulicLoadsCategory = "Schematisering hydraulische belastingen op constructie"; - const string schematizationConstructiveFailureCategory = "Schematisering bezwijken waterkerende constructie-onderdelen"; - const string schematizationConstructiveInstabilityCategory = "Schematisering instabiliteit constructie en grondlichaam"; - const string schematizationCollisionSecondaryStructureCategory = "Schematisering aanvaring tweede keermiddel"; - const string schematizationInflowCategory = "Schematisering instromend debiet/volume"; + const string schematizationHydraulicLoadsCategory = "\t\t\t\t\t\t\t\tSchematisering hydraulische belastingen op constructie"; + const string schematizationConstructiveFailureCategory = "\t\t\t\t\t\t\tSchematisering bezwijken waterkerende constructie-onderdelen"; + const string schematizationConstructiveInstabilityCategory = "\t\t\tSchematisering instabiliteit constructie en grondlichaam"; + const string schematizationCollisionSecondaryStructureCategory = "\t\tSchematisering aanvaring tweede keermiddel"; + const string schematizationInflowCategory = "\t\t\t\t\t\tSchematisering instromend debiet/volume"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(36, dynamicProperties.Count); @@ -1101,22 +1195,6 @@ true); DistributionPropertiesTestHelper.AssertPropertiesAreReadOnly(properties.FlowVelocityStructureClosable, false, true); - // Only check the order of the base properties - Assert.AreEqual("Kunstwerk", dynamicProperties[quadraticFloodedCulvertStructurePropertyIndex].DisplayName); - Assert.AreEqual("Locatie (RD) [m]", dynamicProperties[quadraticFloodedCulvertStructureLocationPropertyIndex].DisplayName); - Assert.AreEqual("Oriëntatie [°]", dynamicProperties[quadraticFloodedCulvertStructureNormalOrientationPropertyIndex].DisplayName); - Assert.AreEqual("Stroomvoerende breedte bodembescherming [m]", dynamicProperties[quadraticFloodedCulvertFlowWidthAtBottomProtectionPropertyIndex].DisplayName); - Assert.AreEqual("Kombergend oppervlak [m²]", dynamicProperties[quadraticFloodedCulvertStorageStructureAreaPropertyIndex].DisplayName); - Assert.AreEqual("Toegestane peilverhoging komberging [m]", dynamicProperties[quadraticFloodedCulvertAllowedLevelIncreaseStoragePropertyIndex].DisplayName); - Assert.AreEqual("Kritiek instromend debiet [m³/s/m]", dynamicProperties[quadraticFloodedCulvertCriticalOvertoppingDischargePropertyIndex].DisplayName); - Assert.AreEqual("Faalkans gegeven erosie bodem [-]", dynamicProperties[quadraticFloodedCulvertFailureProbabilityStructureWithErosionPropertyIndex].DisplayName); - Assert.AreEqual("Voorlandprofiel", dynamicProperties[quadraticFloodedCulvertForeshoreProfilePropertyIndex].DisplayName); - Assert.AreEqual("Dam", dynamicProperties[quadraticFloodedCulvertUseBreakWaterPropertyIndex].DisplayName); - Assert.AreEqual("Voorlandgeometrie", dynamicProperties[quadraticFloodedCulvertUseForeshorePropertyIndex].DisplayName); - Assert.AreEqual("Hydraulische belastingenlocatie", dynamicProperties[quadraticFloodedCulvertHydraulicBoundaryLocationPropertyIndex].DisplayName); - Assert.AreEqual("Stormduur [uur]", dynamicProperties[quadraticFloodedCulvertStormDurationPropertyIndex].DisplayName); - Assert.AreEqual("Illustratiepunten inlezen", dynamicProperties[quadraticFloodedCulvertCalculateIllustrationPointsPropertyIndex].DisplayName); - mockRepository.VerifyAll(); } @@ -1237,6 +1315,37 @@ } [Test] + public void SetShouldIllustrationPointsBeCalculated_ValueChanged_UpdateDataAndNotifyObservers() + { + // Setup + var random = new Random(21); + bool newBoolean = random.NextBoolean(); + + var observer = mockRepository.StrictMock(); + observer.Expect(o => o.UpdateObserver()); + + var handler = mockRepository.Stub(); + mockRepository.ReplayAll(); + + var calculation = new StructuresCalculation(); + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + var inputContext = new StabilityPointStructuresInputContext(calculation.InputParameters, + calculation, + failureMechanism, + assessmentSection); + inputContext.Attach(observer); + + var properties = new StabilityPointStructuresInputContextProperties(inputContext, handler); + + // Call + properties.ShouldIllustrationPointsBeCalculated = newBoolean; + + // Assert + Assert.AreEqual(newBoolean, calculation.InputParameters.ShouldIllustrationPointsBeCalculated); + mockRepository.VerifyAll(); + } + + [Test] public void VolumicWeightWater_WithOrWithoutOutput_HasOutputFalseInputNotifiedAndCalculationNotifiedWhenHadOutput() { RoundedDouble height = new Random(21).NextRoundedDouble(); @@ -1437,6 +1546,102 @@ } [Test] + public void Structure_Always_InputChangedAndObservablesNotified() + { + var structure = new TestStabilityPointStructure(); + SetPropertyAndVerifyNotificationsAndOutput( + properties => properties.Structure = structure); + } + + [Test] + public void StructureNormalOrientation_Always_InputChangedAndObservablesNotified() + { + RoundedDouble orientation = new Random(21).NextRoundedDouble(); + SetPropertyAndVerifyNotificationsAndOutput( + properties => properties.StructureNormalOrientation = orientation); + } + + [Test] + public void FailureProbabilityStructureWithErosion_Always_InputChangedAndObservablesNotified() + { + var random = new Random(21); + SetPropertyAndVerifyNotificationsAndOutput( + properties => properties.FailureProbabilityStructureWithErosion = random.NextDouble()); + } + + [Test] + public void SelectedHydraulicBoundaryLocation_Always_InputChangedAndObservablesNotified() + { + var location = new SelectableHydraulicBoundaryLocation(new TestHydraulicBoundaryLocation(), null); + SetPropertyAndVerifyNotificationsAndOutput( + properties => properties.SelectedHydraulicBoundaryLocation = location); + } + + [Test] + public void ForeshoreProfile_Always_InputChangedAndObservablesNotified() + { + var profile = new TestForeshoreProfile(); + SetPropertyAndVerifyNotificationsAndOutput( + properties => properties.ForeshoreProfile = profile); + } + + [Test] + public void UseBreakWater_Always_InputChangedAndObservablesNotified() + { + bool useBreakWater = new Random(21).NextBoolean(); + SetPropertyAndVerifyNotificationsAndOutput( + properties => properties.UseBreakWater.UseBreakWater = useBreakWater); + } + + [Test] + public void UseForeshore_Always_InputChangedAndObservablesNotified() + { + bool useForeshore = new Random(21).NextBoolean(); + SetPropertyAndVerifyNotificationsAndOutput( + properties => properties.UseForeshore.UseForeshore = useForeshore); + } + + [Test] + public void FlowWidthAtBottomProtection_MeanChanged_InputChangedAndObservablesNotified() + { + RoundedDouble newMean = new Random(21).NextRoundedDouble(); + SetPropertyAndVerifyNotificationsAndOutput( + properties => properties.FlowWidthAtBottomProtection.Mean = newMean); + } + + [Test] + public void StorageStructureArea_MeanChanged_InputChangedAndObservablesNotified() + { + RoundedDouble newMean = new Random(21).NextRoundedDouble(); + SetPropertyAndVerifyNotificationsAndOutput( + properties => properties.StorageStructureArea.Mean = newMean); + } + + [Test] + public void AllowedLevelIncreaseStorage_MeanChanged_InputChangedAndObservablesNotified() + { + RoundedDouble newMean = new Random(21).NextRoundedDouble(); + SetPropertyAndVerifyNotificationsAndOutput( + properties => properties.AllowedLevelIncreaseStorage.Mean = newMean); + } + + [Test] + public void CriticalOvertoppingDischarge_MeanChanged_InputChangedAndObservablesNotified() + { + RoundedDouble newMean = new Random(21).NextRoundedDouble(); + SetPropertyAndVerifyNotificationsAndOutput( + properties => properties.CriticalOvertoppingDischarge.Mean = newMean); + } + + [Test] + public void StormDuration_MeanChanged_InputChangedAndObservablesNotified() + { + RoundedDouble newMean = new Random(21).NextRoundedDouble(); + SetPropertyAndVerifyNotificationsAndOutput( + properties => properties.StormDuration.Mean = newMean); + } + + [Test] public void SetStructure_StructureInSection_UpdateSectionResults() { // Setup @@ -1657,6 +1862,89 @@ mockRepository.VerifyAll(); } + private static IEnumerable GetGeneralPropertyIndices() + { + yield return new TestCaseData(StabilityPointStructureInflowModelType.LowSill, + LoadSchematizationType.Linear, + new GeneralPropertyIndices(linearLowSillStructurePropertyIndex, linearLowSillStructureLocationPropertyIndex, linearLowSillHydraulicBoundaryLocationPropertyIndex, + linearLowSillStructureNormalOrientationPropertyIndex, linearLowSillFlowWidthAtBottomProtectionPropertyIndex, linearLowSillWidthFlowAperturesPropertyIndex, + linearLowSillStorageStructureAreaPropertyIndex, linearLowSillAllowedLevelIncreaseStoragePropertyIndex, linearLowSillCriticalOvertoppingDischargePropertyIndex, + linearLowSillFailureProbabilityStructureWithErosionPropertyIndex, linearLowSillForeshoreProfilePropertyIndex, + linearLowSillUseBreakWaterPropertyIndex, linearLowSillUseForeshorePropertyIndex, linearLowSillStormDurationPropertyIndex, + linearLowSillCalculateIllustrationPointsPropertyIndex)); + + yield return new TestCaseData(StabilityPointStructureInflowModelType.LowSill, + LoadSchematizationType.Quadratic, + new GeneralPropertyIndices(quadraticLowSillStructurePropertyIndex, quadraticLowSillStructureLocationPropertyIndex, quadraticLowSillHydraulicBoundaryLocationPropertyIndex, + quadraticLowSillStructureNormalOrientationPropertyIndex, quadraticLowSillFlowWidthAtBottomProtectionPropertyIndex, quadraticLowSillWidthFlowAperturesPropertyIndex, + quadraticLowSillStorageStructureAreaPropertyIndex, quadraticLowSillAllowedLevelIncreaseStoragePropertyIndex, quadraticLowSillCriticalOvertoppingDischargePropertyIndex, + quadraticLowSillFailureProbabilityStructureWithErosionPropertyIndex, quadraticLowSillForeshoreProfilePropertyIndex, + quadraticLowSillUseBreakWaterPropertyIndex, quadraticLowSillUseForeshorePropertyIndex, quadraticLowSillStormDurationPropertyIndex, + quadraticLowSillCalculateIllustrationPointsPropertyIndex)); + + yield return new TestCaseData(StabilityPointStructureInflowModelType.FloodedCulvert, + LoadSchematizationType.Linear, + new GeneralPropertyIndices(linearFloodedCulvertStructurePropertyIndex, linearFloodedCulvertStructureLocationPropertyIndex, linearFloodedCulvertHydraulicBoundaryLocationPropertyIndex, + linearFloodedCulvertStructureNormalOrientationPropertyIndex, linearFloodedCulvertFlowWidthAtBottomProtectionPropertyIndex, null, + linearFloodedCulvertStorageStructureAreaPropertyIndex, linearFloodedCulvertAllowedLevelIncreaseStoragePropertyIndex, linearFloodedCulvertCriticalOvertoppingDischargePropertyIndex, + linearFloodedCulvertFailureProbabilityStructureWithErosionPropertyIndex, linearFloodedCulvertForeshoreProfilePropertyIndex, + linearFloodedCulvertUseBreakWaterPropertyIndex, linearFloodedCulvertUseForeshorePropertyIndex, linearFloodedCulvertStormDurationPropertyIndex, + linearFloodedCulvertCalculateIllustrationPointsPropertyIndex)); + + yield return new TestCaseData(StabilityPointStructureInflowModelType.FloodedCulvert, + LoadSchematizationType.Quadratic, + new GeneralPropertyIndices(quadraticFloodedCulvertStructurePropertyIndex, quadraticFloodedCulvertStructureLocationPropertyIndex, quadraticFloodedCulvertHydraulicBoundaryLocationPropertyIndex, + quadraticFloodedCulvertStructureNormalOrientationPropertyIndex, quadraticFloodedCulvertFlowWidthAtBottomProtectionPropertyIndex, null, + quadraticFloodedCulvertStorageStructureAreaPropertyIndex, quadraticFloodedCulvertAllowedLevelIncreaseStoragePropertyIndex, quadraticFloodedCulvertCriticalOvertoppingDischargePropertyIndex, + quadraticFloodedCulvertFailureProbabilityStructureWithErosionPropertyIndex, quadraticFloodedCulvertForeshoreProfilePropertyIndex, + quadraticFloodedCulvertUseBreakWaterPropertyIndex, quadraticFloodedCulvertUseForeshorePropertyIndex, quadraticFloodedCulvertStormDurationPropertyIndex, + quadraticFloodedCulvertCalculateIllustrationPointsPropertyIndex)); + } + + public class GeneralPropertyIndices + { + public GeneralPropertyIndices(int structurePropertyIndex, int structureLocationPropertyIndex, int hydraulicBoundaryLocationPropertyIndex, + int structureNormalOrientationPropertyIndex, + int flowWidthAtBottomProtectionPropertyIndex, int? widthFlowAperturesPropertyIndex, + int storageStructureAreaPropertyIndex, int allowedLevelIncreaseStoragePropertyIndex, + int criticalOverToppingDischargePropertyIndex, int failureProbabilityStructureWithErosionPropertyIndex, + int foreShoreProfilePropertyIndex, int useBreakWaterPropertyIndex, int useForeshorePropertyIndex, + int stormDurationPropertyIndex, int shouldIllustrationPointsBeCalculatedPropertyIndex) + { + StructurePropertyIndex = structurePropertyIndex; + StructureLocationPropertyIndex = structureLocationPropertyIndex; + HydraulicBoundaryLocationPropertyIndex = hydraulicBoundaryLocationPropertyIndex; + StructureNormalOrientationPropertyIndex = structureNormalOrientationPropertyIndex; + FlowWidthAtBottomProtectionPropertyIndex = flowWidthAtBottomProtectionPropertyIndex; + WidthFlowAperturesPropertyIndex = widthFlowAperturesPropertyIndex; + StorageStructureAreaPropertyIndex = storageStructureAreaPropertyIndex; + AllowedLevelIncreaseStoragePropertyIndex = allowedLevelIncreaseStoragePropertyIndex; + CriticalOverToppingDischargePropertyIndex = criticalOverToppingDischargePropertyIndex; + FailureProbabilityStructureWithErosionPropertyIndex = failureProbabilityStructureWithErosionPropertyIndex; + ForeShoreProfilePropertyIndex = foreShoreProfilePropertyIndex; + UseBreakWaterPropertyIndex = useBreakWaterPropertyIndex; + UseForeshorePropertyIndex = useForeshorePropertyIndex; + StormDurationPropertyIndex = stormDurationPropertyIndex; + ShouldIllustrationPointsBeCalculatedPropertyIndex = shouldIllustrationPointsBeCalculatedPropertyIndex; + } + + public int StructurePropertyIndex { get; } + public int StructureLocationPropertyIndex { get; } + public int HydraulicBoundaryLocationPropertyIndex { get; } + public int StructureNormalOrientationPropertyIndex { get; } + public int FlowWidthAtBottomProtectionPropertyIndex { get; } + public int? WidthFlowAperturesPropertyIndex { get; } + public int StorageStructureAreaPropertyIndex { get; } + public int AllowedLevelIncreaseStoragePropertyIndex { get; } + public int CriticalOverToppingDischargePropertyIndex { get; } + public int FailureProbabilityStructureWithErosionPropertyIndex { get; } + public int ForeShoreProfilePropertyIndex { get; } + public int UseBreakWaterPropertyIndex { get; } + public int UseForeshorePropertyIndex { get; } + public int StormDurationPropertyIndex { get; } + public int ShouldIllustrationPointsBeCalculatedPropertyIndex { get; } + } + #region LowSill + Linear Model property Indices private const int linearLowSillStructurePropertyIndex = 0;