diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-05-05 00:35:57 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-05-05 00:35:57 +0300 |
| commit | dd81a94133e1c5117e06e84cbddf45ffec30acfc (patch) | |
| tree | 13640f05cae1caf4d893d94e73bb0b7a2705110a /Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs | |
| parent | a64398732031132ddedd6584c1990a5caa1ae049 (diff) | |
| download | Tango-dd81a94133e1c5117e06e84cbddf45ffec30acfc.tar.gz Tango-dd81a94133e1c5117e06e84cbddf45ffec30acfc.zip | |
Dashboard completed ?
Remote job tracking.
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs index 96c2ea4c4..f0ed109cc 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs @@ -88,6 +88,17 @@ namespace Tango.Integration.Operation #region Properties + private JobStatus _jobStatus; + /// <summary> + /// Gets or sets the current job status that was used to invalidate this handler. + /// </summary> + public JobStatus JobStatus + { + get { return _jobStatus; } + set { _jobStatus = value; RaisePropertyChangedAuto(); } + } + + /// <summary> /// Gets a value indicating whether this handler job has been canceled. /// </summary> @@ -144,7 +155,7 @@ namespace Tango.Integration.Operation /// Initializes a new instance of the <see cref="JobHandler"/> class. /// </summary> /// <param name="cancelAction">The cancel action.</param> - internal JobHandler(Action cancelAction, Job job, JobTicket jobTicket, ProcessParametersTable processParameters, JobHandlerModes mode) : this() + public JobHandler(Action cancelAction, Job job, JobTicket jobTicket, ProcessParametersTable processParameters, JobHandlerModes mode) : this() { _mode = mode; @@ -195,7 +206,7 @@ namespace Tango.Integration.Operation //Create all segments int segment_index = 1; - for (int j = 0; j < Job.NumberOfUnits; j++) + for (int j = 0; j < Math.Max(Job.NumberOfUnits, 1); j++) { for (int i = 0; i < _effectiveSegments.Count; i++) { @@ -231,7 +242,7 @@ namespace Tango.Integration.Operation /// Raises the status received event. /// </summary> /// <param name="status">The status.</param> - internal void RaiseStatusReceived(JobStatus status) + public void RaiseStatusReceived(JobStatus status) { InvalidateJobProgress(status); } @@ -240,7 +251,7 @@ namespace Tango.Integration.Operation /// Raises the failed event. /// </summary> /// <param name="ex">The ex.</param> - internal void RaiseFailed(Exception ex) + public void RaiseFailed(Exception ex) { LogManager.Log($"Job failed at position {Status.Progress}/{Status.TotalProgress}..."); Status.IsFailed = true; @@ -253,7 +264,7 @@ namespace Tango.Integration.Operation /// <summary> /// Raises the completed event. /// </summary> - internal void RaiseCompleted() + public void RaiseCompleted() { //This will compensate on any missing progress from Shlomo, but also will tell the wrong progress if job is really completed with a large progress mistake. // Might be worth to compensate only on small drifts like the below (ProgressMinusSettingsUp)... @@ -285,7 +296,7 @@ namespace Tango.Integration.Operation /// <summary> /// Raises the canceled event. /// </summary> - internal void RaiseCanceled() + public void RaiseCanceled() { LogManager.Log($"Job canceled at position {Status.Progress}/{Status.TotalProgress}..."); Status.IsCanceled = true; @@ -313,6 +324,7 @@ namespace Tango.Integration.Operation private void InvalidateJobProgress(JobStatus s) { + JobStatus = s; bool invalidProgress = false; if (_last_progress != s.Progress) |
