Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Plugin/ClosingStructuresPlugin.cs =================================================================== diff -u -r3891e05ac0ab2144b552203b25ee836bf72e3189 -r2b8e6d793bceb2ff20d571436dfffefae210b76a --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision 3891e05ac0ab2144b552203b25ee836bf72e3189) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision 2b8e6d793bceb2ff20d571436dfffefae210b76a) @@ -25,7 +25,6 @@ using System.Linq; using System.Windows.Forms; using Core.Common.Base; -using Core.Common.Base.Data; using Core.Common.Base.IO; using Core.Common.Controls.TreeView; using Core.Common.Gui; @@ -44,7 +43,6 @@ using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; -using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Forms; @@ -821,88 +819,24 @@ private static void UpdateStructureDerivedCalculationInput(StructuresCalculation calculation) { - ClosingStructuresInput inputParameters = calculation.InputParameters; + if (!calculation.InputParameters.StructureParametersSynchronized) + { + calculation.InputParameters.SynchronizeStructureParameters(); - RoundedDouble currentStructureNormalOrientation = inputParameters.StructureNormalOrientation; - NormalDistribution currentLevelCrestStructureNotClosing = inputParameters.LevelCrestStructureNotClosing; - LogNormalDistribution currentFlowWidthAtBottomProtection = inputParameters.FlowWidthAtBottomProtection; - VariationCoefficientLogNormalDistribution currentCriticalOvertoppingDischarge = inputParameters.CriticalOvertoppingDischarge; - NormalDistribution currentWidthFlowApertures = inputParameters.WidthFlowApertures; - VariationCoefficientLogNormalDistribution currentStorageStructureArea = inputParameters.StorageStructureArea; - LogNormalDistribution currentAllowedLevelIncreaseStorage = inputParameters.AllowedLevelIncreaseStorage; - ClosingStructureInflowModelType currentInflowModelType = inputParameters.InflowModelType; - LogNormalDistribution currentAreaFlowApertures = inputParameters.AreaFlowApertures; - double currentFailureProbabilityOpenStructure = inputParameters.FailureProbabilityOpenStructure; - double currentFailureProbabilityReparation = inputParameters.FailureProbabilityReparation; - int currentIdenticalApertures = inputParameters.IdenticalApertures; - NormalDistribution currentInsideWaterLevel = inputParameters.InsideWaterLevel; - double currentProbabilityOrFrequencyOpenStructureBeforeFlooding = inputParameters.ProbabilityOrFrequencyOpenStructureBeforeFlooding; - NormalDistribution currentThresholdHeightOpenWeir = inputParameters.ThresholdHeightOpenWeir; + var affectedObjects = new List + { + calculation.InputParameters + }; - inputParameters.SynchronizeStructureParameters(); - - var affectedObjects = new List(); - if (IsDerivedInputUpdated(currentStructureNormalOrientation, - currentLevelCrestStructureNotClosing, - currentFlowWidthAtBottomProtection, - currentCriticalOvertoppingDischarge, - currentWidthFlowApertures, - currentStorageStructureArea, - currentAllowedLevelIncreaseStorage, - currentInflowModelType, - currentAreaFlowApertures, - currentFailureProbabilityOpenStructure, - currentFailureProbabilityReparation, - currentIdenticalApertures, - currentInsideWaterLevel, - currentProbabilityOrFrequencyOpenStructureBeforeFlooding, - currentThresholdHeightOpenWeir, - inputParameters)) - { - affectedObjects.Add(inputParameters); affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearCalculationOutput(calculation)); - } - foreach (IObservable affectedObject in affectedObjects) - { - affectedObject.NotifyObservers(); + foreach (IObservable affectedObject in affectedObjects) + { + affectedObject.NotifyObservers(); + } } } - private static bool IsDerivedInputUpdated(RoundedDouble currentStructureNormalOrientation, - NormalDistribution currentLevelCrestStructureNotClosing, - LogNormalDistribution currentFlowWidthAtBottomProtection, - VariationCoefficientLogNormalDistribution currentCriticalOvertoppingDischarge, - NormalDistribution currentWidthFlowApertures, - VariationCoefficientLogNormalDistribution currentStorageStructureArea, - LogNormalDistribution currentAllowedLevelIncreaseStorage, - ClosingStructureInflowModelType currentInflowModelType, - LogNormalDistribution currentAreaFlowApertures, - double currentFailureProbabilityOpenStructure, - double currentFailureProbabilityReparation, - int currentIdenticalApertures, - NormalDistribution currentInsideWaterLevel, - double currentProbabilityOrFrequencyOpenStructureBeforeFlooding, - NormalDistribution currentThresholdHeightOpenWeir, - ClosingStructuresInput actualInput) - { - return !Equals(currentStructureNormalOrientation, actualInput.StructureNormalOrientation) - || !Equals(currentLevelCrestStructureNotClosing, actualInput.LevelCrestStructureNotClosing) - || !Equals(currentFlowWidthAtBottomProtection, actualInput.FlowWidthAtBottomProtection) - || !Equals(currentCriticalOvertoppingDischarge, actualInput.CriticalOvertoppingDischarge) - || !Equals(currentWidthFlowApertures, actualInput.WidthFlowApertures) - || !Equals(currentStorageStructureArea, actualInput.StorageStructureArea) - || !Equals(currentAllowedLevelIncreaseStorage, actualInput.AllowedLevelIncreaseStorage) - || !Equals(currentInflowModelType, actualInput.InflowModelType) - || !Equals(currentAreaFlowApertures, actualInput.AreaFlowApertures) - || !Equals(currentFailureProbabilityOpenStructure, actualInput.FailureProbabilityOpenStructure) - || !Equals(currentFailureProbabilityReparation, actualInput.FailureProbabilityReparation) - || !Equals(currentIdenticalApertures, actualInput.IdenticalApertures) - || !Equals(currentInsideWaterLevel, actualInput.InsideWaterLevel) - || !Equals(currentProbabilityOrFrequencyOpenStructureBeforeFlooding, actualInput.ProbabilityOrFrequencyOpenStructureBeforeFlooding) - || !Equals(currentThresholdHeightOpenWeir, actualInput.ThresholdHeightOpenWeir); - } - #endregion #endregion