diff options
| author | Roy Ben-Shabat <Roy.mail.net@gmail.com> | 2023-05-24 11:23:39 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy.mail.net@gmail.com> | 2023-05-24 11:23:39 +0300 |
| commit | f63fd116590161620cd7eb1aaea83139fd1b9afd (patch) | |
| tree | f4be0ec7be2f153152b639acaafb9348626607ef /Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs | |
| parent | 7c802a28b124836721202b8916a25f8e67df78a1 (diff) | |
| parent | d7a0d5e8d6804f5f739c223c123b4b2780af4e11 (diff) | |
| download | Tango-f63fd116590161620cd7eb1aaea83139fd1b9afd.tar.gz Tango-f63fd116590161620cd7eb1aaea83139fd1b9afd.zip | |
Merge branch 'eureka' of https://twinetfs.visualstudio.com/Tango/_git/Tango into eureka
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs new file mode 100644 index 000000000..1863b01e1 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.PPC.UI.Models +{ + public class MachineOverviewErrorStates : ExtendedObject + { + public ObservableCollection<MachineOverviewErrorItem> Winders { get; set; } + + public ObservableCollection<MachineOverviewErrorItem> Dancers { get; set; } + + public ObservableCollection<MachineOverviewErrorItem> BTSRs { get; set; } + + public MachineOverviewErrorStates() + { + Winders = new ObservableCollection<MachineOverviewErrorItem>(); + Dancers = new ObservableCollection<MachineOverviewErrorItem>(); + BTSRs = new ObservableCollection<MachineOverviewErrorItem>(); + for ( int i = 0; i < 4 ; i++) + { + Winders.Add( new MachineOverviewErrorItem()); + Dancers.Add(new MachineOverviewErrorItem()); + BTSRs.Add(new MachineOverviewErrorItem()); + } + } + + public void UpdateWinders(List<bool> updates) + { + if(!UpdateCollection(Winders, updates)) + { + LogManager.Log("Error in display Winders Errors. Number of Winders In Error is less then 4!"); + } + } + public void UpdateDancers(List<bool> updates) + { + if(!UpdateCollection(Dancers, updates)) + { + LogManager.Log("Error in display Dancers Errors. Number of Dancers In Error is less then 4!"); + } + } + public void UpdateBTSRs(List<bool> updates) + { + if(!UpdateCollection(BTSRs, updates)) + { + LogManager.Log("Error in display BTSRs Errors. Number of BTSRs In Error is less then 4!"); + } + } + + private bool UpdateCollection(ObservableCollection<MachineOverviewErrorItem> collection, List<bool> updates ) + { + if (collection.Count == updates.Count) + { + for (int i = 0; i < collection.Count; i++) + { + collection[i].IsErrorState = updates[i]; + } + return true; + } + return false; + + } + } +} |
