aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/BitResultsViewVM.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2021-04-07 14:23:01 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2021-04-07 14:23:01 +0300
commit2993243d50ab08ebff7dbbb773a313e1e152f8c6 (patch)
tree4c30f667ec1878570bf9f63aaf20f68a853068b6 /Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/BitResultsViewVM.cs
parentc87a2063a2951e433195a960d16e8b1de7748fb0 (diff)
downloadTango-2993243d50ab08ebff7dbbb773a313e1e152f8c6.tar.gz
Tango-2993243d50ab08ebff7dbbb773a313e1e152f8c6.zip
Refactored Bit Results Dialog.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/BitResultsViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/BitResultsViewVM.cs24
1 files changed, 23 insertions, 1 deletions
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;
}
}