Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs =================================================================== diff -u -r420c266df87245b9471d3794ef5043ee89cb482a -r16b01f208966fa77f73b7977db23da94786f08d1 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs (.../DerivedPipingInput.cs) (revision 420c266df87245b9471d3794ef5043ee89cb482a) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs (.../DerivedPipingInput.cs) (revision 16b01f208966fa77f73b7977db23da94786f08d1) @@ -21,10 +21,8 @@ using System; using Core.Common.Base.Data; -using log4net; using Ringtoets.HydraRing.Data; using Ringtoets.Piping.Data.Probabilistics; -using Ringtoets.Piping.Data.Properties; using Ringtoets.Piping.InputParameterCalculation; using Ringtoets.Piping.Primitives; @@ -36,7 +34,6 @@ public class DerivedPipingInput { private const double seepageLengthStandardDeviationFraction = 0.1; - private static readonly ILog log = LogManager.GetLogger(typeof(DerivedPipingInput)); private readonly PipingInput input; Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs =================================================================== diff -u -r420c266df87245b9471d3794ef5043ee89cb482a -r16b01f208966fa77f73b7977db23da94786f08d1 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision 420c266df87245b9471d3794ef5043ee89cb482a) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision 16b01f208966fa77f73b7977db23da94786f08d1) @@ -40,16 +40,11 @@ private readonly GeneralPipingInput generalInputParameters; private readonly NormalDistribution phreaticLevelExit; private readonly LognormalDistribution dampingFactorExit; - private readonly LognormalDistribution thicknessCoverageLayer; private readonly ShiftedLognormalDistribution saturatedVolumicWeightOfCoverageLayer; - private readonly LognormalDistribution thicknessAquiferLayer; private readonly LognormalDistribution darcyPermeability; private readonly LognormalDistribution diameter70; - private readonly LognormalDistribution seepageLength; - private RoundedDouble assessmentLevel; private RoundedDouble exitPointL; private RoundedDouble entryPointL; - private RoundedDouble piezometricHeadExit; private RingtoetsPipingSurfaceLine surfaceLine; private PipingSoilProfile soilProfile; @@ -73,38 +68,21 @@ exitPointL = new RoundedDouble(2, double.NaN); entryPointL = new RoundedDouble(2, double.NaN); - assessmentLevel = new RoundedDouble(2, double.NaN); - piezometricHeadExit = new RoundedDouble(2, double.NaN); phreaticLevelExit = new NormalDistribution(3); dampingFactorExit = new LognormalDistribution(3) { Mean = (RoundedDouble) 0.7, StandardDeviation = (RoundedDouble) 0.0 }; - thicknessCoverageLayer = new LognormalDistribution(2) - { - Mean = (RoundedDouble) double.NaN, - StandardDeviation = (RoundedDouble) 0.5 - }; saturatedVolumicWeightOfCoverageLayer = new ShiftedLognormalDistribution(2) { Shift = (RoundedDouble) 10, Mean = (RoundedDouble) 17.5, StandardDeviation = (RoundedDouble) 0 }; - seepageLength = new LognormalDistribution(2) - { - Mean = (RoundedDouble) double.NaN, - StandardDeviation = (RoundedDouble) double.NaN - }; diameter70 = new LognormalDistribution(2); darcyPermeability = new LognormalDistribution(3); - thicknessAquiferLayer = new LognormalDistribution(2) - { - Mean = (RoundedDouble) double.NaN, - StandardDeviation = (RoundedDouble) 0.5 - }; } /// Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputContextProperties.cs =================================================================== diff -u -r43fb77c51a8d1c0af128a2da0c3d51bbea6e25bb -r16b01f208966fa77f73b7977db23da94786f08d1 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputContextProperties.cs (.../PipingInputContextProperties.cs) (revision 43fb77c51a8d1c0af128a2da0c3d51bbea6e25bb) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputContextProperties.cs (.../PipingInputContextProperties.cs) (revision 16b01f208966fa77f73b7977db23da94786f08d1) @@ -160,8 +160,12 @@ } set { - data.WrappedData.SurfaceLine = value; - data.WrappedData.NotifyObservers(); + if (!ReferenceEquals(value, data.WrappedData.SurfaceLine)) + { + data.WrappedData.SurfaceLine = value; + data.WrappedData.SoilProfile = null; + data.WrappedData.NotifyObservers(); + } } } Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingInputContextTest.cs =================================================================== diff -u -r43fb77c51a8d1c0af128a2da0c3d51bbea6e25bb -r16b01f208966fa77f73b7977db23da94786f08d1 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingInputContextTest.cs (.../PipingInputContextTest.cs) (revision 43fb77c51a8d1c0af128a2da0c3d51bbea6e25bb) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingInputContextTest.cs (.../PipingInputContextTest.cs) (revision 16b01f208966fa77f73b7977db23da94786f08d1) @@ -10,7 +10,6 @@ using Ringtoets.Piping.Data; using Ringtoets.Piping.Data.TestUtil; using Ringtoets.Piping.Forms.PresentationObjects; -using Ringtoets.Piping.KernelWrapper.TestUtil; using Ringtoets.Piping.Primitives; namespace Ringtoets.Piping.Forms.Test.PresentationObjects Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs =================================================================== diff -u -r43fb77c51a8d1c0af128a2da0c3d51bbea6e25bb -r16b01f208966fa77f73b7977db23da94786f08d1 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision 43fb77c51a8d1c0af128a2da0c3d51bbea6e25bb) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision 16b01f208966fa77f73b7977db23da94786f08d1) @@ -435,6 +435,92 @@ } [Test] + public void SurfaceLine_NewSurfaceLine_SoilProfileSetToNull() + { + // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var inputParameters = new PipingInput(new GeneralPipingInput()); + var properties = new PipingInputContextProperties + { + Data = new PipingInputContext(inputParameters, + Enumerable.Empty(), + Enumerable.Empty(), + assessmentSectionMock) + }; + inputParameters.SoilProfile = new TestPipingSoilProfile(); + + // Call + properties.SurfaceLine = ValidSurfaceLine(0, 2); + + // Assert + Assert.IsNull(inputParameters.SoilProfile); + } + + [Test] + public void SurfaceLine_SameSurfaceLine_SoilProfileUnchanged() + { + // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var testSurfaceLine = ValidSurfaceLine(0, 2); + var testPipingSoilProfile = new TestPipingSoilProfile(); + + var inputParameters = new PipingInput(new GeneralPipingInput()) + { + SurfaceLine = testSurfaceLine, + SoilProfile = testPipingSoilProfile + }; + var properties = new PipingInputContextProperties + { + Data = new PipingInputContext(inputParameters, + Enumerable.Empty(), + Enumerable.Empty(), + assessmentSectionMock) + }; + + // Call + properties.SurfaceLine = testSurfaceLine; + + // Assert + Assert.AreSame(testPipingSoilProfile, inputParameters.SoilProfile); + } + + [Test] + public void SurfaceLine_DifferentSurfaceLine_SoilProfileSetToNull() + { + // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var testPipingSoilProfile = new TestPipingSoilProfile(); + + var inputParameters = new PipingInput(new GeneralPipingInput()) + { + SurfaceLine = ValidSurfaceLine(0, 2), + SoilProfile = testPipingSoilProfile + }; + var properties = new PipingInputContextProperties + { + Data = new PipingInputContext(inputParameters, + Enumerable.Empty(), + Enumerable.Empty(), + assessmentSectionMock) + }; + + // Call + properties.SurfaceLine = ValidSurfaceLine(0, 2); + + // Assert + Assert.IsNull(inputParameters.SoilProfile); + } + + [Test] [TestCase(1)] [TestCase(2)] public void GivenCompletePipingInputContextProperties_WhenPhreaticLevelExitPropertiesSetThroughProperties_ThenPiezometricHeadExitUpdated(int propertyIndexToChange)