From ca72de8f6669d89e33eb86652ec3aabbffa44643 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sat, 1 Aug 2020 23:07:50 +0300 Subject: Added head cleaning jobs to job runs as "IS_HEAD_CLEANING" --- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 53673984 -> 53673984 bytes Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 22675456 -> 22675456 bytes .../Tango.PPC.BugReporting_txujxqrg_wpftmp.csproj | 235 +++++++++++++++++++++ .../Connection/DefaultMachineProvider.cs | 2 + .../Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs | 8 + .../Visual_Studio/Tango.BL/Entities/JobRunBase.cs | 38 ++++ .../Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs | 1 + .../Tango.DAL.Remote/DB/RemoteADO.edmx | 3 + .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 150 ++++++------- .../JobRuns/BasicJobRunsLogger.cs | 92 +++++++- .../Tango.Integration/JobRuns/IJobRunsLogger.cs | 7 + .../Operation/HeadCleaningEndedEventArgs.cs | 24 +++ .../Operation/IMachineOperator.cs | 5 + .../Tango.Integration/Operation/MachineOperator.cs | 72 ++++++- .../Tango.Integration/Tango.Integration.csproj | 3 +- 17 files changed, 553 insertions(+), 87 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting/Tango.PPC.BugReporting_txujxqrg_wpftmp.csproj create mode 100644 Software/Visual_Studio/Tango.Integration/Operation/HeadCleaningEndedEventArgs.cs diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index b9e4c6096..a13118e00 100644 Binary files a/Software/DB/PPC/Tango.mdf and b/Software/DB/PPC/Tango.mdf differ diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf index 255a6f07e..40637d642 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 0d73c39e0..a77219a1a 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index f22a84182..101a086bc 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting/Tango.PPC.BugReporting_txujxqrg_wpftmp.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting/Tango.PPC.BugReporting_txujxqrg_wpftmp.csproj new file mode 100644 index 000000000..3b897aa71 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting/Tango.PPC.BugReporting_txujxqrg_wpftmp.csproj @@ -0,0 +1,235 @@ + + + + + Debug + AnyCPU + {8146FA0A-0725-4A1A-82E6-696C58F33A2B} + library + Tango.PPC.BugReporting + Tango.PPC.BugReporting + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + true + full + false + ..\..\..\Build\PPC\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\..\Build\PPC\Release\ + TRACE + prompt + 4 + + + + + + + + GlobalVersionInfo.cs + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + + + MainView.xaml + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + {f441feee-322a-4943-b566-110e12fd3b72} + Tango.BL + + + {caedae94-11ed-473c-888a-268a6d38cd20} + Tango.CodeGeneration + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {b112d89a-a106-41ae-a0c1-4abc84c477f5} + Tango.DragAndDrop + + + {4206ac58-3b57-4699-8835-90bf6db01a61} + Tango.Integration + + + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} + Tango.Logging + + + {e4927038-348d-4295-aaf4-861c58cb3943} + Tango.PMR + + + {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} + Tango.Settings + + + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} + Tango.SharedUI + + + {998f8471-dc1b-41b6-9d96-354e1b4e7a32} + Tango.TFS + + + {fd86424c-6e84-491b-8df9-3d0f5c236a2a} + Tango.Touch + + + {74e700b0-1156-4126-be40-ee450d3c3026} + Tango.Transport + + + {5001990f-977b-48ff-b217-0236a5022ad8} + Tango.Web + + + {0be74eee-22cb-4dba-b896-793b9e1a3ac0} + Tango.PPC.Common + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs index 2e4e01497..794e37694 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs @@ -311,6 +311,8 @@ namespace Tango.PPC.Common.Connection MachineOperator.FirmwareUpgradeMode = Integration.Upgrade.FirmwareUpgradeModes.TFP_PACKAGE; } + MachineOperator.JobRunsLogger.SetDefaultMachine(Machine); + ConnectToMachine(); } else diff --git a/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs index a728ef881..789aacbb2 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs @@ -237,6 +237,14 @@ namespace Tango.BL.DTO get; set; } + /// + /// is head cleaning + /// + public Boolean IsHeadCleaning + { + get; set; + } + /// /// is synchronized /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs index 9277e279b..58f429448 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs @@ -73,6 +73,8 @@ namespace Tango.BL.Entities public event EventHandler FailedMessageChanged; + public event EventHandler IsHeadCleaningChanged; + public event EventHandler IsSynchronizedChanged; protected String _machineguid; @@ -798,6 +800,33 @@ namespace Tango.BL.Entities } } + protected Boolean _isheadcleaning; + + /// + /// Gets or sets the jobrunbase is head cleaning. + /// + + [Column("IS_HEAD_CLEANING")] + + public Boolean IsHeadCleaning + { + get + { + return _isheadcleaning; + } + + set + { + if (_isheadcleaning != value) + { + _isheadcleaning = value; + + OnIsHeadCleaningChanged(value); + + } + } + } + protected Boolean _issynchronized; /// @@ -1032,6 +1061,15 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(FailedMessage)); } + /// + /// Called when the IsHeadCleaning has changed. + /// + protected virtual void OnIsHeadCleaningChanged(Boolean isheadcleaning) + { + IsHeadCleaningChanged?.Invoke(this, isheadcleaning); + RaisePropertyChanged(nameof(IsHeadCleaning)); + } + /// /// Called when the IsSynchronized has changed. /// diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs index 834a27443..15c819d3a 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/JOB_RUNS.cs @@ -44,6 +44,7 @@ namespace Tango.DAL.Remote.DB public int CLEANER_QUANTITY { get; set; } public double END_POSITION { get; set; } public string FAILED_MESSAGE { get; set; } + public bool IS_HEAD_CLEANING { get; set; } public bool IS_SYNCHRONIZED { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx index 50f09d327..11fa280f8 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx @@ -642,6 +642,7 @@ + @@ -4033,6 +4034,7 @@ + @@ -6566,6 +6568,7 @@ + diff --git a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram index 41f8bf0c3..76f5bde79 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Remote/DB/RemoteADO.edmx.diagram @@ -5,88 +5,88 @@ - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + - - - + + + - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs b/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs index e7308dfc7..64ad60db5 100644 --- a/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs +++ b/Software/Visual_Studio/Tango.Integration/JobRuns/BasicJobRunsLogger.cs @@ -19,6 +19,7 @@ namespace Tango.Integration.JobRuns public class BasicJobRunsLogger : ExtendedObject, IJobRunsLogger { private Job _job; + private Machine _defaultMachine; #region Properties @@ -74,6 +75,7 @@ namespace Tango.Integration.JobRuns MachineOperator.PrintingAborted += Machine_PrintingAborted; MachineOperator.PrintingFailed -= Machine_PrintingFailed; MachineOperator.PrintingFailed += Machine_PrintingFailed; + MachineOperator.HeadCleaningEnded += MachineOperator_HeadCleaningEnded; } private bool ShouldLog() @@ -168,13 +170,87 @@ namespace Tango.Integration.JobRuns } catch (Exception ex) { - LogManager.Log(ex, "Error logging the current job run to the database."); + LogManager.Log(ex, "Error logging the last job run to the database."); } }); } } } + private void InsertHeadCleaningJobRun(HeadCleaningEndedEventArgs e) + { + if (IsStarted && _defaultMachine != null) + { + Task.Factory.StartNew(() => + { + try + { + using (var db = ObservablesContext.CreateDefault()) + { + JobRun run = new JobRun(); + + run.IsHeadCleaning = true; + run.StartDate = e.StartDate; + run.UploadingStartDate = e.StartDate; + run.HeatingStartDate = e.StartDate; + run.ActualStartDate = e.StartDate; + run.EndDate = DateTime.UtcNow; + run.JobName = "HEAD CLEANING"; + run.Source = JobSource; + run.MachineGuid = _defaultMachine.Guid; + run.JobRunStatus = e.Status; + run.EndPosition = e.EndPosition; + run.JobLength = e.Length; + run.LiquidQuantities = e.LiquidQuantities; + + //Set individual liquid quantities + + //Cyan + var cyan = run.LiquidQuantities.SingleOrDefault(x => x.LiquidType == LiquidTypes.Cyan); + run.CyanQuantity = cyan != null ? cyan.Quantity : 0; + + //Magenta + var magenta = run.LiquidQuantities.SingleOrDefault(x => x.LiquidType == LiquidTypes.Magenta); + run.MagentaQuantity = magenta != null ? magenta.Quantity : 0; + + //Yellow + var yellow = run.LiquidQuantities.SingleOrDefault(x => x.LiquidType == LiquidTypes.Yellow); + run.YellowQuantity = yellow != null ? yellow.Quantity : 0; + + //Black + var black = run.LiquidQuantities.SingleOrDefault(x => x.LiquidType == LiquidTypes.Black); + run.BlackQuantity = black != null ? black.Quantity : 0; + + //TI + var ti = run.LiquidQuantities.SingleOrDefault(x => x.LiquidType == LiquidTypes.TransparentInk); + run.TransparentQuantity = ti != null ? ti.Quantity : 0; + + //Lubricant + var lubricant = run.LiquidQuantities.SingleOrDefault(x => x.LiquidType == LiquidTypes.Lubricant); + run.LubricantQuantity = lubricant != null ? lubricant.Quantity : 0; + + //Cleaner + var cleaner = run.LiquidQuantities.SingleOrDefault(x => x.LiquidType == LiquidTypes.Cleaner); + run.CleanerQuantity = cleaner != null ? cleaner.Quantity : 0; + + //if (exception != null) + //{ + // run.FailedMessage = exception.FlattenMessage(); + //} + + db.JobRuns.Add(run); + + db.SaveChanges(); + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error logging the last head cleaning job run to the database."); + } + }); + } + } + #endregion #region Public Methods @@ -195,6 +271,15 @@ namespace Tango.Integration.JobRuns IsStarted = false; } + /// + /// Sets the head cleaning parameters. + /// + /// The machine. + public void SetDefaultMachine(Machine machine) + { + _defaultMachine = machine; + } + #endregion #region Event Handlers @@ -234,6 +319,11 @@ namespace Tango.Integration.JobRuns } } + private void MachineOperator_HeadCleaningEnded(object sender, HeadCleaningEndedEventArgs e) + { + InsertHeadCleaningJobRun(e); + } + #endregion } } diff --git a/Software/Visual_Studio/Tango.Integration/JobRuns/IJobRunsLogger.cs b/Software/Visual_Studio/Tango.Integration/JobRuns/IJobRunsLogger.cs index a5242c1a4..386298bb9 100644 --- a/Software/Visual_Studio/Tango.Integration/JobRuns/IJobRunsLogger.cs +++ b/Software/Visual_Studio/Tango.Integration/JobRuns/IJobRunsLogger.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.BL.Entities; using Tango.BL.Enumerations; using Tango.Integration.Operation; @@ -42,5 +43,11 @@ namespace Tango.Integration.JobRuns /// Stops the logger. /// void Stop(); + + /// + /// Sets the head cleaning parameters. + /// + /// The machine. + void SetDefaultMachine(Machine machine); } } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/HeadCleaningEndedEventArgs.cs b/Software/Visual_Studio/Tango.Integration/Operation/HeadCleaningEndedEventArgs.cs new file mode 100644 index 000000000..0929c1254 --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/Operation/HeadCleaningEndedEventArgs.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Enumerations; +using Tango.BL.ValueObjects; + +namespace Tango.Integration.Operation +{ + public class HeadCleaningEndedEventArgs : EventArgs + { + public List LiquidQuantities { get; set; } + public DateTime StartDate { get; set; } + public double EndPosition { get; set; } + public double Length { get; set; } + public JobRunStatus Status { get; set; } + + public HeadCleaningEndedEventArgs() + { + LiquidQuantities = new List(); + } + } +} diff --git a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs index d006848de..bee4a7523 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs @@ -240,6 +240,11 @@ namespace Tango.Integration.Operation /// event EventHandler ThreadLoadingFailed; + /// + /// Occurs when a head cleaning job has ended. + /// + event EventHandler HeadCleaningEnded; + /// /// Gets or sets a value indicating whether direct the embedded device to send diagnostics messages. /// diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 0ae2086d3..57613aae2 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -74,9 +74,10 @@ namespace Tango.Integration.Operation private static RunningJobStatus _last_job_status; private bool _isPowerDownRequestInProgress; private bool _isHeadCleaningInProgress; - private List _currentJobLiquidQuantities; + private List _lastJobLiquidQuantities; private DateTime _diagnosticsTime; private MachineStatus _machineStatusBeforeJobStart; + private Configuration _machineConfiguration; private DateTime _jobStartDate; private DateTime? _jobUploadingStartDate; @@ -271,6 +272,11 @@ namespace Tango.Integration.Operation /// public event EventHandler PowerUpEnded; + /// + /// Occurs when a head cleaning job has ended. + /// + public event EventHandler HeadCleaningEnded; + #endregion #region Properties @@ -1115,7 +1121,7 @@ namespace Tango.Integration.Operation { PrintingCompleted?.Invoke(this, new PrintingEventArgs(handler, job) { - LiquidQuantities = _currentJobLiquidQuantities.ToList(), + LiquidQuantities = _lastJobLiquidQuantities.ToList(), StartDate = _jobStartDate, UploadingStartTime = _jobUploadingStartDate, HeatingStartTime = _jobHeatingStartDate, @@ -1135,7 +1141,7 @@ namespace Tango.Integration.Operation { PrintingFailed?.Invoke(this, new PrintingFailedEventArgs(handler, job, exception) { - LiquidQuantities = _currentJobLiquidQuantities.ToList(), + LiquidQuantities = _lastJobLiquidQuantities.ToList(), StartDate = _jobStartDate, UploadingStartTime = _jobUploadingStartDate, HeatingStartTime = _jobHeatingStartDate, @@ -1153,7 +1159,7 @@ namespace Tango.Integration.Operation { PrintingAborted?.Invoke(this, new PrintingEventArgs(handler, job) { - LiquidQuantities = _currentJobLiquidQuantities.ToList(), + LiquidQuantities = _lastJobLiquidQuantities.ToList(), StartDate = _jobStartDate, UploadingStartTime = _jobUploadingStartDate, HeatingStartTime = _jobHeatingStartDate, @@ -1171,7 +1177,7 @@ namespace Tango.Integration.Operation { PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, job) { - LiquidQuantities = _currentJobLiquidQuantities.ToList(), + LiquidQuantities = _lastJobLiquidQuantities.ToList(), StartDate = _jobStartDate, UploadingStartTime = _jobUploadingStartDate, HeatingStartTime = _jobHeatingStartDate, @@ -1179,6 +1185,20 @@ namespace Tango.Integration.Operation }); } + protected virtual void OnHeadCleaningEnded(HeadCleaningHandler handler, JobRunStatus status) + { + SaveLastJobLiquidQuantities(null, null, null, null); + + HeadCleaningEnded?.Invoke(this, new HeadCleaningEndedEventArgs() + { + StartDate = _jobStartDate, + Length = handler.Status.Total, + EndPosition = handler.Status.Progress, + Status = status, + LiquidQuantities = _lastJobLiquidQuantities.ToList(), + }); + } + #endregion #region Override Methods @@ -1893,9 +1913,14 @@ namespace Tango.Integration.Operation /// The handler. private void SaveLastJobLiquidQuantities(Job job, Configuration configuration, ProcessParametersTable processParameters, JobHandler handler) { + if (configuration == null) + { + configuration = _machineConfiguration; + } + try { - _currentJobLiquidQuantities = new List(); + _lastJobLiquidQuantities = new List(); if (JobLiquidQuantityCalculationMode == JobLiquidQuantityCalculationMode.MachineStatus) { @@ -1906,7 +1931,7 @@ namespace Tango.Integration.Operation if (packLevelAfter != null && packLevelBefore != null) { - _currentJobLiquidQuantities.Add(new BL.ValueObjects.JobRunLiquidQuantity() + _lastJobLiquidQuantities.Add(new BL.ValueObjects.JobRunLiquidQuantity() { LiquidType = pack.LiquidType.Type, Quantity = packLevelBefore.DispenserLevel - packLevelAfter.DispenserLevel, @@ -1916,7 +1941,7 @@ namespace Tango.Integration.Operation } else { - _currentJobLiquidQuantities = CreateJobRunLiquidQuantities(job, configuration, processParameters, handler.Status.Progress, handler.Status.TotalProgress); + _lastJobLiquidQuantities = CreateJobRunLiquidQuantities(job, configuration, processParameters, handler.Status.Progress, handler.Status.TotalProgress); } } catch (Exception ex) @@ -2319,7 +2344,7 @@ namespace Tango.Integration.Operation LogManager.Log($"Executing job '{job.Name}'..."); - _currentJobLiquidQuantities = new List(); + _lastJobLiquidQuantities = new List(); _jobUploadingStartDate = null; _jobHeatingStartDate = null; _jobActualStartDate = null; @@ -2906,6 +2931,8 @@ namespace Tango.Integration.Operation /// public async Task UploadHardwareConfiguration(HardwareVersion hardwareVersion, Configuration configuration) { + _machineConfiguration = configuration; + try { hardwareVersion = configuration.GetHardwareConfiguration().Merge(hardwareVersion); @@ -3745,11 +3772,20 @@ namespace Tango.Integration.Operation } _isHeadCleaningInProgress = true; + bool _completed = false; - HeadCleaningHandler handler = new HeadCleaningHandler(() => + HeadCleaningHandler handler = null; + handler = new HeadCleaningHandler(() => { _isHeadCleaningInProgress = false; Thread.Sleep(1000); + + if (!_completed) + { + _completed = true; + OnHeadCleaningEnded(handler, JobRunStatus.Aborted); + } + var r = SendRequest(new AbortHeadCleaningRequest(), new TransportRequestConfig() { ShouldLog = true }).Result; }); @@ -3757,7 +3793,11 @@ namespace Tango.Integration.Operation { Thread.Sleep(100); + _lastJobLiquidQuantities = new List(); + _machineStatusBeforeJobStart = MachineStatus.Clone(); + bool firstResponse = true; + _jobStartDate = DateTime.UtcNow; SendContinuousRequest(new StartHeadCleaningRequest(), new TransportContinuousRequestConfig() { ContinuousTimeout = TimeSpan.FromSeconds(5), ShouldLog = true }).ObserveOn(new NewThreadScheduler()).Subscribe((response) => { @@ -3775,10 +3815,22 @@ namespace Tango.Integration.Operation LogManager.Log(ex, "Head cleaning error."); handler.RaiseFailed(ex); } + + if (!_completed) + { + _completed = true; + OnHeadCleaningEnded(handler, JobRunStatus.Failed); + } }, () => { _isHeadCleaningInProgress = false; handler.RaiseCompleted(); + + if (!_completed) + { + _completed = true; + OnHeadCleaningEnded(handler, JobRunStatus.Completed); + } }); }); diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj index 91edb951e..7efd29d0a 100644 --- a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj +++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj @@ -117,6 +117,7 @@ + @@ -219,7 +220,7 @@ - + \ No newline at end of file -- cgit v1.3.1