diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-03-22 14:21:51 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-03-22 14:21:51 +0200 |
| commit | 21fb72e7d63518adbe816f871c44b2929926bd10 (patch) | |
| tree | e65f54a41c55f9b5eeca0a45fd64af33c94c6d5d /Software/Visual_Studio/Utilities | |
| parent | 6ccd2ee79d33669baea3d5d49b3fc5597e32d177 (diff) | |
| download | Tango-21fb72e7d63518adbe816f871c44b2929926bd10.tar.gz Tango-21fb72e7d63518adbe816f871c44b2929926bd10.zip | |
JobHandler unit calc optimization.
Diffstat (limited to 'Software/Visual_Studio/Utilities')
| -rw-r--r-- | Software/Visual_Studio/Utilities/Tango.JobProgressTester.UI/JobHandler2.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.JobProgressTester.UI/JobHandler2.cs b/Software/Visual_Studio/Utilities/Tango.JobProgressTester.UI/JobHandler2.cs index e646ee51e..b4fc23c8e 100644 --- a/Software/Visual_Studio/Utilities/Tango.JobProgressTester.UI/JobHandler2.cs +++ b/Software/Visual_Studio/Utilities/Tango.JobProgressTester.UI/JobHandler2.cs @@ -84,15 +84,19 @@ namespace Tango.JobProgressTester.UI unit_segments = _effectiveSegments.ToList(); Status.CurrentUnitProgress = 0.0; double previousUnitsLengthWithoutThis = 0.0; + + int currentUnit = Status.CurrentUnit; + double currentUnitProgress = Status.CurrentUnitProgress; + for (int index = 0; index < units; ++index) { - Status.CurrentUnit = index; + currentUnit = index; double unitLength = !Job.EnableInterSegment || index >= units - 1 ? Job.Length : Job.Length + Job.InterSegmentLength; if (_mode == JobHandlerModes.Finalization) { if (s.Progress < unitLength + previousUnitsLengthWithoutThis) { - Status.CurrentUnitProgress = s.Progress - previousUnitsLengthWithoutThis; + currentUnitProgress = s.Progress - previousUnitsLengthWithoutThis; break; } } @@ -100,13 +104,17 @@ namespace Tango.JobProgressTester.UI { if (!Status.IsSettingUp) { - Status.CurrentUnitProgress = s.Progress - previousUnitsLengthWithoutThis - this.Status.SettingUpProgress; + currentUnitProgress = s.Progress - previousUnitsLengthWithoutThis - this.Status.SettingUpProgress; break; } break; } previousUnitsLengthWithoutThis += unitLength; } + + Status.CurrentUnit = currentUnit; + Status.CurrentUnitProgress = currentUnitProgress; + Status.RemainingUnits = this.Job.NumberOfUnits - this.Status.CurrentUnit; if (Job.EnableInterSegment && Job.NumberOfUnits > 1 && Status.RemainingUnits > 1) |
