Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismView.cs =================================================================== diff -u -r9517f977a29fa57cf0144f2f5b3b7588bdf052a0 -r86b1d98cc8f33f759fc0e5f2d89d95d55f5f230b --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismView.cs (.../StabilityPointStructuresFailureMechanismView.cs) (revision 9517f977a29fa57cf0144f2f5b3b7588bdf052a0) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismView.cs (.../StabilityPointStructuresFailureMechanismView.cs) (revision 86b1d98cc8f33f759fc0e5f2d89d95d55f5f230b) @@ -34,6 +34,7 @@ using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Forms.Factories; +using Ringtoets.Common.Forms.Helpers; using Ringtoets.StabilityPointStructures.Data; using StabilityPointStructuresDataResources = Ringtoets.StabilityPointStructures.Data.Properties.Resources; @@ -58,6 +59,14 @@ private Observer foreshoreProfilesObserver; private Observer structuresObserver; + 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; @@ -138,6 +147,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(); @@ -179,6 +196,23 @@ Observable = FailureMechanism.StabilityPointStructures }; + 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/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs =================================================================== diff -u -r9517f977a29fa57cf0144f2f5b3b7588bdf052a0 -r86b1d98cc8f33f759fc0e5f2d89d95d55f5f230b --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs (.../StabilityPointStructuresFailureMechanismViewTest.cs) (revision 9517f977a29fa57cf0144f2f5b3b7588bdf052a0) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs (.../StabilityPointStructuresFailureMechanismViewTest.cs) (revision 86b1d98cc8f33f759fc0e5f2d89d95d55f5f230b) @@ -246,6 +246,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 StabilityPointStructuresFailureMechanismView(new StabilityPointStructuresFailureMechanism(), 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