| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 | using System.Collections.Generic;using System.Collections.ObjectModel;using System.Windows;using System.Windows.Input;using Aitex.Core.UI.MVVM;using Aitex.Core.Util;using Aitex.Sorter.UI.ViewModel;using MECF.Framework.Common.IOCore;namespace EfemUI.ViewModels{    public class IoViewModelRSW : UIViewModelBase    {        private List<NotifiableIoItem> _di1;        private List<NotifiableIoItem> _do2;        private List<NotifiableIoItem> _di3;        private List<NotifiableIoItem> _do4;        private List<NotifiableIoItem> _plcDi;        private List<NotifiableIoItem> _plcDo;                private List<NotifiableIoItem> _ai5;        private List<NotifiableIoItem> _ai6;        private List<NotifiableIoItem> _ai7;        private List<NotifiableIoItem> _motionAi;        private List<NotifiableIoItem> _motionAo;                public IoViewModelRSW() : base("IoViewModelRSW")        {            Card1DiList = new ObservableCollection<NotifiableIoItem>();            Card2DoList = new ObservableCollection<NotifiableIoItem>();            Card3DiList = new ObservableCollection<NotifiableIoItem>();            Card4DoList = new ObservableCollection<NotifiableIoItem>();            PlcDiList = new ObservableCollection<NotifiableIoItem>();            PlcDoList = new ObservableCollection<NotifiableIoItem>();            Card5AiList = new ObservableCollection<NotifiableIoItem>();            Card6AiList = new ObservableCollection<NotifiableIoItem>();            Card7AiList = new ObservableCollection<NotifiableIoItem>();                        MotionAiList = new ObservableCollection<NotifiableIoItem>();            MotionAoList = new ObservableCollection<NotifiableIoItem>();            SetDoCommand = new DelegateCommand<string>(PerformSetDo);        }        public ObservableCollection<NotifiableIoItem> Card1DiList { get; set; }        public ObservableCollection<NotifiableIoItem> Card2DoList { get; set; }        public ObservableCollection<NotifiableIoItem> Card3DiList { get; set; }        public ObservableCollection<NotifiableIoItem> Card4DoList { get; set; }        public ObservableCollection<NotifiableIoItem> Card5AiList { get; set; }        public ObservableCollection<NotifiableIoItem> Card6AiList { get; set; }        public ObservableCollection<NotifiableIoItem> Card7AiList { get; set; }        public ObservableCollection<NotifiableIoItem> MotionAiList { get; set; }        public ObservableCollection<NotifiableIoItem> MotionAoList { get; set; }        public ObservableCollection<NotifiableIoItem> PlcDiList { get; set; }        public ObservableCollection<NotifiableIoItem> PlcDoList { get; set; }        [Subscription("System.dio000.DIList")]        public List<NotifiableIoItem> DiListData1        {            get => _di1;            set            {                _di1 = value;                Application.Current.Dispatcher.Invoke(() =>                {                    Card1DiList.Clear();                    _di1.ForEach(x =>                    {                        if (x.Provider.ToLower() == "system.dio000")                            Card1DiList.Add(x);                    });                });            }        }        [Subscription("System.dio001.DOList")]        public List<NotifiableIoItem> DoListData2        {            get => _do2;            set            {                _do2 = value;                Application.Current.Dispatcher.Invoke(() =>                {                    Card2DoList.Clear();                    _do2.ForEach(x =>                    {                        if (x.Provider.ToLower() == "system.dio001")                            Card2DoList.Add(x);                    });                });            }        }        [Subscription("System.dio002.DIList")]        public List<NotifiableIoItem> DiListData3        {            get => _di3;            set            {                _di3 = value;                Application.Current.Dispatcher.Invoke(() =>                {                    Card3DiList.Clear();                    _di3.ForEach(x =>                    {                        if (x.Provider.ToLower() == "system.dio002")                            Card3DiList.Add(x);                    });                });            }        }        [Subscription("System.dio003.DOList")]        public List<NotifiableIoItem> DoListData4        {            get => _do4;            set            {                _do4 = value;                Application.Current.Dispatcher.Invoke(() =>                {                    Card4DoList.Clear();                    _do4.ForEach(x =>                    {                        if (x.Provider.ToLower() == "system.dio003")                            Card4DoList.Add(x);                    });                });            }        }                [Subscription("System.dio004.AIList")]        public List<NotifiableIoItem> AiListData5        {            get => _ai5;            set            {                _ai5 = value;                Application.Current.Dispatcher.Invoke(() =>                {                    Card5AiList.Clear();                    _ai5.ForEach(x =>                    {                        if (x.Provider.ToLower() == "system.dio004")                            Card5AiList.Add(x);                    });                });            }        }                [Subscription("System.dio005.AIList")]        public List<NotifiableIoItem> AiListData6        {            get => _ai6;            set            {                _ai6 = value;                Application.Current.Dispatcher.Invoke(() =>                {                    Card6AiList.Clear();                    _ai6.ForEach(x =>                    {                        if (x.Provider.ToLower() == "system.dio005")                            Card6AiList.Add(x);                    });                });            }        }                [Subscription("System.dio006.AIList")]        public List<NotifiableIoItem> AiListData7        {            get => _ai7;            set            {                _ai7 = value;                Application.Current.Dispatcher.Invoke(() =>                {                    Card7AiList.Clear();                    _ai7.ForEach(x =>                    {                        if (x.Provider.ToLower() == "system.dio006")                            Card7AiList.Add(x);                    });                });            }        }        [Subscription("System.MotionAxis.AIList")]        public List<NotifiableIoItem> AiListData        {            get => _motionAi;            set            {                _motionAi = value;                Application.Current.Dispatcher.Invoke(() =>                {                    MotionAiList.Clear();                    _motionAi.ForEach(x =>                    {                        if (x.Provider.ToLower() == "system.motionaxis")                            MotionAiList.Add(x);                    });                });            }        }        [Subscription("System.MotionAxis.AOList")]        public List<NotifiableIoItem> AoListData        {            get => _motionAo;            set            {                _motionAo = value;                Application.Current.Dispatcher.Invoke(() =>                {                    MotionAoList.Clear();                    _motionAo.ForEach(x =>                    {                        if (x.Provider.ToLower() == "system.motionaxis")                            MotionAoList.Add(x);                    });                });            }        }        [Subscription("System.MainPlc.DIList")]        public List<NotifiableIoItem> DiListData9        {            get => _plcDi;            set            {                _plcDi = value;                Application.Current.Dispatcher.Invoke(() =>                {                    PlcDiList.Clear();                    _plcDi.ForEach(x =>                    {                        if (x.Provider.ToLower() == "system.mainplc")                            PlcDiList.Add(x);                    });                });            }        }                [Subscription("System.MainPlc.DOList")]        public List<NotifiableIoItem> DoListData10        {            get => _plcDo;            set            {                _plcDo = value;                Application.Current.Dispatcher.Invoke(() =>                {                    PlcDoList.Clear();                    _plcDo.ForEach(x =>                    {                        if (x.Provider.ToLower() == "system.mainplc")                            PlcDoList.Add(x);                    });                });            }        }                public ICommand SetDoCommand { get; set; }        private void PerformSetDo(string ioName)        {        }        private void SetDo()        {        }        protected override void InvokeBeforeUpdateProperty(Dictionary<string, object> data)        {            //data[UIKey(UnitName.System.ToString(), ParamName.WaferInfoRobotAligner01)] = new WaferInfo("dummy", WaferStatus.Normal);        }    }}
 |