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 carrierList; public ObservableCollection 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(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 itemlist = new ObservableCollection(); if (CarrierConfigurationList != null) { foreach (var config in CarrierConfigurationList) { itemlist.Add($"Index{config.Index}:{config.CarrierName}{(config.EnableCarrier ? "✔" : "")}"); } CarrierList = itemlist; } } } }