From c24aaa736334929d64ca8f52d06c6f36142ab191 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Mon, 27 Jan 2025 10:40:17 +0200 Subject: Abort Thread Loading... --- .../Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs index aea423c12..7cb0163af 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs @@ -65,20 +65,24 @@ namespace Tango.PPC.UI.ThreadLoading _dialogShown = true; var vm = await _notificationsProvider.ShowDialog(new ThreadLoadingViewVM(true)); _dialogShown = false; - if (!vm.DialogResult && vm.Stage != ThreadLoadingViewVM.ThreadLoadingStage.Completed) + if (!vm.DialogResult && vm.Stage != ThreadLoadingViewVM.ThreadLoadingStage.Completed && vm.Stage != ThreadLoadingViewVM.ThreadLoadingStage.Welcome) { if (_machineProvider.IsConnected) { try { + _notificationsProvider.SetGlobalBusyMessage("Aborting thread loading..."); + await Task.Delay(1000); await _machineProvider.MachineOperator.AbortThreadLoading(); + _notificationsProvider.ReleaseGlobalBusyMessage(); + await _notificationsProvider.ShowInfo("Thread loading aborted."); } catch (Exception ex) { + _notificationsProvider.ReleaseGlobalBusyMessage(); LogManager.Default.Log(ex, "Error aborting thread loading."); + await _notificationsProvider.ShowError("Could not properly abort the thread loading process."); } - - await _notificationsProvider.ShowInfo("Thread loading aborted."); } } } -- cgit v1.3.1