Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs =================================================================== diff -u -r8db49d5f51b6dd7e779a1fdcc70f5ced075261bf -rf73ccefc485b825ad692f48200a025338c14273d --- Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs (.../AssessmentSection.cs) (revision 8db49d5f51b6dd7e779a1fdcc70f5ced075261bf) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs (.../AssessmentSection.cs) (revision f73ccefc485b825ad692f48200a025338c14273d) @@ -61,6 +61,24 @@ private readonly ObservableList waveHeightCalculationsForFactorizedLowerLimitNorm = new ObservableList(); private ReferenceLine referenceLine; + private PipingFailureMechanism piping; + private GrassCoverErosionInwardsFailureMechanism grassCoverErosionInwards; + private MacroStabilityInwardsFailureMechanism macroStabilityInwards; + private MacroStabilityOutwardsFailureMechanism macroStabilityOutwards; + private MicrostabilityFailureMechanism microstability; + private StabilityStoneCoverFailureMechanism stabilityStoneCover; + private WaveImpactAsphaltCoverFailureMechanism waveImpactAsphaltCover; + private WaterPressureAsphaltCoverFailureMechanism waterPressureAsphaltCover; + private GrassCoverErosionOutwardsFailureMechanism grassCoverErosionOutwards; + private GrassCoverSlipOffOutwardsFailureMechanism grassCoverSlipOffOutwards; + private GrassCoverSlipOffInwardsFailureMechanism grassCoverSlipOffInwards; + private HeightStructuresFailureMechanism heightStructures; + private ClosingStructuresFailureMechanism closingStructures; + private PipingStructureFailureMechanism pipingStructure; + private StabilityPointStructuresFailureMechanism stabilityPointStructures; + private StrengthStabilityLengthwiseConstructionFailureMechanism strengthStabilityLengthwiseConstruction; + private DuneErosionFailureMechanism duneErosion; + private TechnicalInnovationFailureMechanism technicalInnovation; /// /// Initializes a new instance of the class. @@ -94,24 +112,24 @@ HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - Piping = new PipingFailureMechanism(); - GrassCoverErosionInwards = new GrassCoverErosionInwardsFailureMechanism(); - MacroStabilityInwards = new MacroStabilityInwardsFailureMechanism(); - MacroStabilityOutwards = new MacroStabilityOutwardsFailureMechanism(); - Microstability = new MicrostabilityFailureMechanism(); - StabilityStoneCover = new StabilityStoneCoverFailureMechanism(); - WaveImpactAsphaltCover = new WaveImpactAsphaltCoverFailureMechanism(); - WaterPressureAsphaltCover = new WaterPressureAsphaltCoverFailureMechanism(); - GrassCoverErosionOutwards = new GrassCoverErosionOutwardsFailureMechanism(); - GrassCoverSlipOffOutwards = new GrassCoverSlipOffOutwardsFailureMechanism(); - GrassCoverSlipOffInwards = new GrassCoverSlipOffInwardsFailureMechanism(); - HeightStructures = new HeightStructuresFailureMechanism(); - ClosingStructures = new ClosingStructuresFailureMechanism(); - StabilityPointStructures = new StabilityPointStructuresFailureMechanism(); - StrengthStabilityLengthwiseConstruction = new StrengthStabilityLengthwiseConstructionFailureMechanism(); - PipingStructure = new PipingStructureFailureMechanism(); - DuneErosion = new DuneErosionFailureMechanism(); - TechnicalInnovation = new TechnicalInnovationFailureMechanism(); + piping = new PipingFailureMechanism(); + grassCoverErosionInwards = new GrassCoverErosionInwardsFailureMechanism(); + macroStabilityInwards = new MacroStabilityInwardsFailureMechanism(); + macroStabilityOutwards = new MacroStabilityOutwardsFailureMechanism(); + microstability = new MicrostabilityFailureMechanism(); + stabilityStoneCover = new StabilityStoneCoverFailureMechanism(); + waveImpactAsphaltCover = new WaveImpactAsphaltCoverFailureMechanism(); + waterPressureAsphaltCover = new WaterPressureAsphaltCoverFailureMechanism(); + grassCoverErosionOutwards = new GrassCoverErosionOutwardsFailureMechanism(); + grassCoverSlipOffOutwards = new GrassCoverSlipOffOutwardsFailureMechanism(); + grassCoverSlipOffInwards = new GrassCoverSlipOffInwardsFailureMechanism(); + heightStructures = new HeightStructuresFailureMechanism(); + closingStructures = new ClosingStructuresFailureMechanism(); + stabilityPointStructures = new StabilityPointStructuresFailureMechanism(); + strengthStabilityLengthwiseConstruction = new StrengthStabilityLengthwiseConstructionFailureMechanism(); + pipingStructure = new PipingStructureFailureMechanism(); + duneErosion = new DuneErosionFailureMechanism(); + technicalInnovation = new TechnicalInnovationFailureMechanism(); const int otherContribution = 30; FailureMechanismContribution = new FailureMechanismContribution(GetContributingFailureMechanisms(), @@ -124,92 +142,326 @@ /// /// Gets or sets the "Dijken en dammen - Piping" failure mechanism. /// - public PipingFailureMechanism Piping { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public PipingFailureMechanism Piping + { + get + { + return piping; + } + set + { + ValidateContribution(piping, value); + piping = value; + } + } /// /// Gets or sets the "Dijken en dammen - Grasbekleding erosie kruin en binnentalud" failure mechanism. /// - public GrassCoverErosionInwardsFailureMechanism GrassCoverErosionInwards { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public GrassCoverErosionInwardsFailureMechanism GrassCoverErosionInwards + { + get + { + return grassCoverErosionInwards; + } + set + { + ValidateContribution(grassCoverErosionInwards, value); + grassCoverErosionInwards = value; + } + } /// /// Gets or sets the "Dijken en dammen - Macrostabiliteit binnenwaarts" failure mechanism. /// - public MacroStabilityInwardsFailureMechanism MacroStabilityInwards { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public MacroStabilityInwardsFailureMechanism MacroStabilityInwards + { + get + { + return macroStabilityInwards; + } + set + { + ValidateContribution(macroStabilityInwards, value); + macroStabilityInwards = value; + } + } /// /// Gets or sets the "Dijken en dammen - Macrostabiliteit buitenwaarts" failure mechanism. /// - public MacroStabilityOutwardsFailureMechanism MacroStabilityOutwards { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public MacroStabilityOutwardsFailureMechanism MacroStabilityOutwards + { + get + { + return macroStabilityOutwards; + } + set + { + ValidateContribution(macroStabilityOutwards, value); + macroStabilityOutwards = value; + } + } /// /// Gets or sets the "Dijken en dammen - Microstabiliteit" failure mechanism. /// - public MicrostabilityFailureMechanism Microstability { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public MicrostabilityFailureMechanism Microstability + { + get + { + return microstability; + } + set + { + ValidateContribution(microstability, value); + microstability = value; + } + } /// /// Gets or sets the "Dijken en dammen - Stabiliteit steenzetting" failure mechanism. /// - public StabilityStoneCoverFailureMechanism StabilityStoneCover { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public StabilityStoneCoverFailureMechanism StabilityStoneCover + { + get + { + return stabilityStoneCover; + } + set + { + ValidateContribution(stabilityStoneCover, value); + stabilityStoneCover = value; + } + } /// /// Gets or sets the "Dijken en dammen - Golfklappen op asfaltbekledingen" failure mechanism. /// - public WaveImpactAsphaltCoverFailureMechanism WaveImpactAsphaltCover { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public WaveImpactAsphaltCoverFailureMechanism WaveImpactAsphaltCover + { + get + { + return waveImpactAsphaltCover; + } + set + { + ValidateContribution(waveImpactAsphaltCover, value); + waveImpactAsphaltCover = value; + } + } /// /// Gets or sets the "Dijken en dammen - Wateroverdruk bij asfaltbekleding" failure mechanism. /// - public WaterPressureAsphaltCoverFailureMechanism WaterPressureAsphaltCover { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public WaterPressureAsphaltCoverFailureMechanism WaterPressureAsphaltCover + { + get + { + return waterPressureAsphaltCover; + } + set + { + ValidateContribution(waterPressureAsphaltCover, value); + waterPressureAsphaltCover = value; + } + } /// /// Gets or sets the "Dijken en dammen - Grasbekleding erosie buitentalud" failure mechanism. /// - public GrassCoverErosionOutwardsFailureMechanism GrassCoverErosionOutwards { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public GrassCoverErosionOutwardsFailureMechanism GrassCoverErosionOutwards + { + get + { + return grassCoverErosionOutwards; + } + set + { + ValidateContribution(grassCoverErosionOutwards, value); + grassCoverErosionOutwards = value; + } + } /// /// Gets or sets the "Dijken en dammen - Grasbekleding afschuiven buitentalud" failure mechanism. /// - public GrassCoverSlipOffOutwardsFailureMechanism GrassCoverSlipOffOutwards { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public GrassCoverSlipOffOutwardsFailureMechanism GrassCoverSlipOffOutwards + { + get + { + return grassCoverSlipOffOutwards; + } + set + { + ValidateContribution(grassCoverSlipOffOutwards, value); + grassCoverSlipOffOutwards = value; + } + } /// /// Gets or sets the "Dijken en dammen - Grasbekleding afschuiven binnentalud" failure mechanism. /// - public GrassCoverSlipOffInwardsFailureMechanism GrassCoverSlipOffInwards { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public GrassCoverSlipOffInwardsFailureMechanism GrassCoverSlipOffInwards + { + get + { + return grassCoverSlipOffInwards; + } + set + { + ValidateContribution(grassCoverSlipOffInwards, value); + grassCoverSlipOffInwards = value; + } + } /// /// Gets or sets the "Kunstwerken - Hoogte kunstwerk" failure mechanism. /// - public HeightStructuresFailureMechanism HeightStructures { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public HeightStructuresFailureMechanism HeightStructures + { + get + { + return heightStructures; + } + set + { + ValidateContribution(heightStructures, value); + heightStructures = value; + } + } /// /// Gets or sets the "Kunstwerken - Betrouwbaarheid sluiting kunstwerk" failure mechanism. /// - public ClosingStructuresFailureMechanism ClosingStructures { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public ClosingStructuresFailureMechanism ClosingStructures + { + get + { + return closingStructures; + } + set + { + ValidateContribution(closingStructures, value); + closingStructures = value; + } + } /// /// Gets or sets the "Kunstwerken - Piping bij kunstwerk" failure mechanism. /// - public PipingStructureFailureMechanism PipingStructure { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public PipingStructureFailureMechanism PipingStructure + { + get + { + return pipingStructure; + } + set + { + ValidateContribution(pipingStructure, value); + pipingStructure = value; + } + } /// /// Gets or sets the "Kunstwerken - Sterkte en stabiliteit puntconstructies" failure mechanism. /// - public StabilityPointStructuresFailureMechanism StabilityPointStructures { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public StabilityPointStructuresFailureMechanism StabilityPointStructures + { + get + { + return stabilityPointStructures; + } + set + { + ValidateContribution(stabilityPointStructures, value); + stabilityPointStructures = value; + } + } /// /// Gets or sets the "Kunstwerken - Sterkte en stabiliteit langsconstructies" failure mechanism. /// - public StrengthStabilityLengthwiseConstructionFailureMechanism StrengthStabilityLengthwiseConstruction { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public StrengthStabilityLengthwiseConstructionFailureMechanism StrengthStabilityLengthwiseConstruction + { + get + { + return strengthStabilityLengthwiseConstruction; + } + set + { + ValidateContribution(strengthStabilityLengthwiseConstruction, value); + strengthStabilityLengthwiseConstruction = value; + } + } /// /// Gets or sets the "Duinwaterkering - Duinafslag" failure mechanism. /// - public DuneErosionFailureMechanism DuneErosion { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public DuneErosionFailureMechanism DuneErosion + { + get + { + return duneErosion; + } + set + { + ValidateContribution(duneErosion, value); + duneErosion = value; + } + } /// /// Gets or sets the "Technische innovaties - Technische innovaties" failure mechanism. /// - public TechnicalInnovationFailureMechanism TechnicalInnovation { get; set; } + /// Thrown when the contribution of + /// is not equal to the contribution of the old failure mechanism. + public TechnicalInnovationFailureMechanism TechnicalInnovation + { + get + { + return technicalInnovation; + } + set + { + ValidateContribution(technicalInnovation, value); + technicalInnovation = value; + } + } public IObservableEnumerable WaterLevelCalculationsForFactorizedSignalingNorm { @@ -417,6 +669,22 @@ SetFailureMechanismRelevancy(); } + /// + /// Validates whether the contribution of + /// is equal to the contribution of . + /// + /// The old failure mechanism value. + /// The new failure mechanism value. + /// Thrown when the contribution of + /// is not equal to the contribution of . + private static void ValidateContribution(IFailureMechanism oldFailureMechanism, IFailureMechanism newFailureMechanism) + { + if (!(Math.Abs(oldFailureMechanism.Contribution - newFailureMechanism.Contribution) < double.Epsilon)) + { + throw new ArgumentException(Resources.AssessmentSection_ValidateContribution_Contribution_new_FailureMechanism_must_be_equal_to_old_FailureMechanism); + } + } + private void ClearHydraulicBoundaryLocationCalculations() { waterLevelCalculationsForFactorizedSignalingNorm.Clear();