aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-15 15:46:03 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-15 15:46:03 +0200
commitb188d7bfd91062f65474bd139bb8a434694f117b (patch)
treeb75e5628482d4f96fc4236beaf854152d83292a4 /Software/Visual_Studio/Tango.Integration
parent47d63f4b155318d674a891a6586433f41881a3b1 (diff)
downloadTango-b188d7bfd91062f65474bd139bb8a434694f117b.tar.gz
Tango-b188d7bfd91062f65474bd139bb8a434694f117b.zip
Fixed issue with job run start date.
Fixed issue with ActionLogs busy indication.
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration')
-rw-r--r--Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs4
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs9
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/PrintingEventArgs.cs1
3 files changed, 11 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs b/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs
index f2fb2f16e..0fadd1baa 100644
--- a/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs
+++ b/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs
@@ -17,7 +17,6 @@ namespace Tango.Integration.JobRuns
/// <seealso cref="Tango.Integration.JobRuns.IJobRunsLogger" />
public class BasicJobRunsLogger : ExtendedObject, IJobRunsLogger
{
- private DateTime _start_date;
private Job _job;
#region Properties
@@ -96,7 +95,7 @@ namespace Tango.Integration.JobRuns
JobRun run = new JobRun();
run.UserGuid = _job.UserGuid;
- run.StartDate = _start_date;
+ run.StartDate = e.StartDate;
run.UploadingStartDate = e.UploadingStartTime;
run.HeatingStartDate = e.HeatingStartTime;
run.ActualStartDate = e.ActualStartTime;
@@ -187,7 +186,6 @@ namespace Tango.Integration.JobRuns
private void Machine_PrintingStarted(object sender, PrintingEventArgs e)
{
_job = e.Job;
- _start_date = DateTime.UtcNow;
}
#endregion
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
index 9768498c6..b17321942 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
@@ -75,6 +75,8 @@ namespace Tango.Integration.Operation
private List<BL.ValueObjects.JobRunLiquidQuantity> _currentJobLiquidQuantities;
private DateTime _diagnosticsTime;
private MachineStatus _machineStatusBeforeJobStart;
+
+ private DateTime _jobStartDate;
private DateTime? _jobUploadingStartDate;
private DateTime? _jobHeatingStartDate;
private DateTime? _jobActualStartDate;
@@ -1050,6 +1052,7 @@ namespace Tango.Integration.Operation
PrintingStarted?.Invoke(this, new PrintingEventArgs(handler, job)
{
LiquidQuantities = _currentJobLiquidQuantities.ToList(),
+ StartDate = _jobStartDate,
});
}
@@ -1063,6 +1066,7 @@ namespace Tango.Integration.Operation
PrintingCompleted?.Invoke(this, new PrintingEventArgs(handler, job)
{
LiquidQuantities = _currentJobLiquidQuantities.ToList(),
+ StartDate = _jobStartDate,
UploadingStartTime = _jobUploadingStartDate,
HeatingStartTime = _jobHeatingStartDate,
ActualStartTime = _jobActualStartDate,
@@ -1082,6 +1086,7 @@ namespace Tango.Integration.Operation
PrintingFailed?.Invoke(this, new PrintingFailedEventArgs(handler, job, exception)
{
LiquidQuantities = _currentJobLiquidQuantities.ToList(),
+ StartDate = _jobStartDate,
UploadingStartTime = _jobUploadingStartDate,
HeatingStartTime = _jobHeatingStartDate,
ActualStartTime = _jobActualStartDate,
@@ -1099,6 +1104,7 @@ namespace Tango.Integration.Operation
PrintingAborted?.Invoke(this, new PrintingEventArgs(handler, job)
{
LiquidQuantities = _currentJobLiquidQuantities.ToList(),
+ StartDate = _jobStartDate,
UploadingStartTime = _jobUploadingStartDate,
HeatingStartTime = _jobHeatingStartDate,
ActualStartTime = _jobActualStartDate,
@@ -1116,6 +1122,7 @@ namespace Tango.Integration.Operation
PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, job)
{
LiquidQuantities = _currentJobLiquidQuantities.ToList(),
+ StartDate = _jobStartDate,
UploadingStartTime = _jobUploadingStartDate,
HeatingStartTime = _jobHeatingStartDate,
ActualStartTime = _jobActualStartDate,
@@ -2159,6 +2166,8 @@ namespace Tango.Integration.Operation
throw new InvalidOperationException("Could not print while status = " + Status);
}
+ _jobStartDate = DateTime.UtcNow;
+
LogManager.Log($"Executing job '{job.Name}'...");
_currentJobLiquidQuantities = new List<BL.ValueObjects.JobRunLiquidQuantity>();
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/PrintingEventArgs.cs b/Software/Visual_Studio/Tango.Integration/Operation/PrintingEventArgs.cs
index f68204127..b088b9046 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/PrintingEventArgs.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/PrintingEventArgs.cs
@@ -13,6 +13,7 @@ namespace Tango.Integration.Operation
public JobHandler JobHandler { get; private set; }
public Job Job { get; private set; }
public List<JobRunLiquidQuantity> LiquidQuantities { get; set; }
+ public DateTime StartDate { get; set; }
public DateTime? UploadingStartTime { get; set; }
public DateTime? HeatingStartTime { get; set; }
public DateTime? ActualStartTime { get; set; }