aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-01-23 16:53:51 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-01-23 16:53:51 +0200
commit58f79af3b62e7737191205e029ccdc8fb79c40cc (patch)
tree12bbc2bcef2a217fca046dc58c8570feb3350ccf /Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs
parent60a2692fd4acadfdf8724bb198e38a2689a866fd (diff)
downloadTango-58f79af3b62e7737191205e029ccdc8fb79c40cc.tar.gz
Tango-58f79af3b62e7737191205e029ccdc8fb79c40cc.zip
Fixed a bug with none site for machine.
Added Job run designation, source, uploading, heating time...
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs')
-rw-r--r--Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs20
1 files changed, 16 insertions, 4 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs b/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs
index ce175e3d2..bb6c81a82 100644
--- a/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs
+++ b/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs
@@ -35,7 +35,12 @@ namespace Tango.Integration.JobRuns
/// <summary>
/// Gets or sets the job designations of which the logger should log (supports multiple flags).
/// </summary>
- public JobDesignations JobDesignation { get; set; }
+ public JobDesignations JobDesignationFilter { get; set; }
+
+ /// <summary>
+ /// Gets or sets the job run source when logging job runs.
+ /// </summary>
+ public JobSource JobSource { get; set; }
#endregion
@@ -47,7 +52,7 @@ namespace Tango.Integration.JobRuns
/// <param name="machineOperator">The machine operator.</param>
public BasicJobRunsLogger(IMachineOperator machineOperator)
{
- JobDesignation = JobDesignations.Default;
+ JobDesignationFilter = JobDesignations.Default | JobDesignations.SampleDye | JobDesignations.FineTuning;
MachineOperator = machineOperator;
Init();
}
@@ -73,7 +78,7 @@ namespace Tango.Integration.JobRuns
private bool ShouldLog()
{
- return IsStarted && _job != null && JobDesignation.HasFlag(_job.Designation);
+ return IsStarted && _job != null && JobDesignationFilter.HasFlag(_job.Designation);
}
private void InsertJobRun(PrintingEventArgs e, JobRunStatus status, Exception exception)
@@ -90,17 +95,24 @@ namespace Tango.Integration.JobRuns
{
JobRun run = new JobRun();
+ run.UserGuid = _job.UserGuid;
run.StartDate = _start_date;
+ run.UploadingStartDate = e.UploadingStartTime;
+ run.HeatingStartDate = e.HeatingStartTime;
+ run.ActualStartDate = e.ActualStartTime;
run.EndDate = DateTime.UtcNow;
run.JobName = _job.Name;
run.JobLength = _job.LengthIncludingNumberOfUnits;
- run.JobSource = _job.Source;
+ run.Source = JobSource;
+ run.Designation = _job.Designation;
run.JobGuid = _job.Guid;
run.MachineGuid = _job.MachineGuid;
run.JobRunStatus = status;
run.EndPosition = e.JobHandler.Status.Progress;
run.JobLength = e.JobHandler.Status.TotalProgress;
run.LiquidQuantities = e.LiquidQuantities;
+ run.IsGradient = _job.Segments.Any(x => x.BrushStops.Count > 1);
+ run.GradientResolutionCm = MachineOperator.GradientGenerationConfiguration.ResolutionCM;
run.JobString = _job.ToJobFileWhenLoaded().ToString();
if (exception != null)