diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-05-28 12:22:01 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-05-28 12:22:01 +0300 |
| commit | 353003efbcfd0f461b393d7242f1ef2d401c39fe (patch) | |
| tree | 1527d7f56381845325c4f4c677d61944df723807 /Software/Visual_Studio/Utilities/Tango.JobProgressTester.UI | |
| parent | 2624be1a24c8581bdc5977bab66c40ef0e667378 (diff) | |
| download | Tango-353003efbcfd0f461b393d7242f1ef2d401c39fe.tar.gz Tango-353003efbcfd0f461b393d7242f1ef2d401c39fe.zip | |
Updated original job handler with Vica's work.
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.JobProgressTester.UI')
| -rw-r--r-- | Software/Visual_Studio/Utilities/Tango.JobProgressTester.UI/JobHandler2.cs | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.JobProgressTester.UI/JobHandler2.cs b/Software/Visual_Studio/Utilities/Tango.JobProgressTester.UI/JobHandler2.cs index 27dfa2ebe..e646ee51e 100644 --- a/Software/Visual_Studio/Utilities/Tango.JobProgressTester.UI/JobHandler2.cs +++ b/Software/Visual_Studio/Utilities/Tango.JobProgressTester.UI/JobHandler2.cs @@ -20,44 +20,36 @@ namespace Tango.JobProgressTester.UI protected override void InvalidateJobProgress(JobStatus s) { - //base.InvalidateJobProgress(s); //Vica: Remove this and create new implementation. JobStatus = s; - bool invalidProgress = false; - // if (_last_progress != s.Progress) - // { - if (s.Progress <= PROGRESS_REPORT_RANGE_METERS || s.Progress >= Status.TotalProgress - PROGRESS_REPORT_RANGE_METERS) + if (_last_progress != s.Progress) { - LogManager.Log($"Updating job progress {s.Progress}/{Status.TotalProgress}..."); - } - else if (!loggedContinueMessage) - { - loggedContinueMessage = true; - LogManager.Log($"Progress logging will continue {PROGRESS_REPORT_RANGE_METERS} meters before completion..."); + if (s.Progress <= PROGRESS_REPORT_RANGE_METERS || s.Progress >= Status.TotalProgress - PROGRESS_REPORT_RANGE_METERS) + { + LogManager.Log($"Updating job progress {s.Progress}/{Status.TotalProgress}..."); + } + else if (!loggedContinueMessage) + { + loggedContinueMessage = true; + LogManager.Log($"Progress logging will continue {PROGRESS_REPORT_RANGE_METERS} meters before completion..."); + } } - //} if (s.Progress < 0) { LogManager.Log($"Invalid job progress received '{s.Progress}'.", LogCategory.Error); - invalidProgress = true; + return; } if (s.Progress > Status.TotalProgress) { LogManager.Log($"Invalid job progress received '{s.Progress}' while total progress is '{Status.TotalProgress}'.", LogCategory.Error); - invalidProgress = true; + return; } - //if (s.Progress < _last_progress) - //{ - // LogManager.Log($"Invalid job progress received '{s.Progress}' while last progress was '{_last_progress}'."); - // invalidProgress = true; - //} - - if (invalidProgress) + if (s.Progress < _last_progress) { - return; + LogManager.Log($"Invalid job progress received '{s.Progress}' while last progress was '{_last_progress}'."); } _last_progress = s.Progress; |
