Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs =================================================================== diff -u -r702888aa87bd696750fcf3f5fcf50e2b8acb0390 -r989be010778ab44a778d79f0e2d892343acf0c0d --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision 702888aa87bd696750fcf3f5fcf50e2b8acb0390) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision 989be010778ab44a778d79f0e2d892343acf0c0d) @@ -872,48 +872,24 @@ private static void UpdateDikeProfileDerivedCalculationInput(GrassCoverErosionInwardsCalculation calculation) { - GrassCoverErosionInwardsInput inputParameters = calculation.InputParameters; - bool currentUseBreakWater = inputParameters.UseBreakWater; - BreakWater currentBreakWater = inputParameters.BreakWater; - RoundedDouble currentOrientation = inputParameters.Orientation; - RoundedDouble currentDikeHeight = inputParameters.DikeHeight; - bool currentUseForeshore = inputParameters.UseForeshore; + if (!calculation.InputParameters.DikeProfileParametersSynchronized) + { + calculation.InputParameters.SynchronizeDikeProfileParameters(); - // Reapply the dike profile will update the derived inputs - inputParameters.DikeProfile = inputParameters.DikeProfile; + var affectedObjects = new List + { + calculation.InputParameters + }; - var affectedObjects = new List(); - if (IsDerivedInputUpdated(currentUseBreakWater, - currentBreakWater, - currentOrientation, - currentDikeHeight, - currentUseForeshore, - 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(bool currentUseBreakWater, - BreakWater currentBreakWater, - RoundedDouble currentOrientation, - RoundedDouble currentDikeHeight, - bool currentUseForeshore, - GrassCoverErosionInwardsInput actualInput) - { - return currentUseBreakWater != actualInput.UseBreakWater - || !Equals(currentBreakWater, actualInput.BreakWater) - || currentOrientation != actualInput.Orientation - || currentDikeHeight != actualInput.DikeHeight - || currentUseForeshore != actualInput.UseForeshore; - } - #endregion #region Dike Profiles Importer