From 3e46bf434c6f8ba56fe812205fd1ea20a1f9d347 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Mon, 5 Jun 2023 15:11:17 +0300 Subject: Present Lubricant Ink with divider, sort the Ink level indicators. Related Work Items: #8528 --- .../Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 29 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') 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 68c0f1867..52199fcca 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -186,6 +186,13 @@ namespace Tango.PPC.UI.ViewModels set { _midTankLevels = value; RaisePropertyChangedAuto(); } } + private JerricanLevelModel _midTankLubLevel; + public JerricanLevelModel MidTankLubLevel + { + get { return _midTankLubLevel; } + set { _midTankLubLevel = value; RaisePropertyChangedAuto(); } + } + public MachineOverviewModel OverviewModel { get; set; } private bool _isDisplayJobOutline; @@ -264,11 +271,19 @@ namespace Tango.PPC.UI.ViewModels { base.OnApplicationReady(); - MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure || x.MidTankType.Type == MidTankTypes.LubricantMidTank).OrderBy(x => x.PackIndex).Select(x => new JerricanLevelModel() + MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure ).OrderBy(x => x.PackIndex).Select(x => new JerricanLevelModel() { Max = x.MidTankType.LiterCapacity, IDSPack = x, - }).OrderBy(y => y.IDSPack.LiquidType.PreferredIndex).ToList(); + }).OrderBy(y => y.IDSPack.LiquidType.Type).ToList(); + var LubLevel = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.Type == MidTankTypes.LubricantMidTank).FirstOrDefault(); + + MidTankLubLevel = new JerricanLevelModel(); + if(LubLevel != null) + { + MidTankLubLevel.Max = LubLevel.MidTankType.LiterCapacity; + MidTankLubLevel.IDSPack = LubLevel; + }; MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; @@ -287,7 +302,15 @@ namespace Tango.PPC.UI.ViewModels { foreach (var item in status.IDSPacksLevels) { - var model = MidTankLevels.SingleOrDefault(x => x.IDSPack.PackIndex == item.Index); + JerricanLevelModel model = null; + if (item.Index == 8)//lub + { + model = MidTankLubLevel; + + } + else { + model = MidTankLevels.SingleOrDefault(x => x.IDSPack.PackIndex == item.Index); + } if (model != null) { -- cgit v1.3.1