Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsDataSynchronizationService.cs
===================================================================
diff -u -r50ecb5a95c088a636ec38ce3c5f2fc8addcd67e3 -rebf9ee4894ed003e5756d9c56be1489d54e57695
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsDataSynchronizationService.cs (.../GrassCoverErosionOutwardsDataSynchronizationService.cs) (revision 50ecb5a95c088a636ec38ce3c5f2fc8addcd67e3)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsDataSynchronizationService.cs (.../GrassCoverErosionOutwardsDataSynchronizationService.cs) (revision ebf9ee4894ed003e5756d9c56be1489d54e57695)
@@ -20,7 +20,11 @@
// All rights reserved.
using System;
+using System.Linq;
+using Core.Common.Base;
+using Core.Common.Base.Data;
using Ringtoets.GrassCoverErosionOutwards.Data;
+using Ringtoets.HydraRing.Data;
namespace Ringtoets.GrassCoverErosionOutwards.Service
{
@@ -45,5 +49,34 @@
calculation.Output = null;
}
+
+ ///
+ /// Clears the output of the grass cover erosion outwards hydraulic boundary locations within the .
+ ///
+ /// The locations.
+ /// true when one or multiple locations are affected by clearing the output. false otherwise.
+ /// Thrown when is null.
+ public static bool ClearHydraulicBoundaryLocationOutput(ObservableList locations)
+ {
+ if (locations == null)
+ {
+ throw new ArgumentNullException("locations");
+ }
+
+ var locationsAffected = false;
+
+ foreach (var location in locations.Where(location =>
+ !double.IsNaN(location.DesignWaterLevel) ||
+ !double.IsNaN(location.WaveHeight)))
+ {
+ location.DesignWaterLevel = (RoundedDouble) double.NaN;
+ location.WaveHeight = (RoundedDouble) double.NaN;
+ location.DesignWaterLevelCalculationConvergence = CalculationConvergence.NotCalculated;
+ location.WaveHeightCalculationConvergence = CalculationConvergence.NotCalculated;
+ locationsAffected = true;
+ }
+
+ return locationsAffected;
+ }
}
}
\ No newline at end of file