diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-23 16:49:49 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-05-23 16:49:49 +0300 |
| commit | bc94c84ee20ea01618241e8a4d32c2a77b4084cc (patch) | |
| tree | 10761eb1d3474c45af6894bdc535b09f6f8e4197 /Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs | |
| parent | 304735006580cb2f6728bedeb3393dbefc2e14f5 (diff) | |
| download | Tango-bc94c84ee20ea01618241e8a4d32c2a77b4084cc.tar.gz Tango-bc94c84ee20ea01618241e8a4d32c2a77b4084cc.zip | |
Added data processing of BtsrsInError, DancersInError, WindersInError in GUI.
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 | 56 |
1 files changed, 56 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..d293c4418 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Models/MachineOverviewErrorStates.cs @@ -0,0 +1,56 @@ +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) + { + UpdateCollection(Winders, updates); + } + public void UpdateDancers(List<bool> updates) + { + UpdateCollection(Dancers, updates); + } + public void UpdateBTSRs(List<bool> updates) + { + UpdateCollection(BTSRs, updates); + } + + private void 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]; + } + } + } + } +} |
