Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs =================================================================== diff -u -rdfe649292c68391f773d01a0ec9e9950a04e031e -rf428768f659b91a7a7b6f47cfdd0cd861288171d --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision dfe649292c68391f773d01a0ec9e9950a04e031e) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision f428768f659b91a7a7b6f47cfdd0cd861288171d) @@ -753,6 +753,7 @@ return builder.AddRenameItem() .AddCustomItem(updateEntryAndExitPoint) + .AddSeparator() .AddValidateCalculationItem( nodeData, Validate, @@ -840,30 +841,30 @@ string toolTipMessage = hasSurfaceLine ? Resources.PipingPlugin_CreateUpdateEntryAndExitPointItem_Update_calculation_with_characteristic_points_ToolTip - : Resources.PipingPlugin_CreateUpdateEntryAndExitPointItem_Update_calculation_requires_surface_line_selected_ToolTip; + : Resources.PipingPlugin_CreateUpdateEntryAndExitPointItem_Update_calculation_no_surface_line_ToolTip; - var updateEntryAndExitPointItem = new StrictContextMenuItem( + return new StrictContextMenuItem( Resources.PipingPlugin_CreateUpdateEntryAndExitPointItem_Update_entry_and_exit_point, toolTipMessage, RingtoetsCommonFormsResources.UpdateItemIcon, (o, args) => { UpdateSurfaceLineDependentData(context.WrappedData); }) { Enabled = hasSurfaceLine }; - return updateEntryAndExitPointItem; } private static void UpdateSurfaceLineDependentData(PipingCalculation scenario) { PipingInput inputParameters = scenario.InputParameters; RingtoetsPipingSurfaceLine currentSurfaceLine = inputParameters.SurfaceLine; - RoundedDouble oldEntryPointL = inputParameters.EntryPointL; - RoundedDouble oldExitPointL = inputParameters.ExitPointL; + RoundedDouble currentEntryPointL = inputParameters.EntryPointL; + RoundedDouble currentExitPointL = inputParameters.ExitPointL; + // Setting the surfaceLine will trigger to update the entry and exit points. inputParameters.SurfaceLine = currentSurfaceLine; var affectedObjects = new List(); - if (AreEntryAndExitPointsUpdated(oldEntryPointL, oldExitPointL, inputParameters)) + if (AreEntryAndExitPointsUpdated(currentEntryPointL, currentExitPointL, inputParameters.EntryPointL, inputParameters.ExitPointL)) { affectedObjects.Add(inputParameters); affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearCalculationOutput(scenario)); @@ -875,12 +876,13 @@ } } - private static bool AreEntryAndExitPointsUpdated(RoundedDouble oldEntryPointL, - RoundedDouble oldExitPointL, - PipingInput inputParameters) + private static bool AreEntryAndExitPointsUpdated(RoundedDouble currentEntryPointL, + RoundedDouble currentExitPointL, + RoundedDouble updatedEntryPointL, + RoundedDouble updatedExitPointL) { - return !(oldEntryPointL == inputParameters.EntryPointL) - || !(oldExitPointL == inputParameters.ExitPointL); + return !(currentEntryPointL == updatedEntryPointL) + || !(currentExitPointL == updatedExitPointL); } #endregion Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.Designer.cs =================================================================== diff -u -r75e1eff406a03fff323f3153c95bf13236b45540 -rf428768f659b91a7a7b6f47cfdd0cd861288171d --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 75e1eff406a03fff323f3153c95bf13236b45540) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision f428768f659b91a7a7b6f47cfdd0cd861288171d) @@ -84,10 +84,10 @@ /// /// Looks up a localized string similar to Er moet een profielschematisatie geselecteerd zijn.. /// - public static string PipingPlugin_CreateUpdateEntryAndExitPointItem_Update_calculation_requires_surface_line_selected_ToolTip { + public static string PipingPlugin_CreateUpdateEntryAndExitPointItem_Update_calculation_no_surface_line_ToolTip { get { - return ResourceManager.GetString("PipingPlugin_CreateUpdateEntryAndExitPointItem_Update_calculation_requires_surfac" + - "e_line_selected_ToolTip", resourceCulture); + return ResourceManager.GetString("PipingPlugin_CreateUpdateEntryAndExitPointItem_Update_calculation_no_surface_line" + + "_ToolTip", resourceCulture); } } Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.resx =================================================================== diff -u -r75e1eff406a03fff323f3153c95bf13236b45540 -rf428768f659b91a7a7b6f47cfdd0cd861288171d --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 75e1eff406a03fff323f3153c95bf13236b45540) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.resx (.../Resources.resx) (revision f428768f659b91a7a7b6f47cfdd0cd861288171d) @@ -244,7 +244,7 @@ Berekening bijwerken met de karakteristieke punten. - + Er moet een profielschematisatie geselecteerd zijn. \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs =================================================================== diff -u -r75e1eff406a03fff323f3153c95bf13236b45540 -rf428768f659b91a7a7b6f47cfdd0cd861288171d --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision 75e1eff406a03fff323f3153c95bf13236b45540) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision f428768f659b91a7a7b6f47cfdd0cd861288171d) @@ -53,9 +53,9 @@ { private const int contextMenuUpdateEntryAndExitPointIndex = 1; - private const int contextMenuValidateIndex = 2; - private const int contextMenuCalculateIndex = 3; - private const int contextMenuClearIndex = 5; + private const int contextMenuValidateIndex = 3; + private const int contextMenuCalculateIndex = 4; + private const int contextMenuClearIndex = 6; private MockRepository mocks; private PipingPlugin plugin; @@ -360,6 +360,7 @@ { menuBuilderMock.Expect(mb => mb.AddRenameItem()).Return(menuBuilderMock); menuBuilderMock.Expect(mb => mb.AddCustomItem(null)).IgnoreArguments().Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.AddSeparator()).Return(menuBuilderMock); menuBuilderMock.Expect(mb => mb.AddCustomItem(null)).IgnoreArguments().Return(menuBuilderMock); menuBuilderMock.Expect(mb => mb.AddCustomItem(null)).IgnoreArguments().Return(menuBuilderMock); menuBuilderMock.Expect(mb => mb.AddSeparator()).Return(menuBuilderMock); @@ -388,7 +389,7 @@ } [Test] - public void UpdateEntryAndExitPoint_CalculationHasNoSurfaceLine_ItemDisabled() + public void ContextMenuStrip_CalculationWithoutSurfaceLine_ContextMenuItemUpdateEntryAndExitPointDisabled() { // Setup using (var treeViewControl = new TreeViewControl()) @@ -423,7 +424,7 @@ } [Test] - public void UpdateEntryAndExitPoint_CalculationHasSurfaceLine_ItemEnabled() + public void ContextMenuStrip_CalculationWithSurfaceLine_ContextMenuItemUpdateEntryAndExitPointEnabled() { // Setup using (var treeViewControl = new TreeViewControl())