diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-14 16:45:03 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-14 16:45:03 +0300 |
| commit | 7d54607a2a61b9a99376b385c40e94257365eb18 (patch) | |
| tree | 282168fa8e1f602d9e61877aae3968682b2a490e /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels | |
| parent | 963f8c4fa2b4da7d875dc223cd70c55e0d5390c1 (diff) | |
| download | Tango-7d54607a2a61b9a99376b385c40e94257365eb18.tar.gz Tango-7d54607a2a61b9a99376b385c40e94257365eb18.zip | |
Working on Jerrican Levels Twine X4.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 59 |
1 files changed, 9 insertions, 50 deletions
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 7cd328e7b..a47b68a4f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -15,7 +15,6 @@ 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; using System.Timers; using System.Windows.Threading; @@ -31,10 +30,6 @@ namespace Tango.PPC.UI.ViewModels [TangoInject] public IDiagnosticsFrameProvider DefaultDiagnosticsFrameProvider { get; set; } - private DispatcherTimer _ink_timer; - private Stopwatch _stopwatch; - - private JobHandler _handler; private Job _job; @@ -127,7 +122,7 @@ namespace Tango.PPC.UI.ViewModels get { return _currentBrushStop; } set { - // if (_currentBrushStop != value) + // if (_currentBrushStop != value) { _currentBrushStop = value; OnUpdateCurrentBrush(); @@ -183,8 +178,8 @@ namespace Tango.PPC.UI.ViewModels // get { return GetVolumeLiquidType(LiquidTypes.Lubricant); } //} - private List<MidTankLevelModel> _midTankLevels; - public List<MidTankLevelModel> MidTankLevels + private List<JerricanLevelModel> _midTankLevels; + public List<JerricanLevelModel> MidTankLevels { get { return _midTankLevels; } set { _midTankLevels = value; RaisePropertyChangedAuto(); } @@ -192,15 +187,6 @@ 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 @@ -227,9 +213,7 @@ 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()); @@ -250,13 +234,14 @@ namespace Tango.PPC.UI.ViewModels { base.OnApplicationReady(); - MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure).OrderBy(x => x.PackIndex).Select(x => new MidTankLevelModel() + MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure || x.MidTankType.Type == MidTankTypes.LubricantMidTank).OrderBy(x => x.PackIndex).Select(x => new JerricanLevelModel() { Max = x.MidTankType.LiterCapacity, IDSPack = x, - }).OrderBy(y => y.IDSPack.LiquidType.Code).ToList(); - // MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged; + }).OrderBy(y => y.IDSPack.LiquidType.PreferredIndex).ToList(); + MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; + } #region Events @@ -280,33 +265,12 @@ namespace Tango.PPC.UI.ViewModels model.FillingTimeoutError = item.FillingTimeoutError; model.MidTankEmpty = item.MidTankEmpty; model.MidTankRefillPumpActive = item.MidTankRefillPumpActive; - if (model.FillingTimeoutError) - { - //StartInkTimer() - } + model.RemainingTimeoutError = TimeSpan.FromSeconds(item.TimerRemainingSeconds); } } } } - 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)) @@ -380,10 +344,6 @@ namespace Tango.PPC.UI.ViewModels private void JobHandler_StatusChanged(object sender, RunningJobStatus e) { - //InvokeUI(() => - //{ - - RunningJobStatus = e; IsDyeingProcess = (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null); if (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null) @@ -400,7 +360,6 @@ namespace Tango.PPC.UI.ViewModels CurrentBrushStop = segment.FirstBrushStop; } } - //}); } private void JobHandler_CanCancelChanged(object sender, EventArgs e) |
