Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverFailureMechanismView.cs =================================================================== diff -u -r12177caf1eab2ce984fde1d69cb4e3cf0f57c223 -r0f9383c5b288015ca81c3f308e3b39b8b4097acb --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverFailureMechanismView.cs (.../StabilityStoneCoverFailureMechanismView.cs) (revision 12177caf1eab2ce984fde1d69cb4e3cf0f57c223) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverFailureMechanismView.cs (.../StabilityStoneCoverFailureMechanismView.cs) (revision 0f9383c5b288015ca81c3f308e3b39b8b4097acb) @@ -32,6 +32,7 @@ using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Forms.Factories; +using Ringtoets.Common.Forms.Helpers; using Ringtoets.Revetment.Data; using Ringtoets.StabilityStoneCover.Data; using Ringtoets.StabilityStoneCover.Forms.Factories; @@ -56,6 +57,14 @@ private Observer hydraulicBoundaryLocationsObserver; private Observer foreshoreProfilesObserver; + 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; @@ -133,6 +142,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(); foreshoreProfilesObserver.Dispose(); @@ -168,6 +185,23 @@ Observable = FailureMechanism.ForeshoreProfiles }; + 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/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs =================================================================== diff -u -r12177caf1eab2ce984fde1d69cb4e3cf0f57c223 -r0f9383c5b288015ca81c3f308e3b39b8b4097acb --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs (.../StabilityStoneCoverFailureMechanismViewTest.cs) (revision 12177caf1eab2ce984fde1d69cb4e3cf0f57c223) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs (.../StabilityStoneCoverFailureMechanismViewTest.cs) (revision 0f9383c5b288015ca81c3f308e3b39b8b4097acb) @@ -239,6 +239,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 StabilityStoneCoverFailureMechanismView(new StabilityStoneCoverFailureMechanism(), 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