| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 | using Aitex.Core.Common;using Aitex.Core.RT.DataCenter;using Aitex.Core.UI.MVVM;using Aitex.Core.Util;using Aitex.Core.Utilities;using Aitex.Sorter.Common;using Aitex.Sorter.UI.Controls;using Aitex.Sorter.UI.ViewModel;using Aitex.Sorter.UI.Views;using MECF.Framework.Common.CommonData.SorterDefines;using MECF.Framework.Common.DataCenter;using MECF.Framework.Common.Equipment;using MECF.Framework.Common.OperationCenter;using System;using System.Collections.Generic;using System.Collections.ObjectModel;using System.Linq;using System.Text;using System.Threading;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Input;namespace EfemUI.ViewModels{    public class CarrierListViewModel : UIViewModelBase    {        //[Subscription("CarrierConfigurationList")]        public CarrierConfigurationItem[] CarrierConfigurationList { get; set; }        private ObservableCollection<string> carrierList;        public ObservableCollection<string> CarrierList        {            get            {                return carrierList;            }            set            {                carrierList = value;                InvokePropertyChanged("CarrierList");            }        }        private CarrierConfigurationItem _currentCarrier;        public CarrierConfigurationItem CurrentCarrier        {            get            {                return _currentCarrier;            }            set            {                _currentCarrier = value;                InvokePropertyChanged("CurrentCarrier");            }        }        private int _selectedIndex;        public int SelectedIndex        {            get => _selectedIndex;            set            {                _selectedIndex = value;                InvokePropertyChanged("SelectedIndex");                if(_selectedIndex!=-1)                CurrentCarrier = CarrierConfigurationList[_selectedIndex];            }        }        public ICommand CarrierCommand { get; set; }        public CarrierListViewModel() : base("CarrierList")        {            CarrierCommand = new DelegateCommand<string>(DoCarrierCommand);        }        private void DoCarrierCommand(string cmd)        {            switch (cmd)            {                case "Save":                    InvokeClient.Instance.Service.DoOperation($"SetCarrierConfigurationItem",                        new object[] {                            CurrentCarrier.Index,                            CurrentCarrier.CarrierName,                            CurrentCarrier.CarrierWaferSize,                            CurrentCarrier.CarrierSlotsNumber,                            CurrentCarrier.IsInfoPadAOn,                            CurrentCarrier.IsInfoPadBOn,                            CurrentCarrier.IsInfoPadCOn,                            CurrentCarrier.IsInfoPadDOn,                            CurrentCarrier.LP1StationName,                            CurrentCarrier.LP2StationName,                            CurrentCarrier.LP3StationName,                            CurrentCarrier.LP4StationName,                            CurrentCarrier.LP5StationName,                            CurrentCarrier.LP6StationName,                            CurrentCarrier.LP7StationName,                            CurrentCarrier.LP8StationName,                            CurrentCarrier.GetOffset,                            CurrentCarrier.PutOffset,                            CurrentCarrier.CIDReaderIndex,                            CurrentCarrier.CarrierFosbMode,                            CurrentCarrier.NeedCheckIronDoorCarrier,                            CurrentCarrier.KeepClampedAfterUnloadCarrier,                            CurrentCarrier.DisableEvenSlot,                            CurrentCarrier.DisableOddSlot,                            CurrentCarrier.ThicknessLowLimit,                            CurrentCarrier.ThicknessHighLimit,                            CurrentCarrier.SlotPositionBaseLine,                            CurrentCarrier.SlotPitch,                            CurrentCarrier.WaferCenterDeviationLimit,                            CurrentCarrier.EnableDualTransfer,                            CurrentCarrier.ForbidAccessAboveWafer,                            CurrentCarrier.MappedByRobot,                            CurrentCarrier.EnableCarrier,                        });                    break;            }            Refresh();        }        internal void Refresh()        {            CarrierConfigurationList = (CarrierConfigurationItem[])QueryDataClient.Instance.Service.GetData("CarrierConfigurationList");            ObservableCollection<string> itemlist = new ObservableCollection<string>();            if (CarrierConfigurationList != null)            {                foreach (var config in CarrierConfigurationList)                {                    itemlist.Add($"Index{config.Index}:{config.CarrierName}{(config.EnableCarrier ? "✔" : "")}");                }                CarrierList = itemlist;            }        }    }}
 |