aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobSummeryViewVM.cs34
1 files changed, 24 insertions, 10 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)
{