From 38ed93f95bb5af92bc84599ebb9c0c6895b0b989 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Sun, 2 Jul 2023 13:37:17 +0300 Subject: Job running progress bar. Set running background in progress bar by unit from right to left as auto reverse ( not animation). Bug in current segment in JobHandler. --- .../PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs index 103084e11..653c2368f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -571,17 +571,17 @@ namespace Tango.PPC.UI.ViewModels IsDyeingProcess = (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null); if (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null) { - var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex); + var currentSegmentIndex = Math.Max(_runningJobStatus.CurrentSegment.SegmentIndex - (Job.Segments.Count * RunningJobStatus.CurrentUnit), 0); + var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == currentSegmentIndex); + // var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex); if (segment != null) { - if (_handler.JobTicket.Segments.Count > 0) { JobBrushStop = _handler.JobTicket.Segments[Job.OrderedSegments.IndexOf(segment)].BrushStops.First(); - } - - CurrentBrushStop = segment.FirstBrushStop; + } } + CurrentBrushStop = RunningJobStatus.CurrentSegment.FirstBrushStop; } } -- cgit v1.3.1