123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- 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 MECF.Framework.Common.IOCore;
- using Xceed.Wpf.Toolkit;
- namespace Aitex.Sorter.UI.ViewModel
- {
- public class IoViewModel : UIViewModelBase
- {
- public ObservableCollection<NotifiableIoItem> Card1DiList { get; set; }
- public ObservableCollection<NotifiableIoItem> Card2DiList { get; set; }
- public ObservableCollection<NotifiableIoItem> Card1DoList { get; set; }
- public ObservableCollection<NotifiableIoItem> Card2DoList { get; set; }
- private List<NotifiableIoItem> _di;
- [Subscription("DI", SystemStateModule)]
- public List<NotifiableIoItem> DiListData
- {
- get
- {
- return _di;
- }
- set
- {
-
- _di = value;
-
- Application.Current.Dispatcher.Invoke(new Action(() =>
- {
- Card1DiList.Clear();
- Card2DiList.Clear();
- _di.ForEach(x=>
- {
- if (x.Provider.ToLower()=="system.dio000")
- Card1DiList.Add(x);
- if (x.Provider.ToLower() == "system.dio001")
- Card2DiList.Add(x);
- });
- }));
-
- }
- }
- private List<NotifiableIoItem> _do;
- [Subscription("DO", SystemStateModule)]
- public List<NotifiableIoItem> DoListData
- {
- get
- {
- return _do;
- }
- set
- {
-
- _do = value;
- Application.Current.Dispatcher.Invoke(new Action(() =>
- {
- Card1DoList.Clear();
- Card2DoList.Clear();
- _do.ForEach(x=>
- {
- if (x.Provider.ToLower()== "system.dio000")
- Card1DoList.Add(x);
- if (x.Provider.ToLower() == "system.dio001")
- Card2DoList.Add(x);
- });
- }));
-
- }
- }
- public ICommand SetDoCommand
- {
- get; set;
- }
- public IoViewModel() : base("IoViewModel")
- {
- Card1DiList = new ObservableCollection<NotifiableIoItem>();
- Card2DiList = new ObservableCollection<NotifiableIoItem>();
- Card1DoList = new ObservableCollection<NotifiableIoItem>();
- Card2DoList = new ObservableCollection<NotifiableIoItem>();
- SetDoCommand = new DelegateCommand<string>(PerformSetDo);
- }
- private void PerformSetDo(string ioName)
- {
-
- }
- protected override void InvokeBeforeUpdateProperty(Dictionary<string, object> data)
- {
-
- //data[UIKey(UnitName.System.ToString(), ParamName.WaferInfoRobotAligner01)] = new WaferInfo("dummy", WaferStatus.Normal);
- }
- }
- }
|