Index: Ringtoets/Common/src/Ringtoets.Common.Data/DikeProfiles/IHasForeshoreProfile.cs
===================================================================
diff -u -r9b0af3f940ae57b373ab4edfd7da944090255fde -r0e1d04a42ec35249482d25d398ed9dce132e0155
--- Ringtoets/Common/src/Ringtoets.Common.Data/DikeProfiles/IHasForeshoreProfile.cs (.../IHasForeshoreProfile.cs) (revision 9b0af3f940ae57b373ab4edfd7da944090255fde)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/DikeProfiles/IHasForeshoreProfile.cs (.../IHasForeshoreProfile.cs) (revision 0e1d04a42ec35249482d25d398ed9dce132e0155)
@@ -24,11 +24,27 @@
///
/// This interface describes if an object has a foreshore profile.
///
- public interface IHasForeshoreProfile {
-
+ public interface IHasForeshoreProfile
+ {
///
/// Gets or sets the foreshore profile.
///
ForeshoreProfile ForeshoreProfile { get; set; }
+
+ ///
+ /// Gets the value true if the parameters of the instance of
+ /// that are derived from
+ /// , matches the properties of
+ /// ; or false if this
+ /// is not the case, or if there is no
+ /// is assigned.
+ ///
+ bool IsForeshoreProfileParametersSynchronized { get; }
+
+ ///
+ /// Applies the properties of the to
+ /// the parameters of the instance of .
+ ///
+ void SynchronizeForeshoreProfileParameters();
}
}
\ No newline at end of file
Index: Ringtoets/Common/src/Ringtoets.Common.Data/Structures/StructuresInputBase.cs
===================================================================
diff -u -r22f2f5e1f5cf9047b2ab2e5097b56a37fbc4cc5b -r0e1d04a42ec35249482d25d398ed9dce132e0155
--- Ringtoets/Common/src/Ringtoets.Common.Data/Structures/StructuresInputBase.cs (.../StructuresInputBase.cs) (revision 22f2f5e1f5cf9047b2ab2e5097b56a37fbc4cc5b)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/Structures/StructuresInputBase.cs (.../StructuresInputBase.cs) (revision 0e1d04a42ec35249482d25d398ed9dce132e0155)
@@ -83,7 +83,7 @@
widthFlowApertures = new NormalDistribution(2);
SetDefaultCommonStructureSchematizationProperties();
- UpdateProfileParameters();
+ SynchronizeForeshoreProfileParameters();
}
#region Model factors
@@ -107,6 +107,12 @@
#endregion
///
+ /// Gets whether the structure input parameters are synchronized with the set .
+ ///
+ /// Always returns false in case no structure is present.
+ public abstract bool StructureParametersSynchronized { get; }
+
+ ///
/// Gets or sets the structure.
///
public T Structure
@@ -128,12 +134,6 @@
}
///
- /// Gets whether the structure input parameters are synchronized with the set .
- ///
- /// Always returns false in case no structure is present.
- public abstract bool StructureParametersSynchronized { get; }
-
- ///
/// Synchronizes the input parameters with the parameters of the structure.
///
/// When no structure is present, the input parameters are set to default values.
@@ -346,7 +346,7 @@
set
{
foreshoreProfile = value;
- UpdateProfileParameters();
+ SynchronizeForeshoreProfileParameters();
}
}
@@ -366,8 +366,34 @@
}
}
- private void UpdateProfileParameters()
+ private static BreakWater GetDefaultBreakWater()
{
+ return new BreakWater(BreakWaterType.Dam, 0.0);
+ }
+
+ public void ClearStructure()
+ {
+ Structure = null;
+ }
+
+ public bool IsForeshoreProfileParametersSynchronized
+ {
+ get
+ {
+ if (foreshoreProfile == null)
+ {
+ return false;
+ }
+
+ return
+ UseForeshore == foreshoreProfile.Geometry.Count() > 1
+ && UseBreakWater == foreshoreProfile.HasBreakWater
+ && BreakWater.Equals(foreshoreProfile.BreakWater);
+ }
+ }
+
+ public void SynchronizeForeshoreProfileParameters()
+ {
if (foreshoreProfile == null)
{
UseForeshore = false;
@@ -384,16 +410,6 @@
}
}
- private static BreakWater GetDefaultBreakWater()
- {
- return new BreakWater(BreakWaterType.Dam, 0.0);
- }
-
- public void ClearStructure()
- {
- Structure = null;
- }
-
#endregion
}
}
\ No newline at end of file
Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestCalculationWithForeshoreProfile.cs
===================================================================
diff -u -r474b2334202ee2bfbe8df476845bd7e2fca01803 -r0e1d04a42ec35249482d25d398ed9dce132e0155
--- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestCalculationWithForeshoreProfile.cs (.../TestCalculationWithForeshoreProfile.cs) (revision 474b2334202ee2bfbe8df476845bd7e2fca01803)
+++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestCalculationWithForeshoreProfile.cs (.../TestCalculationWithForeshoreProfile.cs) (revision 0e1d04a42ec35249482d25d398ed9dce132e0155)
@@ -111,10 +111,6 @@
///
public class TestCalculationInputWithForeshoreProfile : ICalculationInput, IHasForeshoreProfile
{
- ///
- /// Gets or sets the foreshore profile.
- ///
- public ForeshoreProfile ForeshoreProfile { get; set; }
public void Attach(IObserver observer)
{
@@ -130,6 +126,13 @@
{
throw new NotImplementedException();
}
+
+ public ForeshoreProfile ForeshoreProfile { get; set; }
+ public bool IsForeshoreProfileParametersSynchronized { get; }
+ public void SynchronizeForeshoreProfileParameters()
+ {
+ throw new NotImplementedException();
+ }
}
}
}
\ No newline at end of file
Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs
===================================================================
diff -u -r9b0af3f940ae57b373ab4edfd7da944090255fde -r0e1d04a42ec35249482d25d398ed9dce132e0155
--- Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs (.../WaveConditionsInput.cs) (revision 9b0af3f940ae57b373ab4edfd7da944090255fde)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs (.../WaveConditionsInput.cs) (revision 0e1d04a42ec35249482d25d398ed9dce132e0155)
@@ -64,7 +64,7 @@
upperBoundaryWaterLevels = new RoundedDouble(2, double.NaN);
lowerBoundaryWaterLevels = new RoundedDouble(2, double.NaN);
- UpdateProfileParameters();
+ SynchronizeForeshoreProfileParameters();
}
///
@@ -96,7 +96,7 @@
set
{
foreshoreProfile = value;
- UpdateProfileParameters();
+ SynchronizeForeshoreProfileParameters();
}
}
@@ -348,8 +348,25 @@
return waterLevels;
}
- private void UpdateProfileParameters()
+ public bool IsForeshoreProfileParametersSynchronized
{
+ get
+ {
+ if (foreshoreProfile == null)
+ {
+ return false;
+ }
+
+ return
+ Orientation == foreshoreProfile.Orientation
+ && UseForeshore == foreshoreProfile.Geometry.Count() > 1
+ && UseBreakWater == foreshoreProfile.HasBreakWater
+ && BreakWater.Equals(foreshoreProfile.BreakWater);
+ }
+ }
+
+ public void SynchronizeForeshoreProfileParameters()
+ {
if (foreshoreProfile == null)
{
UseForeshore = false;