using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Windows; using System.Windows.Input; using Aitex.Core.Common.DeviceData; using Aitex.Core.UI.MVVM; using Aitex.Core.Util; using Aitex.Sorter.UI.ViewModel; using MECF.Framework.Common.IOCore; namespace Aitex.Sorter.UI.ViewModel { public class IoViewModel2LP : UIViewModelBase { public ObservableCollection Card1DiList { get; set; } public ObservableCollection Card2DoList { get; set; } public ObservableCollection Card3DiList { get; set; } public ObservableCollection Card4DoList { get; set; } public ObservableCollection IOAiList { get; set; } public ObservableCollection IOAoList { get; set; } private List _di1; [Subscription("System.dio000.DIList")] public List DiListData1 { get { return _di1; } set { _di1 = value; Application.Current.Dispatcher.Invoke(new Action(() => { Card1DiList.Clear(); _di1.ForEach(x => { if (x.Provider.ToLower() == "system.dio000") Card1DiList.Add(x); }); })); } } private List _do2; [Subscription("System.dio001.DOList")] public List DoListData2 { get { return _do2; } set { _do2 = value; Application.Current.Dispatcher.Invoke(new Action(() => { Card2DoList.Clear(); _do2.ForEach(x => { if (x.Provider.ToLower() == "system.dio001") Card2DoList.Add(x); }); })); } } private List _di3; [Subscription("System.dio002.DIList")] public List DiListData3 { get { return _di3; } set { _di3 = value; Application.Current.Dispatcher.Invoke(new Action(() => { Card3DiList.Clear(); _di3.ForEach(x => { if (x.Provider.ToLower() == "system.dio002") Card3DiList.Add(x); }); })); } } private List _do4; [Subscription("System.dio003.DOList")] public List DoListData4 { get { return _do4; } set { _do4 = value; Application.Current.Dispatcher.Invoke(new Action(() => { Card4DoList.Clear(); _do4.ForEach(x => { if (x.Provider.ToLower() == "system.dio003") Card4DoList.Add(x); }); })); } } private List _ai; [Subscription("System.MotionAxis.AIList")] public List AiListData { get { return _ai; } set { _ai = value; Application.Current.Dispatcher.Invoke(new Action(() => { IOAiList.Clear(); _ai.ForEach(x => { if (x.Provider.ToLower() == "system.motionaxis") IOAiList.Add(x); }); })); } } private List _ao; [Subscription("System.MotionAxis.AOList")] public List AoListData { get { return _ao; } set { _ao = value; Application.Current.Dispatcher.Invoke(new Action(() => { IOAoList.Clear(); _ao.ForEach(x => { if (x.Provider.ToLower() == "system.motionaxis") IOAoList.Add(x); }); })); } } public ICommand SetDoCommand { get; set; } public IoViewModel2LP() : base("IoViewModel2LP") { Card1DiList = new ObservableCollection(); Card2DoList = new ObservableCollection(); Card3DiList = new ObservableCollection(); Card4DoList = new ObservableCollection(); IOAiList = new ObservableCollection(); IOAoList = new ObservableCollection(); SetDoCommand = new DelegateCommand(PerformSetDo); } private void PerformSetDo(string ioName) { } private void SetDo() { } protected override void InvokeBeforeUpdateProperty(Dictionary data) { //data[UIKey(UnitName.System.ToString(), ParamName.WaferInfoRobotAligner01)] = new WaferInfo("dummy", WaferStatus.Normal); } } }