diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2025-01-19 19:47:50 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2025-01-19 19:47:50 +0200 |
| commit | 97904f88f3949339c713286b592ad156baa8d41f (patch) | |
| tree | 28437b18fba7572ba0b390c668c48c28594d2c97 /Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading | |
| parent | dc01eecbfd2f47f739e4ffd8a2a56f3047c66322 (diff) | |
| download | Tango-97904f88f3949339c713286b592ad156baa8d41f.tar.gz Tango-97904f88f3949339c713286b592ad156baa8d41f.zip | |
Buzzer.
White Skip.
Thread Loading Abort.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs | 37 |
1 files changed, 35 insertions, 2 deletions
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 cc8f867cc..aea423c12 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using Tango.Core.DI; using Tango.Integration.Operation; +using Tango.Logging; using Tango.PPC.Common.Build; using Tango.PPC.Common.Connection; using Tango.PPC.Common.Notifications; @@ -37,8 +38,24 @@ namespace Tango.PPC.UI.ThreadLoading _dialogShown = true; _dispatcher.Invoke(async () => { - await _notificationsProvider.ShowDialog<ThreadLoadingViewVM>(new ThreadLoadingViewVM()); + var vm = await _notificationsProvider.ShowDialog<ThreadLoadingViewVM>(new ThreadLoadingViewVM()); _dialogShown = false; + if (!vm.DialogResult && vm.Stage != ThreadLoadingViewVM.ThreadLoadingStage.Completed) + { + if (_machineProvider.IsConnected) + { + try + { + await _machineProvider.MachineOperator.AbortThreadLoading(); + } + catch (Exception ex) + { + LogManager.Default.Log(ex, "Error aborting thread loading."); + } + + await _notificationsProvider.ShowInfo("Thread loading aborted."); + } + } }); } } @@ -46,8 +63,24 @@ namespace Tango.PPC.UI.ThreadLoading public async void StartThreadLoadingWizard() { _dialogShown = true; - await _notificationsProvider.ShowDialog<ThreadLoadingViewVM>(new ThreadLoadingViewVM(true)); + var vm = await _notificationsProvider.ShowDialog<ThreadLoadingViewVM>(new ThreadLoadingViewVM(true)); _dialogShown = false; + if (!vm.DialogResult && vm.Stage != ThreadLoadingViewVM.ThreadLoadingStage.Completed) + { + if (_machineProvider.IsConnected) + { + try + { + await _machineProvider.MachineOperator.AbortThreadLoading(); + } + catch (Exception ex) + { + LogManager.Default.Log(ex, "Error aborting thread loading."); + } + + await _notificationsProvider.ShowInfo("Thread loading aborted."); + } + } } public async void StartThreadBreakWizard() |
