aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2025-01-19 19:47:50 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2025-01-19 19:47:50 +0200
commit97904f88f3949339c713286b592ad156baa8d41f (patch)
tree28437b18fba7572ba0b390c668c48c28594d2c97 /Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs
parentdc01eecbfd2f47f739e4ffd8a2a56f3047c66322 (diff)
downloadTango-97904f88f3949339c713286b592ad156baa8d41f.tar.gz
Tango-97904f88f3949339c713286b592ad156baa8d41f.zip
Buzzer.
White Skip. Thread Loading Abort.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ThreadLoading/DefaultThreadLoadingService.cs37
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()