diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-06-06 14:56:59 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-06-06 14:56:59 +0300 |
| commit | 54624e4a90a240ad702995e1ed551901768e131f (patch) | |
| tree | 48ebd2cdf3024622dfa8717dfb6cf866a01b9de6 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels | |
| parent | 6ebf2ef8590a3f58b77c2b05e8c49c409b75a040 (diff) | |
| download | Tango-54624e4a90a240ad702995e1ed551901768e131f.tar.gz Tango-54624e4a90a240ad702995e1ed551901768e131f.zip | |
Open Notifications bar when an error happens
Related Work Items: #8534
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs | 27 |
1 files changed, 26 insertions, 1 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 52199fcca..2563cb331 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs @@ -217,6 +217,17 @@ namespace Tango.PPC.UI.ViewModels public MachineOverviewErrorStates MachineErrorStates { get; set; } + private bool _isExpandedNotificatios; + + public bool IsExpandedNotifications + { + get { return _isExpandedNotificatios; } + set { + _isExpandedNotificatios = value; + RaisePropertyChangedAuto();} + } + + #endregion #region Commands @@ -265,11 +276,14 @@ namespace Tango.PPC.UI.ViewModels OverviewModel = new MachineOverviewModel(); MachineErrorStates = new MachineOverviewErrorStates(); + + IsExpandedNotifications = false; } public override void OnApplicationReady() { base.OnApplicationReady(); + EventLogger.EventReceived += EventLogger_EventReceived; MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure ).OrderBy(x => x.PackIndex).Select(x => new JerricanLevelModel() { @@ -291,7 +305,18 @@ namespace Tango.PPC.UI.ViewModels #region Events - private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) + private void EventLogger_EventReceived(object sender, MachinesEvent ev) + { + InvokeUI(() => + { + if (ev.Category == EventTypeCategories.Error || ev.Category == EventTypeCategories.Critical) + { + IsExpandedNotifications = true; + } + }); + } + + private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) { UpdateMidTankLevels(status); UpdateMachineStatusErrors(status); |
