Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs
===================================================================
diff -u -r3891e05ac0ab2144b552203b25ee836bf72e3189 -r60a0a8b40eb4fdc1461e56f66e246a4417c5c6dd
--- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs (.../HeightStructuresInput.cs) (revision 3891e05ac0ab2144b552203b25ee836bf72e3189)
+++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs (.../HeightStructuresInput.cs) (revision 60a0a8b40eb4fdc1461e56f66e246a4417c5c6dd)
@@ -98,6 +98,30 @@
#endregion
+ ///
+ /// Gets whether the structure input parameters are synchronized with the set .
+ ///
+ /// Always returns false in case no structure is present.
+ public bool StructureParametersSynchronized
+ {
+ get
+ {
+ if (Structure == null)
+ {
+ return false;
+ }
+
+ return Equals(StructureNormalOrientation, Structure.StructureNormalOrientation)
+ && Equals(LevelCrestStructure, Structure.LevelCrestStructure)
+ && Equals(FlowWidthAtBottomProtection, Structure.FlowWidthAtBottomProtection)
+ && Equals(CriticalOvertoppingDischarge, Structure.CriticalOvertoppingDischarge)
+ && Equals(WidthFlowApertures, Structure.WidthFlowApertures)
+ && Equals(FailureProbabilityStructureWithErosion, Structure.FailureProbabilityStructureWithErosion)
+ && Equals(StorageStructureArea, Structure.StorageStructureArea)
+ && Equals(AllowedLevelIncreaseStorage, Structure.AllowedLevelIncreaseStorage);
+ }
+ }
+
public override void SynchronizeStructureParameters()
{
if (Structure != null)
Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresPlugin.cs
===================================================================
diff -u -r3891e05ac0ab2144b552203b25ee836bf72e3189 -r60a0a8b40eb4fdc1461e56f66e246a4417c5c6dd
--- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision 3891e05ac0ab2144b552203b25ee836bf72e3189)
+++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision 60a0a8b40eb4fdc1461e56f66e246a4417c5c6dd)
@@ -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;
@@ -37,7 +36,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;
@@ -831,60 +829,24 @@
private static void UpdateStructureDerivedCalculationInput(StructuresCalculation calculation)
{
- HeightStructuresInput inputParameters = calculation.InputParameters;
+ if (!calculation.InputParameters.StructureParametersSynchronized)
+ {
+ calculation.InputParameters.SynchronizeStructureParameters();
- RoundedDouble currentStructureNormalOrientation = inputParameters.StructureNormalOrientation;
- NormalDistribution currentLevelCrestStructure = inputParameters.LevelCrestStructure;
- LogNormalDistribution currentFlowWidthAtBottomProtection = inputParameters.FlowWidthAtBottomProtection;
- VariationCoefficientLogNormalDistribution currentCriticalOvertoppingDischarge = inputParameters.CriticalOvertoppingDischarge;
- NormalDistribution currentWidthFlowApertures = inputParameters.WidthFlowApertures;
- double currentFailureProbabilityStructureWithErosion = inputParameters.FailureProbabilityStructureWithErosion;
- VariationCoefficientLogNormalDistribution currentStorageStructureArea = inputParameters.StorageStructureArea;
- LogNormalDistribution currentAllowedLevelIncreaseStorage = inputParameters.AllowedLevelIncreaseStorage;
+ var affectedObjects = new List
+ {
+ calculation.InputParameters
+ };
- inputParameters.SynchronizeStructureParameters();
-
- var affectedObjects = new List();
- if (IsDerivedInputUpdated(currentStructureNormalOrientation,
- currentLevelCrestStructure,
- currentFlowWidthAtBottomProtection,
- currentCriticalOvertoppingDischarge,
- currentWidthFlowApertures,
- currentFailureProbabilityStructureWithErosion,
- currentStorageStructureArea,
- currentAllowedLevelIncreaseStorage,
- 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 currentLevelCrestStructure,
- LogNormalDistribution currentFlowWidthAtBottomProtection,
- VariationCoefficientLogNormalDistribution currentCriticalOvertoppingDischarge,
- NormalDistribution currentWidthFlowApertures,
- double currentFailureProbabilityStructureWithErosion,
- VariationCoefficientLogNormalDistribution currentStorageStructureArea,
- LogNormalDistribution currentAllowedLevelIncreaseStorage,
- HeightStructuresInput actualInput)
- {
- return !Equals(currentStructureNormalOrientation, actualInput.StructureNormalOrientation)
- || !Equals(currentLevelCrestStructure, actualInput.LevelCrestStructure)
- || !Equals(currentFlowWidthAtBottomProtection, actualInput.FlowWidthAtBottomProtection)
- || !Equals(currentCriticalOvertoppingDischarge, actualInput.CriticalOvertoppingDischarge)
- || !Equals(currentWidthFlowApertures, actualInput.WidthFlowApertures)
- || !Equals(currentFailureProbabilityStructureWithErosion, actualInput.FailureProbabilityStructureWithErosion)
- || !Equals(currentStorageStructureArea, actualInput.StorageStructureArea)
- || !Equals(currentAllowedLevelIncreaseStorage, actualInput.AllowedLevelIncreaseStorage);
- }
-
#endregion
#endregion