From 2993243d50ab08ebff7dbbb773a313e1e152f8c6 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 7 Apr 2021 14:23:01 +0300 Subject: Refactored Bit Results Dialog. --- .../PPC/Tango.PPC.UI/Dialogs/BitResultsView.xaml | 7 +++++++ .../PPC/Tango.PPC.UI/Dialogs/BitResultsViewVM.cs | 24 +++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/BitResultsView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/BitResultsView.xaml index c9618d594..59bff14eb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/BitResultsView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/BitResultsView.xaml @@ -102,6 +102,13 @@ Fetching BIT results, please wait... + + + + + All tests passed successfully + + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/BitResultsViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/BitResultsViewVM.cs index a28bd0c39..6a9630c21 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/BitResultsViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/BitResultsViewVM.cs @@ -9,6 +9,7 @@ using Tango.Core.DI; using Tango.Integration.Operation; using Tango.PMR.Diagnostics; using Tango.PPC.Common; +using Tango.PPC.Common.Application; using Tango.PPC.Common.Connection; using Tango.PPC.Common.Notifications; using Tango.SharedUI; @@ -30,6 +31,16 @@ namespace Tango.PPC.UI.Dialogs [TangoInject] public INotificationProvider NotificationProvider { get; set; } + [TangoInject] + public IPPCApplicationManager ApplicationManager { get; set; } + + private bool _bitSuccessful; + public bool BitSuccessful + { + get { return _bitSuccessful; } + set { _bitSuccessful = value; RaisePropertyChangedAuto(); } + } + public BitResultsViewVM() { TangoIOC.Default.Inject(this); @@ -46,7 +57,18 @@ namespace Tango.PPC.UI.Dialogs using (ObservablesContext db = ObservablesContext.CreateDefault()) { var bitTypes = await db.BitTypes.ToListAsync(); - Results = await MachineProvider.MachineOperator.GetBitResults(bitTypes); + var results = await MachineProvider.MachineOperator.GetBitResults(bitTypes); + + if (ApplicationManager.IsInTechnicianMode) + { + Results = results; + } + else + { + Results = results.Where(x => x.BitResult.Status == BitResultStatus.Failed || x.BitResult.Status == BitResultStatus.Warning).ToList(); + BitSuccessful = Results.Count == 0; + } + IsFree = true; } } -- cgit v1.3.1