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. --- .../Views/MaintenanceView.xaml | 2 +- .../PPC/Tango.PPC.UI/Dialogs/BitResultsView.xaml | 7 +++++++ .../PPC/Tango.PPC.UI/Dialogs/BitResultsViewVM.cs | 24 +++++++++++++++++++++- .../Visual_Studio/PPC/Tango.PPC.UI/app.manifest | 2 +- 4 files changed, 32 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/PPC') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml index 25dc08f7e..4f93f9b31 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml @@ -259,7 +259,7 @@ EXPORT SYSTEM LOGS - VIEW BIT RESULTS + VIEW BIT RESULTS 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; } } 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. --> - + -- cgit v1.3.1