diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.BL/Entities/Job.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/Entities/Job.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index 77f151fbc..d28f00613 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -464,6 +464,19 @@ namespace Tango.BL.Entities } /// <summary> + /// Gets the duration estimation for this job. + /// </summary> + /// <returns></returns> + public Task<TimeSpan> GetEstimatedDuration() + { + return Task.Factory.StartNew<TimeSpan>(() => + { + var process = GetRecommendedProcessParameters().Result; + return GetEstimatedDuration(process); + }); + } + + /// <summary> /// Translates the job progress to time. /// </summary> /// <param name="progress">The progress.</param> @@ -497,6 +510,22 @@ namespace Tango.BL.Entities }; } + public Task<ProcessParametersTable> GetRecommendedProcessParameters() + { + return Task.Factory.StartNew<ProcessParametersTable>(() => + { + try + { + int index = ColorConversion.TangoColorConverter.GetLeastCommonProcessParametersTableIndex(Segments.SelectMany(x => x.BrushStops)); + return Rml.GetActiveProcessGroup().ProcessParametersTables[index]; + } + catch (Exception ex) + { + throw new InvalidOperationException("Could not calculate the recommended process parameters for the job.", ex); + } + }); + } + public Task<JobFile> ToJobFile() { return Task.Factory.StartNew<JobFile>(() => |
