aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/MainViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/MainViewVM.cs33
1 files changed, 20 insertions, 13 deletions
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<JobsV2Module>(nameof(JobProgressView));
+ resuming = false;
- if (_last_failed_job_notification != null)
+ InvokeUI(() =>
{
- _last_failed_job_notification.Close();
- _last_failed_job_notification = null;
- }
- });
+ NavigationManager.NavigateTo<JobsV2Module>(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)
{