From d9322cdd83c46d1add0a3c8421e28ee878c29396 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 14 Aug 2025 03:43:16 +0300 Subject: Machine Operator Printing Operations Major Refactoring. Revived Job Resume for X1/X4/PPC. --- .../Tango.PPC.JobsV2/ViewModels/MainViewVM.cs | 33 +++++++++++++--------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'Software/Visual_Studio/PPC/Modules') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/MainViewVM.cs index 5e0d36da5..59de35d51 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/MainViewVM.cs @@ -70,31 +70,38 @@ namespace Tango.PPC.Jobs.ViewModels { _handler = e.JobHandler; - if (resuming) + if (!BuildProvider.MachineType.IsXMachine()) { - resuming = false; - - InvokeUI(() => + if (resuming) { - NavigationManager.NavigateTo(nameof(JobProgressView)); + resuming = false; - if (_last_failed_job_notification != null) + InvokeUI(() => { - _last_failed_job_notification.Close(); - _last_failed_job_notification = null; - } - }); + NavigationManager.NavigateTo(nameof(JobProgressView)); + + if (_last_failed_job_notification != null) + { + _last_failed_job_notification.Close(); + _last_failed_job_notification = null; + } + }); + } } } - private void MachineOperator_ResumingJob(object sender, ResumingJobEventArgs e) + private async void MachineOperator_ResumingJob(object sender, ResumingJobEventArgs e) { LogManager.Log($"Job resume request '{e.JobGuid}' approving..."); try { - e.Approve(); - resuming = true; + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var job = await new JobBuilder(db).Set(e.JobGuid).WithRML(null).WithConfiguration().WithSegments().WithBrushStops().BuildAsync(); + e.Approve(job); + resuming = true; + } } catch (Exception ex) { -- cgit v1.3.1