Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs =================================================================== diff -u -r13bb96f19dd9b1c5667ac5de42539b47ff7ae9a8 -r1bd841626a54c4e0204647a67323e4c2659af274 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs (.../PipingFailureMechanismView.cs) (revision 13bb96f19dd9b1c5667ac5de42539b47ff7ae9a8) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs (.../PipingFailureMechanismView.cs) (revision 1bd841626a54c4e0204647a67323e4c2659af274) @@ -31,6 +31,7 @@ using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Forms.Factories; +using Ringtoets.Common.Forms.Helpers; using Ringtoets.Piping.Data; using Ringtoets.Piping.Data.SoilProfile; using Ringtoets.Piping.Forms.Factories; @@ -59,6 +60,14 @@ private Observer surfaceLinesObserver; private Observer stochasticSoilModelsObserver; + private RecursiveObserver, HydraulicBoundaryLocationCalculation> waterLevelCalculationsForFactorizedSignalingNormObserver; + private RecursiveObserver, HydraulicBoundaryLocationCalculation> waterLevelCalculationsForSignalingNormObserver; + private RecursiveObserver, HydraulicBoundaryLocationCalculation> waterLevelCalculationsForLowerLimitNormObserver; + private RecursiveObserver, HydraulicBoundaryLocationCalculation> waterLevelCalculationsForFactorizedLowerLimitNormObserver; + private RecursiveObserver, HydraulicBoundaryLocationCalculation> waveHeightCalculationsForFactorizedSignalingNormObserver; + private RecursiveObserver, HydraulicBoundaryLocationCalculation> waveHeightCalculationsForSignalingNormObserver; + private RecursiveObserver, HydraulicBoundaryLocationCalculation> waveHeightCalculationsForLowerLimitNormObserver; + private RecursiveObserver, HydraulicBoundaryLocationCalculation> waveHeightCalculationsForFactorizedLowerLimitNormObserver; private RecursiveObserver, HydraulicBoundaryLocation> hydraulicBoundaryLocationObserver; private RecursiveObserver calculationInputObserver; private RecursiveObserver calculationGroupObserver; @@ -139,6 +148,14 @@ { failureMechanismObserver.Dispose(); assessmentSectionObserver.Dispose(); + waterLevelCalculationsForFactorizedSignalingNormObserver.Dispose(); + waterLevelCalculationsForSignalingNormObserver.Dispose(); + waterLevelCalculationsForLowerLimitNormObserver.Dispose(); + waterLevelCalculationsForFactorizedLowerLimitNormObserver.Dispose(); + waveHeightCalculationsForFactorizedSignalingNormObserver.Dispose(); + waveHeightCalculationsForSignalingNormObserver.Dispose(); + waveHeightCalculationsForLowerLimitNormObserver.Dispose(); + waveHeightCalculationsForFactorizedLowerLimitNormObserver.Dispose(); hydraulicBoundaryLocationsObserver.Dispose(); hydraulicBoundaryLocationObserver.Dispose(); stochasticSoilModelsObserver.Dispose(); @@ -179,6 +196,23 @@ Observable = FailureMechanism.StochasticSoilModels }; + waterLevelCalculationsForFactorizedSignalingNormObserver = ObserverHelper.CreateHydraulicBoundaryLocationCalculationsObserver( + AssessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm, UpdateHydraulicBoundaryLocationsMapData); + waterLevelCalculationsForSignalingNormObserver = ObserverHelper.CreateHydraulicBoundaryLocationCalculationsObserver( + AssessmentSection.WaterLevelCalculationsForSignalingNorm, UpdateHydraulicBoundaryLocationsMapData); + waterLevelCalculationsForLowerLimitNormObserver = ObserverHelper.CreateHydraulicBoundaryLocationCalculationsObserver( + AssessmentSection.WaterLevelCalculationsForLowerLimitNorm, UpdateHydraulicBoundaryLocationsMapData); + waterLevelCalculationsForFactorizedLowerLimitNormObserver = ObserverHelper.CreateHydraulicBoundaryLocationCalculationsObserver( + AssessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm, UpdateHydraulicBoundaryLocationsMapData); + waveHeightCalculationsForFactorizedSignalingNormObserver = ObserverHelper.CreateHydraulicBoundaryLocationCalculationsObserver( + AssessmentSection.WaveHeightCalculationsForFactorizedSignalingNorm, UpdateHydraulicBoundaryLocationsMapData); + waveHeightCalculationsForSignalingNormObserver = ObserverHelper.CreateHydraulicBoundaryLocationCalculationsObserver( + AssessmentSection.WaveHeightCalculationsForSignalingNorm, UpdateHydraulicBoundaryLocationsMapData); + waveHeightCalculationsForLowerLimitNormObserver = ObserverHelper.CreateHydraulicBoundaryLocationCalculationsObserver( + AssessmentSection.WaveHeightCalculationsForLowerLimitNorm, UpdateHydraulicBoundaryLocationsMapData); + waveHeightCalculationsForFactorizedLowerLimitNormObserver = ObserverHelper.CreateHydraulicBoundaryLocationCalculationsObserver( + AssessmentSection.WaveHeightCalculationsForFactorizedLowerLimitNorm, UpdateHydraulicBoundaryLocationsMapData); + hydraulicBoundaryLocationObserver = new RecursiveObserver, HydraulicBoundaryLocation>( UpdateHydraulicBoundaryLocationsMapData, hbl => hbl) { Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs =================================================================== diff -u -r649ed9247c8dfe31cace4cf41095c0befa7de517 -r1bd841626a54c4e0204647a67323e4c2659af274 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision 649ed9247c8dfe31cace4cf41095c0befa7de517) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision 1bd841626a54c4e0204647a67323e4c2659af274) @@ -254,6 +254,35 @@ } [Test] + [TestCaseSource(typeof(MapViewTestHelper), nameof(MapViewTestHelper.GetCalculationFuncs))] + public void GivenViewWithHydraulicBoundaryLocationsData_WhenHydraulicBoundaryLocationCalculationUpdatedAndNotified_ThenMapDataUpdated( + Func getCalculationFunc) + { + // Given + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test1", 1.0, 2.0); + var assessmentSection = new ObservableTestAssessmentSectionStub(); + assessmentSection.AddHydraulicBoundaryLocation(hydraulicBoundaryLocation); + + using (var view = new PipingFailureMechanismView(new PipingFailureMechanism(), assessmentSection)) + { + IMapControl map = ((RingtoetsMapControl)view.Controls[0]).MapControl; + + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + + // Precondition + MapDataTestHelper.AssertHydraulicBoundaryLocationOutputsMapData(assessmentSection, hydraulicBoundaryLocationsMapData); + + // When + HydraulicBoundaryLocationCalculation calculation = getCalculationFunc(assessmentSection); + calculation.Output = new TestHydraulicBoundaryLocationOutput(new Random(21).NextDouble()); + calculation.NotifyObservers(); + + // Then + MapDataTestHelper.AssertHydraulicBoundaryLocationOutputsMapData(assessmentSection, hydraulicBoundaryLocationsMapData); + } + } + + [Test] public void GivenViewWithHydraulicBoundaryLocationsData_WhenLocationUpdatedAndNotified_ThenMapDataUpdated() { // Given