diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs | 34 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs | 2 |
2 files changed, 25 insertions, 11 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs index 46c6d7ffd..01d83d0d0 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs @@ -32,6 +32,18 @@ namespace Tango.PPC.Jobs.ViewModels set { _job = value; RaisePropertyChangedAuto(); } } + private TimeSpan _estimatedDuration; + /// <summary> + /// Gets or sets the duration of the estimated. + /// </summary> + + public TimeSpan EstimatedDuration + { + get { return _estimatedDuration; } + set { _estimatedDuration = value; RaisePropertyChangedAuto(); } + } + + /// <summary> /// Gets or sets the dye command. /// </summary> @@ -57,10 +69,20 @@ namespace Tango.PPC.Jobs.ViewModels /// Handles the job selected message. /// </summary> /// <param name="message">The message.</param> - private void HandleJobSelectedMessage(JobSelectedMessage message) + private async void HandleJobSelectedMessage(JobSelectedMessage message) { _context = message.Context; Job = message.Job; + + Job = await new JobBuilder(_context).Set(Job.Guid) + .WithConfiguration() + .WithRML() + .WithUser() + .WithSegments() + .WithBrushStops() + .BuildAsync(); + + EstimatedDuration = await Job.GetEstimatedDuration(); } /// <summary> @@ -81,16 +103,8 @@ namespace Tango.PPC.Jobs.ViewModels { LogManager.Log("Start job command pressed. Starting job and navigating to job progress view..."); - Job = await new JobBuilder(_context).Set(Job.Guid) - .WithConfiguration() - .WithRML() - .WithUser() - .WithSegments() - .WithBrushStops() - .BuildAsync(); - PrintingManager.Print(Job, _context); - await NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView)); + await NavigationManager.NavigateTo<JobsModule>(false, nameof(JobProgressView)); } catch (Exception ex) { diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs index d29323412..c87d3585b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs @@ -271,7 +271,7 @@ namespace Tango.PPC.Jobs.ViewModels { LogManager.Log($"Job '{job.Name}' selected."); - if (!directlyToEdit) + if (!directlyToEdit && MachineProvider.MachineOperator.Status == Integration.Operation.MachineStatuses.ReadyToDye) { await NavigationManager.NavigateTo<JobsModule>(nameof(JobSummeryView)); } |
