From edd7e8af06fe0e70e78ce2de9423ec49a799b78a Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Wed, 10 May 2023 14:57:24 +0300 Subject: add values to UI dashboard indicators --- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 72 +++++++++++++--------- 1 file changed, 42 insertions(+), 30 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 fba49ced3..6d77ebcb9 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -8,12 +8,14 @@ using Tango.BL.Enumerations; using Tango.Core.Commands; using Tango.Core.DI; using Tango.Integration.Operation; +using Tango.PMR.Diagnostics; using Tango.PPC.Common; using Tango.PPC.Common.Diagnostics; using Tango.PPC.Jobs; using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.Views; using Tango.PPC.Maintenance.Models; +using Tango.PPC.UI.Models; namespace Tango.PPC.UI.ViewModels { @@ -23,9 +25,9 @@ namespace Tango.PPC.UI.ViewModels [TangoInject] public IDiagnosticsFrameProvider DefaultDiagnosticsFrameProvider { get; set; } - - private JobHandler _handler; + + private JobHandler _handler; private Job _job; /// @@ -34,10 +36,13 @@ namespace Tango.PPC.UI.ViewModels public Job Job { get { return _job; } - set { _job = value; - if(_job == null) + set + { + _job = value; + if (_job == null) IsDyeingProcess = false; - RaisePropertyChangedAuto(); } + RaisePropertyChangedAuto(); + } } private RunningJobStatus _runningJobStatus; @@ -47,13 +52,14 @@ namespace Tango.PPC.UI.ViewModels public RunningJobStatus RunningJobStatus { get { return _runningJobStatus; } - set { + set + { _runningJobStatus = value; - IsDyeingProcess = (_runningJobStatus != null && _runningJobStatus.CurrentSegment != null); - if(_runningJobStatus != null && _runningJobStatus.CurrentSegment != null) + IsDyeingProcess = (_runningJobStatus != null && _runningJobStatus.CurrentSegment != null); + if (_runningJobStatus != null && _runningJobStatus.CurrentSegment != null) { - var segment = Job.Segments.FirstOrDefault(x=>x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex); - if(segment != null) + var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex); + if (segment != null) CurrentBrushStop = segment.FirstBrushStop; } RaisePropertyChangedAuto(); @@ -104,8 +110,9 @@ namespace Tango.PPC.UI.ViewModels public bool IsDyeingProcess { get { return _isDyeingProcess; } - set { - if(_isDyeingProcess != value) + set + { + if (_isDyeingProcess != value) { _isDyeingProcess = value; RaisePropertyChangedAuto(); @@ -118,8 +125,9 @@ namespace Tango.PPC.UI.ViewModels public BrushStop CurrentBrushStop { get { return _currentBrushStop; } - set { - if(_currentBrushStop != value) + set + { + if (_currentBrushStop != value) { _currentBrushStop = value; OnUpdateCurrentBrush(); @@ -147,7 +155,7 @@ namespace Tango.PPC.UI.ViewModels { get { return GetVolumeLiquidType(LiquidTypes.Black); } } - + public double LightCyanOutput { get { return GetVolumeLiquidType(LiquidTypes.LightCyan); } @@ -180,6 +188,8 @@ namespace Tango.PPC.UI.ViewModels set { _midTankLevels = value; RaisePropertyChangedAuto(); } } + public MachineOverviewModel OverviewModel { get; set; } + #endregion #region Commands @@ -206,7 +216,7 @@ namespace Tango.PPC.UI.ViewModels public MachineStatusViewVM() { - StopCommand = new RelayCommand(StopJob, ()=>CanStopped()); + StopCommand = new RelayCommand(StopJob, () => CanStopped()); AbortCommand = new RelayCommand(AbortJob, () => CanStopped()); GoToJobCommand = new RelayCommand(GoToJob); JobStatusViewCommand = new RelayCommand(JobStatusView); @@ -217,6 +227,8 @@ namespace Tango.PPC.UI.ViewModels IsEnabledStopButton = false; IsSpoolView = false; IsWeghtView = false; + + OverviewModel = new MachineOverviewModel(); } public override void OnApplicationReady() @@ -237,12 +249,12 @@ namespace Tango.PPC.UI.ViewModels MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; MachineProvider.MachineOperator.PrintingEnded += MachineOperator_PrintingEnded; - //DefaultDiagnosticsFrameProvider.FrameReceived += DefaultDiagnosticsFrameProvider_FrameReceived; + DefaultDiagnosticsFrameProvider.FrameReceived += DefaultDiagnosticsFrameProvider_FrameReceived; } private void DefaultDiagnosticsFrameProvider_FrameReceived(object sender, PMR.Diagnostics.StartDiagnosticsResponse e) { - var frame = e; + OverviewModel.Update(e, this.Job != null ? Job.Rml : null, null); } private void MachineOperator_PrintingStarted(object sender, PrintingEventArgs e) @@ -296,24 +308,24 @@ namespace Tango.PPC.UI.ViewModels private void JobHandler_CanCancelChanged(object sender, EventArgs e) { - InvokeUI( () => - { - IsEnabledStopButton = _handler.CanCancel; - StopCommand.RaiseCanExecuteChanged(); - AbortCommand.RaiseCanExecuteChanged(); - }); + InvokeUI(() => + { + IsEnabledStopButton = _handler.CanCancel; + StopCommand.RaiseCanExecuteChanged(); + AbortCommand.RaiseCanExecuteChanged(); + }); } - + #endregion #region Methods private void GoToJob() { - + NavigationManager.NavigateWithObject(new JobNavigationObject() { Job = _handler.Job }); NavigationManager.ClearHistoryExcept(); - + } /// /// Toggles the application technician mode. @@ -329,7 +341,7 @@ namespace Tango.PPC.UI.ViewModels ApplicationManager.ExitTechnicianMode(); } } - + protected void JobStatusView() { IsJobStatusViewEnable = true; @@ -342,7 +354,7 @@ namespace Tango.PPC.UI.ViewModels private double GetVolumeLiquidType(LiquidTypes liquidType) { - if(CurrentBrushStop != null && CurrentBrushStop.LiquidVolumes != null && CurrentBrushStop.LiquidVolumes.Count > 0) + if (CurrentBrushStop != null && CurrentBrushStop.LiquidVolumes != null && CurrentBrushStop.LiquidVolumes.Count > 0) { var lt = CurrentBrushStop.LiquidVolumes.FirstOrDefault(x => x.LiquidType == liquidType); @@ -372,7 +384,7 @@ namespace Tango.PPC.UI.ViewModels protected void ClearAllNotifications() { - NotificationProvider.NotificationItems.Where(x=>x.CanClose).ToList().ForEach(y=> NotificationProvider.PopNotification(y)); + NotificationProvider.NotificationItems.Where(x => x.CanClose).ToList().ForEach(y => NotificationProvider.PopNotification(y)); } protected void OnUpdateCurrentBrush() -- cgit v1.3.1 From b597a69f85fec4f5b5a1aca65228fc840911d314 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 11 May 2023 20:23:33 +0300 Subject: IMplemented dynamic mid tank capacity on TwineX4 & FSE. --- .../MidTankLevelToElementHeightConverter.cs | 6 +- .../Tiles/MidTankLevels/MidTankLevelsTile.cs | 2 +- .../Tiles/MidTankLevels/MidTankLevelsTileView.xaml | 1 + .../Models/MidTankLevelModel.cs | 36 +++++++++ .../MidTankLevelToElementRectConverter.cs | 5 +- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 87 +++++++++++++++++++++- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 70 +++++++++-------- .../Visual_Studio/PPC/Tango.PPC.UI/app.manifest | 2 +- .../Tango.Emulations/Emulators/MachineEmulator.cs | 2 +- 9 files changed, 169 insertions(+), 42 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs') diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Converters/MidTankLevelToElementHeightConverter.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Converters/MidTankLevelToElementHeightConverter.cs index 88a90484d..f96725816 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Converters/MidTankLevelToElementHeightConverter.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Converters/MidTankLevelToElementHeightConverter.cs @@ -16,9 +16,9 @@ namespace Tango.FSE.UI.Converters try { double parentActualHeight = (double)values[0]; - double midTankLevel = Math.Min((double)values[1], MachineOperator.MAX_MIDTANK_LITERS); - //var test = (parentActualHeight - (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight); - return (parentActualHeight - (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight); + double max = (double)values[2]; + double midTankLevel = Math.Min((double)values[1], max); + return (parentActualHeight - (midTankLevel / max) * parentActualHeight); } catch { diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTile.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTile.cs index d8165d8aa..730055872 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTile.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTile.cs @@ -142,7 +142,7 @@ namespace Tango.FSE.UI.Tiles.MidTankLevels { MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure).OrderBy(x => x.PackIndex).Select(x => new MidTankLevelModel() { - Max = MachineOperator.MAX_MIDTANK_LITERS, + Max = x.MidTankType.LiterCapacity, IDSPack = x, }).ToList(); } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml index 7465f41c0..5e4f8ed9a 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/MidTankLevels/MidTankLevelsTileView.xaml @@ -58,6 +58,7 @@ + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs index 93af310ba..c656db8c0 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs @@ -29,6 +29,42 @@ namespace Tango.PPC.Maintenance.Models { get { return Level <= MachineOperator.EMPTY_MIDTANK_LITERS; } } + + private bool _bJerricanPresent; + + public bool JerricanPresent + { + get { return _bJerricanPresent; } + set { + _bJerricanPresent = value; + RaisePropertyChangedAuto(); + } + } + + private bool _fillingTimeoutError; + + public bool FillingTimeoutError + { + get { return _fillingTimeoutError; } + set { _fillingTimeoutError = value; RaisePropertyChangedAuto(); } + } + + private bool _midTankEmpty; + + public bool MidTankEmpty + { + get { return _midTankEmpty; } + set { _midTankEmpty = value; RaisePropertyChangedAuto();} + } + + private bool _midTankRefillPumpActive; + + public bool MidTankRefillPumpActive + { + get { return _midTankRefillPumpActive; } + set { _midTankRefillPumpActive = value; RaisePropertyChangedAuto(); } + } + public IdsPack IDSPack { get; set; } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs index b82ed2b52..2f0e73e2f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/MidTankLevelToElementRectConverter.cs @@ -17,9 +17,10 @@ namespace Tango.PPC.UI.Converters { double actualHeight = (double)values[0]; double actualWidth = (double)values[1]; - double midTankLevel = Math.Min((double)values[2], MachineOperator.MAX_MIDTANK_LITERS); + double maxLiters = (double)values[3]; + double midTankLevel = Math.Min((double)values[2], maxLiters); - var offset = (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * actualHeight; + var offset = (midTankLevel / maxLiters) * actualHeight; return new System.Windows.Rect(1, offset, actualWidth, actualHeight); } catch 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 6d77ebcb9..1f4040460 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -9,6 +9,7 @@ using Tango.Core.Commands; using Tango.Core.DI; using Tango.Integration.Operation; using Tango.PMR.Diagnostics; +using Tango.PMR.MachineStatus; using Tango.PPC.Common; using Tango.PPC.Common.Diagnostics; using Tango.PPC.Jobs; @@ -16,6 +17,9 @@ using Tango.PPC.Jobs.NavigationObjects; using Tango.PPC.Jobs.Views; using Tango.PPC.Maintenance.Models; using Tango.PPC.UI.Models; +using System.Timers; +using System.Windows.Threading; +using System.Diagnostics; namespace Tango.PPC.UI.ViewModels { @@ -26,6 +30,9 @@ namespace Tango.PPC.UI.ViewModels [TangoInject] public IDiagnosticsFrameProvider DefaultDiagnosticsFrameProvider { get; set; } + private DispatcherTimer _ink_timer; + private Stopwatch _stopwatch; + private JobHandler _handler; @@ -190,6 +197,15 @@ namespace Tango.PPC.UI.ViewModels public MachineOverviewModel OverviewModel { get; set; } + private TimeSpan _timer; + + public TimeSpan FullInkTimer + { + get { return _timer; } + set { _timer = value; RaisePropertyChangedAuto();} + } + + #endregion #region Commands @@ -216,6 +232,10 @@ namespace Tango.PPC.UI.ViewModels public MachineStatusViewVM() { + _ink_timer = new DispatcherTimer(); + _ink_timer.Interval = TimeSpan.FromSeconds(1); + _ink_timer.Tick += _ink_timer_Tick; + StopCommand = new RelayCommand(StopJob, () => CanStopped()); AbortCommand = new RelayCommand(AbortJob, () => CanStopped()); GoToJobCommand = new RelayCommand(GoToJob); @@ -237,11 +257,76 @@ namespace Tango.PPC.UI.ViewModels MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure).OrderBy(x => x.PackIndex).Select(x => new MidTankLevelModel() { - Max = MachineOperator.MAX_MIDTANK_LITERS, + Max = x.MidTankType.LiterCapacity, IDSPack = x, }).OrderBy(y => y.IDSPack.LiquidType.Code).ToList(); + // MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged; + MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; + } + + #region Events + + private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) + { + UpdateMidTankLevels(status); + } + private void UpdateMidTankLevels(MachineStatus status) + { + if (!IsJobStatusViewEnable) + { + foreach (var item in status.IDSPacksLevels) + { + var model = MidTankLevels.SingleOrDefault(x => x.IDSPack.PackIndex == item.Index); + + if (model != null) + { + model.Level = item.MidTankLevel; + model.JerricanPresent = item.JerricanPresent; + model.FillingTimeoutError = item.FillingTimeoutError; + model.MidTankEmpty = item.MidTankEmpty; + model.MidTankRefillPumpActive = item.MidTankRefillPumpActive; + if (model.FillingTimeoutError) + { + //StartInkTimer() + } + } + } + } + } + private void StartInkTimer() + { + _stopwatch = Stopwatch.StartNew(); + _ink_timer.Start(); + } + + private void StopInkTimer() + { + if (_stopwatch.IsRunning) + { + _stopwatch.Stop(); + _ink_timer.Stop(); + } } + private void _ink_timer_Tick(object sender, EventArgs e) + { + FullInkTimer = _stopwatch.Elapsed; + } + private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e) + { + //foreach (var cartridge in e.Status.CartridgesStatuses.Where(x => x.Cartridge.Slot != CartridgeSlot.Ink)) + //{ + // var wasteState = WasteStates.SingleOrDefault(x => x.Slot == cartridge.Cartridge.Slot); + + // if (wasteState != null) + // { + // wasteState.State = cartridge.State; + // } + //} + } + + #endregion + #region printing public override void OnApplicationStarted() diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 6edc90844..998ab7db4 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -120,48 +120,52 @@ - + - - - + + + 30 88 - - - - - - - - + + + + + + + + + - - - + + + - - + + - + - - - - + + + + + + + @@ -196,13 +200,13 @@ - + - - - - + + + + @@ -238,13 +242,13 @@ - + - - - - + + + + @@ -880,7 +884,7 @@ - ºC + ºC Dryer Zone 3 diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index d72e75011..efc5f8179 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - + diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index ac5e69425..8f8a04005 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -166,7 +166,7 @@ namespace Tango.Emulations.Emulators { Index = i, DispenserLevel = 130000000, - MidTankLevel = 2500, + MidTankLevel = 2.5, }); } -- cgit v1.3.1 From 963f8c4fa2b4da7d875dc223cd70c55e0d5390c1 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 11 May 2023 21:52:06 +0300 Subject: Show light inks --- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 44 ++++++++++++++-------- .../PPC/Tango.PPC.UI/Views/MachineStatusView.xaml | 2 +- 2 files changed, 29 insertions(+), 17 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 1f4040460..7cd328e7b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -20,6 +20,7 @@ using Tango.PPC.UI.Models; using System.Timers; using System.Windows.Threading; using System.Diagnostics; +using Tango.PMR.Printing; namespace Tango.PPC.UI.ViewModels { @@ -62,13 +63,6 @@ namespace Tango.PPC.UI.ViewModels set { _runningJobStatus = value; - IsDyeingProcess = (_runningJobStatus != null && _runningJobStatus.CurrentSegment != null); - if (_runningJobStatus != null && _runningJobStatus.CurrentSegment != null) - { - var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex); - if (segment != null) - CurrentBrushStop = segment.FirstBrushStop; - } RaisePropertyChangedAuto(); } } @@ -128,13 +122,12 @@ namespace Tango.PPC.UI.ViewModels } private BrushStop _currentBrushStop; - public BrushStop CurrentBrushStop { get { return _currentBrushStop; } set { - if (_currentBrushStop != value) + // if (_currentBrushStop != value) { _currentBrushStop = value; OnUpdateCurrentBrush(); @@ -143,6 +136,8 @@ namespace Tango.PPC.UI.ViewModels } } + public JobBrushStop JobBrushStop { get; set; } + public double CyanOutput { get { return GetVolumeLiquidType(LiquidTypes.Cyan); } @@ -202,7 +197,7 @@ namespace Tango.PPC.UI.ViewModels public TimeSpan FullInkTimer { get { return _timer; } - set { _timer = value; RaisePropertyChangedAuto();} + set { _timer = value; RaisePropertyChangedAuto(); } } @@ -260,7 +255,7 @@ namespace Tango.PPC.UI.ViewModels Max = x.MidTankType.LiterCapacity, IDSPack = x, }).OrderBy(y => y.IDSPack.LiquidType.Code).ToList(); - // MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged; + // MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged; MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; } @@ -385,10 +380,27 @@ namespace Tango.PPC.UI.ViewModels private void JobHandler_StatusChanged(object sender, RunningJobStatus e) { - InvokeUI(() => + //InvokeUI(() => + //{ + + + RunningJobStatus = e; + IsDyeingProcess = (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null); + if (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null) { - RunningJobStatus = e; - }); + 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; + } + } + //}); } private void JobHandler_CanCancelChanged(object sender, EventArgs e) @@ -439,9 +451,9 @@ namespace Tango.PPC.UI.ViewModels private double GetVolumeLiquidType(LiquidTypes liquidType) { - if (CurrentBrushStop != null && CurrentBrushStop.LiquidVolumes != null && CurrentBrushStop.LiquidVolumes.Count > 0) + if (JobBrushStop != null && JobBrushStop.Dispensers != null && JobBrushStop.Dispensers.Count > 0) { - var lt = CurrentBrushStop.LiquidVolumes.FirstOrDefault(x => x.LiquidType == liquidType); + var lt = JobBrushStop.Dispensers.FirstOrDefault(x => x.DispenserLiquidType == (DispenserLiquidType)liquidType); if (lt != null) { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml index 998ab7db4..383ce77e6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml @@ -163,7 +163,7 @@ - + -- cgit v1.3.1