|
@@ -0,0 +1,938 @@
|
|
|
+using Aitex.Sorter.Common;
|
|
|
+using MECF.Framework.Common.CommonData;
|
|
|
+using MECF.Framework.Common.DataCenter;
|
|
|
+using MECF.Framework.Common.Equipment;
|
|
|
+using MECF.Framework.Common.OperationCenter;
|
|
|
+using MECF.Framework.Common.Schedulers;
|
|
|
+using OpenSEMI.ClientBase;
|
|
|
+using OpenSEMI.Ctrlib.Controls;
|
|
|
+using Prism.Commands;
|
|
|
+using Prism.Mvvm;
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Collections.ObjectModel;
|
|
|
+using System.Linq;
|
|
|
+using System.Text;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using System.Windows.Threading;
|
|
|
+using Venus_Core;
|
|
|
+using Venus_MainPages.Unity;
|
|
|
+using Venus_Themes.CustomControls;
|
|
|
+using static Venus_Themes.CustomControls.SERobot;
|
|
|
+
|
|
|
+namespace Venus_MainPages.ViewModels
|
|
|
+{
|
|
|
+ public class VenusDETMViewModel : BindableBase
|
|
|
+ {
|
|
|
+ #region 私有字段
|
|
|
+ public double m_VPAangle;
|
|
|
+
|
|
|
+ private ModuleInfo m_VCEModuleInfo;
|
|
|
+ private ModuleInfo m_VPAModuleInfo;
|
|
|
+ private ModuleInfo m_TMModuleInfo;
|
|
|
+
|
|
|
+ //Wafer
|
|
|
+ private WaferInfo m_PMAWafer;
|
|
|
+ private WaferInfo m_PMBWafer;
|
|
|
+ private WaferInfo m_PMCWafer;
|
|
|
+ public WaferInfo m_RobotUpperWafer;
|
|
|
+ public WaferInfo m_RobotLowerWafer;
|
|
|
+ public WaferInfo m_PAWafer;
|
|
|
+
|
|
|
+ //Door
|
|
|
+ private bool m_PMADoorIsOpen;
|
|
|
+ private bool m_PMBDoorIsOpen;
|
|
|
+ private bool m_PMCDoorIsOpen;
|
|
|
+ private bool m_VCEDoorIsOpen;
|
|
|
+ private bool m_VCEOutDoorIsOpen;
|
|
|
+
|
|
|
+ //Pick、Place、Extend、Retract行下拉框内容
|
|
|
+ private SeTMModule m_PickSelectedModule;
|
|
|
+ private SeTMModule m_PlaceSelectedModule;
|
|
|
+ private SeTMModule m_ExtendSelectedModule;
|
|
|
+ private SeTMModule m_RetractSelectedModule;
|
|
|
+ private SeTMModule m_GotoSelectedModule;
|
|
|
+ private SeTMBlade m_PickSelectedBlade;
|
|
|
+ private SeTMBlade m_PlaceSelectedBlade;
|
|
|
+ private SeTMBlade m_ExtendSelectedBlade;
|
|
|
+ private SeTMBlade m_RetractSelectedBlade;
|
|
|
+ private SeTMBlade m_GoToSelectedBlade;
|
|
|
+
|
|
|
+
|
|
|
+ //Pick、Place、Extend、Retract行下拉框关联
|
|
|
+ private ObservableCollection<int> m_PickSoltItemsSource = new ObservableCollection<int>();
|
|
|
+ private ObservableCollection<int> m_PlaceSoltItemsSource = new ObservableCollection<int>();
|
|
|
+ private ObservableCollection<int> m_ExtendSoltItemsSource = new ObservableCollection<int>();
|
|
|
+ private ObservableCollection<int> m_RetractSoltItemsSource = new ObservableCollection<int>();
|
|
|
+ private int m_PickSoltSelectedIndex;
|
|
|
+ private int m_PlaceSoltSelectedIndex;
|
|
|
+ private int m_ExtendSoltSelectedIndex;
|
|
|
+ private int m_RetractSoltSelectedIndex;
|
|
|
+
|
|
|
+
|
|
|
+ //下拉框内容
|
|
|
+ private List<SeTMModule> m_TMModules = new List<SeTMModule>();
|
|
|
+
|
|
|
+ private bool m_PMAIsInstalled;
|
|
|
+ private bool m_PMBIsInstalled;
|
|
|
+ private bool m_PMCIsInstalled;
|
|
|
+ private bool m_VCEIsInstalled;
|
|
|
+ private bool m_VPAIsInstalled;
|
|
|
+ private Dictionary<string, object> m_RtDataValues = new Dictionary<string, object>();
|
|
|
+ private List<string> m_RtDataKeys = new List<string>();
|
|
|
+
|
|
|
+ //Robot动画
|
|
|
+ private SERobotTAction m_SERobotTAction;
|
|
|
+ private SERobotTAction m_Robot1TAction;
|
|
|
+ private SERobotXAction m_Robot1XAction;
|
|
|
+ private SERobotTAction m_Robot2TAction;
|
|
|
+ private SERobotXAction m_Robot2XAction;
|
|
|
+ public RobotMoveInfo m_robotMoveInfo;
|
|
|
+ //Cycle
|
|
|
+ private List<string> m_OriginalCycle = new List<string>();
|
|
|
+ private List<string> m_ToCycle = new List<string>();
|
|
|
+ private bool m_CycleEnable;
|
|
|
+
|
|
|
+ private bool m_PMAIsCycle;
|
|
|
+ private bool m_PMBIsCycle;
|
|
|
+ private bool m_PMCIsCycle;
|
|
|
+
|
|
|
+ private int m_CycleCount;
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 属性
|
|
|
+ public double VPAangle
|
|
|
+ {
|
|
|
+ get { return m_VPAangle; }
|
|
|
+ set { SetProperty(ref m_VPAangle, value); }
|
|
|
+ }
|
|
|
+ public WaferInfo PMAWafer
|
|
|
+ {
|
|
|
+ get { return m_PMAWafer; }
|
|
|
+ set { SetProperty(ref m_PMAWafer, value); }
|
|
|
+ }
|
|
|
+ public WaferInfo PMBWafer
|
|
|
+ {
|
|
|
+ get { return m_PMBWafer; }
|
|
|
+ set { SetProperty(ref m_PMBWafer, value); }
|
|
|
+ }
|
|
|
+ public WaferInfo PMCWafer
|
|
|
+ {
|
|
|
+ get { return m_PMCWafer; }
|
|
|
+ set { SetProperty(ref m_PMCWafer, value); }
|
|
|
+ }
|
|
|
+ public WaferInfo RobotUpperWafer
|
|
|
+ {
|
|
|
+ get { return m_RobotUpperWafer; }
|
|
|
+ set { SetProperty(ref m_RobotUpperWafer, value); }
|
|
|
+ }
|
|
|
+
|
|
|
+ public WaferInfo RobotLowerWafer
|
|
|
+ {
|
|
|
+ get { return m_RobotLowerWafer; }
|
|
|
+ set { SetProperty(ref m_RobotLowerWafer, value); }
|
|
|
+ }
|
|
|
+ public WaferInfo PAWafer
|
|
|
+ {
|
|
|
+ get { return m_PAWafer; }
|
|
|
+ set { SetProperty(ref m_PAWafer, value); }
|
|
|
+ }
|
|
|
+ public bool VCEDoorIsOpen { get => m_VCEDoorIsOpen; set => SetProperty(ref m_VCEDoorIsOpen, value); }
|
|
|
+ public bool VCEOutDoorIsOpen { get => m_VCEOutDoorIsOpen; set => SetProperty(ref m_VCEOutDoorIsOpen, value); }
|
|
|
+
|
|
|
+
|
|
|
+ public bool PMCDoorIsOpen
|
|
|
+ {
|
|
|
+ get => m_PMCDoorIsOpen;
|
|
|
+ set
|
|
|
+ {
|
|
|
+ SetProperty(ref m_PMCDoorIsOpen, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public bool PMADoorIsOpen
|
|
|
+ {
|
|
|
+ get { return m_PMADoorIsOpen; }
|
|
|
+ set { SetProperty(ref m_PMADoorIsOpen, value); }
|
|
|
+ }
|
|
|
+ public bool PMBDoorIsOpen
|
|
|
+ {
|
|
|
+ get { return m_PMBDoorIsOpen; }
|
|
|
+ set { SetProperty(ref m_PMBDoorIsOpen, value); }
|
|
|
+ }
|
|
|
+ public ModuleInfo VCEModuleInfo
|
|
|
+ {
|
|
|
+ get { return m_VCEModuleInfo; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ SetProperty(ref m_VCEModuleInfo, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ public ModuleInfo VPAModuleInfo
|
|
|
+ {
|
|
|
+ get { return m_VPAModuleInfo; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ SetProperty(ref m_VPAModuleInfo, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ public Dictionary<string, object> RtDataValues
|
|
|
+ {
|
|
|
+ get { return m_RtDataValues; }
|
|
|
+ set { SetProperty(ref m_RtDataValues, value); }
|
|
|
+ }
|
|
|
+
|
|
|
+ public bool PMAIsInstalled
|
|
|
+ {
|
|
|
+ get { return m_PMAIsInstalled; }
|
|
|
+ set { SetProperty(ref m_PMAIsInstalled, value); }
|
|
|
+ }
|
|
|
+ public bool PMBIsInstalled
|
|
|
+ {
|
|
|
+ get { return m_PMBIsInstalled; }
|
|
|
+ set { SetProperty(ref m_PMBIsInstalled, value); }
|
|
|
+ }
|
|
|
+ public bool PMCIsInstalled
|
|
|
+ {
|
|
|
+ get { return m_PMCIsInstalled; }
|
|
|
+ set { SetProperty(ref m_PMCIsInstalled, value); }
|
|
|
+ }
|
|
|
+ public bool VCEIsInstalled
|
|
|
+ {
|
|
|
+ get { return m_VCEIsInstalled; }
|
|
|
+ set { SetProperty(ref m_VCEIsInstalled, value); }
|
|
|
+ }
|
|
|
+ public bool VPAIsInstalled
|
|
|
+ {
|
|
|
+ get { return m_VPAIsInstalled; }
|
|
|
+ set { SetProperty(ref m_VPAIsInstalled, value); }
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<SeTMModule> TMModules
|
|
|
+ {
|
|
|
+ get { return m_TMModules; }
|
|
|
+ set { SetProperty(ref m_TMModules, value); }
|
|
|
+ }
|
|
|
+
|
|
|
+ //Module属性
|
|
|
+ public SeTMModule PickSelectedModule
|
|
|
+ {
|
|
|
+ get { return m_PickSelectedModule; }
|
|
|
+ set { SetProperty(ref m_PickSelectedModule, value); }
|
|
|
+ }
|
|
|
+ public SeTMModule PlaceSelectedModule
|
|
|
+ {
|
|
|
+ get { return m_PlaceSelectedModule; }
|
|
|
+ set { SetProperty(ref m_PlaceSelectedModule, value); }
|
|
|
+ }
|
|
|
+ public SeTMModule ExtendSelectedModule
|
|
|
+ {
|
|
|
+ get { return m_ExtendSelectedModule; }
|
|
|
+ set { SetProperty(ref m_ExtendSelectedModule, value); }
|
|
|
+ }
|
|
|
+ public SeTMModule RetractSelectedModule
|
|
|
+ {
|
|
|
+ get { return m_RetractSelectedModule; }
|
|
|
+ set { SetProperty(ref m_RetractSelectedModule, value); }
|
|
|
+ }
|
|
|
+ public SeTMModule GotoSelectedModule
|
|
|
+ {
|
|
|
+ get { return m_GotoSelectedModule; }
|
|
|
+ set { SetProperty(ref m_GotoSelectedModule, value); }
|
|
|
+ }
|
|
|
+ public ModuleInfo TMModuleInfo
|
|
|
+ {
|
|
|
+ get { return m_TMModuleInfo; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ SetProperty(ref m_TMModuleInfo, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //Blade属性
|
|
|
+ public SeTMBlade PickSelectedBlade
|
|
|
+ {
|
|
|
+ get { return m_PickSelectedBlade; }
|
|
|
+ set { SetProperty(ref m_PickSelectedBlade, value); }
|
|
|
+ }
|
|
|
+ public SeTMBlade PlaceSelectedBlade
|
|
|
+ {
|
|
|
+ get { return m_PlaceSelectedBlade; }
|
|
|
+ set { SetProperty(ref m_PlaceSelectedBlade, value); }
|
|
|
+ }
|
|
|
+ public SeTMBlade ExtendSelectedBlade
|
|
|
+ {
|
|
|
+ get { return m_ExtendSelectedBlade; }
|
|
|
+ set { SetProperty(ref m_ExtendSelectedBlade, value); }
|
|
|
+ }
|
|
|
+ public SeTMBlade RetractSelectedBlade
|
|
|
+ {
|
|
|
+ get { return m_RetractSelectedBlade; }
|
|
|
+ set { SetProperty(ref m_RetractSelectedBlade, value); }
|
|
|
+ }
|
|
|
+ public SeTMBlade GoToSelectedBlade
|
|
|
+ {
|
|
|
+ get { return m_GoToSelectedBlade; }
|
|
|
+ set { SetProperty(ref m_GoToSelectedBlade, value); }
|
|
|
+ }
|
|
|
+
|
|
|
+ public ObservableCollection<int> PickSoltItemsSource
|
|
|
+ {
|
|
|
+ get { return m_PickSoltItemsSource; }
|
|
|
+ set { SetProperty(ref m_PickSoltItemsSource, value); }
|
|
|
+ }
|
|
|
+ public ObservableCollection<int> PlaceSoltItemsSource
|
|
|
+ {
|
|
|
+ get { return m_PlaceSoltItemsSource; }
|
|
|
+ set { SetProperty(ref m_PlaceSoltItemsSource, value); }
|
|
|
+ }
|
|
|
+ public ObservableCollection<int> ExtendSoltItemsSource
|
|
|
+ {
|
|
|
+ get { return m_ExtendSoltItemsSource; }
|
|
|
+ set { SetProperty(ref m_ExtendSoltItemsSource, value); }
|
|
|
+ }
|
|
|
+ public ObservableCollection<int> RetractSoltItemsSource
|
|
|
+ {
|
|
|
+ get { return m_RetractSoltItemsSource; }
|
|
|
+ set { SetProperty(ref m_RetractSoltItemsSource, value); }
|
|
|
+ }
|
|
|
+ public int PickSoltSelectedIndex
|
|
|
+ {
|
|
|
+ get { return m_PickSoltSelectedIndex; }
|
|
|
+ set { SetProperty(ref m_PickSoltSelectedIndex, value); }
|
|
|
+ }
|
|
|
+ public int PlaceSoltSelectedIndex
|
|
|
+ {
|
|
|
+ get { return m_PlaceSoltSelectedIndex; }
|
|
|
+ set { SetProperty(ref m_PlaceSoltSelectedIndex, value); }
|
|
|
+ }
|
|
|
+ public int ExtendSoltSelectedIndex
|
|
|
+ {
|
|
|
+ get { return m_ExtendSoltSelectedIndex; }
|
|
|
+ set { SetProperty(ref m_ExtendSoltSelectedIndex, value); }
|
|
|
+ }
|
|
|
+ public int RetractSoltSelectedIndex
|
|
|
+ {
|
|
|
+ get { return m_RetractSoltSelectedIndex; }
|
|
|
+ set { SetProperty(ref m_RetractSoltSelectedIndex, value); }
|
|
|
+ }
|
|
|
+ //Robot动作
|
|
|
+ public SERobotTAction SERobotTAction
|
|
|
+ {
|
|
|
+ get { return m_SERobotTAction; }
|
|
|
+ set { SetProperty(ref m_SERobotTAction, value); }
|
|
|
+ }
|
|
|
+ public SERobotTAction Robot1TAction
|
|
|
+ {
|
|
|
+ get { return m_Robot1TAction; }
|
|
|
+ set { SetProperty(ref m_Robot1TAction, value); }
|
|
|
+ }
|
|
|
+ public SERobotXAction Robot1XAction
|
|
|
+ {
|
|
|
+ get { return m_Robot1XAction; }
|
|
|
+ set { SetProperty(ref m_Robot1XAction, value); }
|
|
|
+ }
|
|
|
+ public SERobotTAction Robot2TAction
|
|
|
+ {
|
|
|
+ get { return m_Robot2TAction; }
|
|
|
+ set { SetProperty(ref m_Robot2TAction, value); }
|
|
|
+ }
|
|
|
+ public SERobotXAction Robot2XAction
|
|
|
+ {
|
|
|
+ get { return m_Robot2XAction; }
|
|
|
+ set { SetProperty(ref m_Robot2XAction, value); }
|
|
|
+ }
|
|
|
+ public RobotMoveInfo RobotMoveInfo
|
|
|
+ {
|
|
|
+ get { return m_robotMoveInfo; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ RobotMoveInfoChanged(m_robotMoveInfo, value);
|
|
|
+ m_robotMoveInfo = value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //Cycle
|
|
|
+ public List<string> OriginalCycle
|
|
|
+ {
|
|
|
+ get { return m_OriginalCycle; }
|
|
|
+ set { SetProperty(ref m_OriginalCycle, value); }
|
|
|
+ }
|
|
|
+ public List<string> ToCycle
|
|
|
+ {
|
|
|
+ get { return m_ToCycle; }
|
|
|
+ set { SetProperty(ref m_ToCycle, value); }
|
|
|
+ }
|
|
|
+ public bool CycleEnable
|
|
|
+ {
|
|
|
+ get { return m_CycleEnable; }
|
|
|
+ set { SetProperty(ref m_CycleEnable, value); }
|
|
|
+ }
|
|
|
+ public bool PMAIsCycle
|
|
|
+ {
|
|
|
+ get { return m_PMAIsCycle; }
|
|
|
+ set { SetProperty(ref m_PMAIsCycle, value); }
|
|
|
+ }
|
|
|
+ public bool PMBIsCycle
|
|
|
+ {
|
|
|
+ get { return m_PMBIsCycle; }
|
|
|
+ set { SetProperty(ref m_PMBIsCycle, value); }
|
|
|
+ }
|
|
|
+ public bool PMCIsCycle
|
|
|
+ {
|
|
|
+ get { return m_PMCIsCycle; }
|
|
|
+ set { SetProperty(ref m_PMCIsCycle, value); }
|
|
|
+ }
|
|
|
+ public int CycleCount
|
|
|
+ {
|
|
|
+ get { return m_CycleCount; }
|
|
|
+ set { SetProperty(ref m_CycleCount, value); }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 命令
|
|
|
+ //模块下拉框选择命令
|
|
|
+ private DelegateCommand<object> _ModuleChangeCommand;
|
|
|
+ public DelegateCommand<object> ModuleChangeCommand =>
|
|
|
+ _ModuleChangeCommand ?? (_ModuleChangeCommand = new DelegateCommand<object>(OnModuleChange));
|
|
|
+ //Pick按钮命令
|
|
|
+ private DelegateCommand _PickCommand;
|
|
|
+ public DelegateCommand PickCommand =>
|
|
|
+ _PickCommand ?? (_PickCommand = new DelegateCommand(OnPick));
|
|
|
+ //Place按钮命令
|
|
|
+ private DelegateCommand _PlaceCommand;
|
|
|
+ public DelegateCommand PlaceCommand =>
|
|
|
+ _PlaceCommand ?? (_PlaceCommand = new DelegateCommand(OnPlace));
|
|
|
+ //Extend按钮命令
|
|
|
+ private DelegateCommand _ExtendCommand;
|
|
|
+ public DelegateCommand ExtendCommand =>
|
|
|
+ _ExtendCommand ?? (_ExtendCommand = new DelegateCommand(OnExtend));
|
|
|
+ //Retract按钮命令
|
|
|
+ private DelegateCommand _RetractCommand;
|
|
|
+ public DelegateCommand RetractCommand =>
|
|
|
+ _RetractCommand ?? (_RetractCommand = new DelegateCommand(OnRetract));
|
|
|
+ //RobotHome按钮命令
|
|
|
+ public DelegateCommand _RobotHomeCommand;
|
|
|
+ public DelegateCommand RobotHomeCommand =>
|
|
|
+ _RobotHomeCommand ?? (_RobotHomeCommand = new DelegateCommand(OnRobotHome));
|
|
|
+ private DelegateCommand _HomeCommand;
|
|
|
+ public DelegateCommand HomeCommand =>
|
|
|
+ _HomeCommand ?? (_HomeCommand = new DelegateCommand(OnHome));
|
|
|
+ private DelegateCommand _GotoCommand;
|
|
|
+ public DelegateCommand GotoCommand =>
|
|
|
+ _GotoCommand ?? (_GotoCommand = new DelegateCommand(OnGoto));
|
|
|
+ #endregion
|
|
|
+ //Cycle
|
|
|
+ private DelegateCommand _StartCycleCommand;
|
|
|
+ public DelegateCommand StartCycleCommand =>
|
|
|
+ _StartCycleCommand ?? (_StartCycleCommand = new DelegateCommand(OnStartCycle));
|
|
|
+
|
|
|
+ private DelegateCommand _StopCycleCommand;
|
|
|
+
|
|
|
+ public DelegateCommand StopCycleCommand =>
|
|
|
+ _StopCycleCommand ?? (_StopCycleCommand = new DelegateCommand(OnStopCycle));
|
|
|
+
|
|
|
+
|
|
|
+ #region 构造函数
|
|
|
+ public VenusDETMViewModel()
|
|
|
+ {
|
|
|
+ string allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString();
|
|
|
+ PMAIsInstalled = allModules.Contains("PMA");
|
|
|
+ PMBIsInstalled = allModules.Contains("PMB");
|
|
|
+ //PMCIsInstalled = allModules.Contains("PMC");
|
|
|
+ PMCIsInstalled = true;
|
|
|
+ //VCEIsInstalled = allModules.Contains("VCE1");
|
|
|
+ VCEIsInstalled = true;
|
|
|
+ VPAIsInstalled = allModules.Contains("VPA");
|
|
|
+ if (PMAIsInstalled == true)
|
|
|
+ {
|
|
|
+ TMModules.Add(SeTMModule.PMA);
|
|
|
+ }
|
|
|
+ if (PMBIsInstalled == true)
|
|
|
+ {
|
|
|
+ TMModules.Add(SeTMModule.PMB);
|
|
|
+ }
|
|
|
+ if (PMCIsInstalled == true)
|
|
|
+ {
|
|
|
+ TMModules.Add(SeTMModule.PMC);
|
|
|
+ m_VPAangle = 270;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ m_VPAangle = 180;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (VCEIsInstalled == true)
|
|
|
+ {
|
|
|
+ TMModules.Add(SeTMModule.VCE1);
|
|
|
+ }
|
|
|
+ if (VPAIsInstalled == true)
|
|
|
+ {
|
|
|
+ TMModules.Add(SeTMModule.VPA);
|
|
|
+ }
|
|
|
+
|
|
|
+ PickSoltItemsSource.Add(1);
|
|
|
+ PlaceSoltItemsSource.Add(1);
|
|
|
+ ExtendSoltItemsSource.Add(1);
|
|
|
+ RetractSoltItemsSource.Add(1);
|
|
|
+
|
|
|
+
|
|
|
+ addDataKeys();
|
|
|
+ RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
|
|
|
+
|
|
|
+ VCEDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "SETM.VCESlitDoorClosed");
|
|
|
+ PMADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "SETM.PMASlitDoorClosed");
|
|
|
+ PMBDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "SETM.PMBSlitDoorClosed");
|
|
|
+ PMCDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "SETM.PMCSlitDoorClosed");
|
|
|
+ VCEOutDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "VCE1.VCEOutDoorClosed");
|
|
|
+ DispatcherTimer timer = new DispatcherTimer();
|
|
|
+ timer.Interval = TimeSpan.FromSeconds(0.5);
|
|
|
+ timer.Tick += Timer_Tick;
|
|
|
+ timer.Start();
|
|
|
+
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 命令方法
|
|
|
+ private void addDataKeys()
|
|
|
+ {
|
|
|
+ m_RtDataKeys.Add($"SETM.VCESlitDoorClosed");
|
|
|
+ m_RtDataKeys.Add($"SETM.PMASlitDoorClosed");
|
|
|
+ m_RtDataKeys.Add($"SETM.PMBSlitDoorClosed");
|
|
|
+ m_RtDataKeys.Add($"SETM.PMCSlitDoorClosed");
|
|
|
+ m_RtDataKeys.Add($"VCE1.VCEOutDoorClosed");
|
|
|
+ m_RtDataKeys.Add($"PMA.ChamberPressure");
|
|
|
+ m_RtDataKeys.Add($"PMB.ChamberPressure");
|
|
|
+ m_RtDataKeys.Add($"PMC.ChamberPressure");
|
|
|
+ m_RtDataKeys.Add($"SETM.VCEPressure.Value");
|
|
|
+ m_RtDataKeys.Add($"VCE1.CassetteArrive");
|
|
|
+ m_RtDataKeys.Add($"TMCycle.CycleIndex");
|
|
|
+ }
|
|
|
+ //模块选择根据obj选择下拉框内容
|
|
|
+ private void OnModuleChange(object obj)
|
|
|
+ {
|
|
|
+ var value = obj.ToString();
|
|
|
+ switch (value)
|
|
|
+ {
|
|
|
+ case "Pick":
|
|
|
+ PickSoltItemsSource.Clear();
|
|
|
+ if ((int)PickSelectedModule == 3)
|
|
|
+ {
|
|
|
+ for (int i = 1; i <= 25; i++)
|
|
|
+ {
|
|
|
+ PickSoltItemsSource.Add(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ PickSoltItemsSource.Add(1);
|
|
|
+
|
|
|
+ }
|
|
|
+ PickSoltSelectedIndex = 0;
|
|
|
+ break;
|
|
|
+ case "Place":
|
|
|
+ PlaceSoltItemsSource.Clear();
|
|
|
+ if ((int)PlaceSelectedModule == 3)
|
|
|
+ {
|
|
|
+ for (int i = 1; i <= 25; i++)
|
|
|
+ {
|
|
|
+ PlaceSoltItemsSource.Add(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ PlaceSoltItemsSource.Add(1);
|
|
|
+
|
|
|
+ }
|
|
|
+ PlaceSoltSelectedIndex = 0;
|
|
|
+ break;
|
|
|
+ case "Extend":
|
|
|
+ ExtendSoltItemsSource.Clear();
|
|
|
+ if ((int)ExtendSelectedModule == 3)
|
|
|
+ {
|
|
|
+ for (int i = 1; i <= 25; i++)
|
|
|
+ {
|
|
|
+ ExtendSoltItemsSource.Add(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ExtendSoltItemsSource.Add(1);
|
|
|
+
|
|
|
+ }
|
|
|
+ ExtendSoltSelectedIndex = 0;
|
|
|
+ break;
|
|
|
+ case "Retract":
|
|
|
+ RetractSoltItemsSource.Clear();
|
|
|
+ if ((int)RetractSelectedModule == 3)
|
|
|
+ {
|
|
|
+ for (int i = 1; i <= 25; i++)
|
|
|
+ {
|
|
|
+ RetractSoltItemsSource.Add(i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ RetractSoltItemsSource.Add(1);
|
|
|
+
|
|
|
+ }
|
|
|
+ RetractSoltSelectedIndex = 0;
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ private void OnPick()
|
|
|
+ {
|
|
|
+ Queue<MoveItem> moveItems = new Queue<MoveItem>();
|
|
|
+ var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PickSelectedModule.ToString(), true);
|
|
|
+ var selectedHand = (Hand)Enum.Parse(typeof(Hand), PickSelectedBlade.ToString(), true);
|
|
|
+ MoveItem moveItem = new MoveItem(moduleName, PickSoltItemsSource[PickSoltSelectedIndex] - 1, ModuleName.TMRobot, 0, selectedHand);
|
|
|
+ moveItems.Enqueue(moveItem);
|
|
|
+ if ((int)PickSelectedModule < TMModules.Count - 2)
|
|
|
+ {
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"SETM.PMPick", moveItems);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"SETM.Pick", moveItems);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ private void OnPlace()
|
|
|
+ {
|
|
|
+ Queue<MoveItem> moveItems = new Queue<MoveItem>();
|
|
|
+ var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), PlaceSelectedModule.ToString(), true);
|
|
|
+ var selectedHand = (Hand)Enum.Parse(typeof(Hand), PlaceSelectedBlade.ToString(), true);
|
|
|
+ MoveItem moveItem = new MoveItem(ModuleName.TMRobot, 0, moduleName, PlaceSoltItemsSource[PlaceSoltSelectedIndex] - 1, selectedHand);
|
|
|
+ moveItems.Enqueue(moveItem);
|
|
|
+ if ((int)PlaceSelectedModule < TMModules.Count - 2)
|
|
|
+ {
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"SETM.PMPlace", moveItems);
|
|
|
+ }
|
|
|
+ //VCE、VPA
|
|
|
+ else
|
|
|
+ {
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"SETM.Place", moveItems);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private void OnExtend()
|
|
|
+ {
|
|
|
+ var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), ExtendSelectedModule.ToString(), true);
|
|
|
+ var selectedHand = (Hand)Enum.Parse(typeof(Hand), ExtendSelectedBlade.ToString(), true);
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"SETM.Extend", moduleName, ExtendSoltItemsSource[ExtendSoltSelectedIndex] - 1, selectedHand);
|
|
|
+ }
|
|
|
+ private void OnRetract()
|
|
|
+ {
|
|
|
+ //Queue<MoveItem> moveItems = new Queue<MoveItem>();
|
|
|
+ var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), RetractSelectedModule.ToString(), true);
|
|
|
+ var selectedHand = (Hand)Enum.Parse(typeof(Hand), RetractSelectedBlade.ToString(), true);
|
|
|
+ //MoveItem moveItem = new MoveItem(moduleName, RetractSoltItemsSource[PickSoltSelectedIndex] - 1, 0, 0, selectedHand);
|
|
|
+ //moveItems.Enqueue(moveItem);
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"SETM.Retract", moduleName, RetractSoltItemsSource[PlaceSoltSelectedIndex] - 1, selectedHand);
|
|
|
+ }
|
|
|
+ //令选择的模块下发Home指令
|
|
|
+ private void OnRobotHome()
|
|
|
+ {
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"SETM.Home", "TMRobot");
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"SETM.Retract");
|
|
|
+
|
|
|
+ }
|
|
|
+ private void OnHome()
|
|
|
+ {
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"SETM.Home");
|
|
|
+ }
|
|
|
+ private void OnGoto()
|
|
|
+ {
|
|
|
+ var moduleName = (ModuleName)Enum.Parse(typeof(ModuleName), GotoSelectedModule.ToString(), true);
|
|
|
+ var selectedHand = (Hand)Enum.Parse(typeof(Hand), GoToSelectedBlade.ToString(), true);
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"SETM.Goto", moduleName, 0, selectedHand);
|
|
|
+ }
|
|
|
+ //Cycle
|
|
|
+ private void OnStartCycle()
|
|
|
+ {
|
|
|
+ if (CycleEnable == false)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<string> stations = new List<string>();
|
|
|
+ stations.Add("VCE1");
|
|
|
+ stations.Add("VPA");
|
|
|
+ if (PMAIsCycle == true)
|
|
|
+ {
|
|
|
+ stations.Add("PMA");
|
|
|
+ }
|
|
|
+ if (PMBIsCycle == true)
|
|
|
+ {
|
|
|
+ stations.Add("PMB");
|
|
|
+ }
|
|
|
+ if (PMCIsCycle == true)
|
|
|
+ {
|
|
|
+ stations.Add("PMC");
|
|
|
+ }
|
|
|
+ stations.Add("VCE1");
|
|
|
+ InvokeClient.Instance.Service.DoOperation("System.SETMCycle", stations.ToArray(), CycleCount);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void OnStopCycle()
|
|
|
+ {
|
|
|
+
|
|
|
+ InvokeClient.Instance.Service.DoOperation("System.SEAbort");
|
|
|
+
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 私有方法
|
|
|
+ private void Timer_Tick(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ TMModuleInfo = ModuleManager.ModuleInfos["TMRobot"];
|
|
|
+ if (VCEIsInstalled)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (PMAIsInstalled == true)
|
|
|
+ {
|
|
|
+ ModuleInfo PMAModuleInfo = ModuleManager.ModuleInfos["PMA"];
|
|
|
+ PMAWafer = PMAModuleInfo.WaferManager.Wafers[0];
|
|
|
+ }
|
|
|
+ if (PMBIsInstalled == true)
|
|
|
+ {
|
|
|
+ ModuleInfo PMBModuleInfo = ModuleManager.ModuleInfos["PMB"];
|
|
|
+ PMBWafer = PMBModuleInfo.WaferManager.Wafers[0];
|
|
|
+ }
|
|
|
+ if (PMCIsInstalled == true)
|
|
|
+ {
|
|
|
+ ModuleInfo PMCModuleInfo = ModuleManager.ModuleInfos["PMC"];
|
|
|
+ PMCWafer = PMCModuleInfo.WaferManager.Wafers[0];
|
|
|
+ }
|
|
|
+
|
|
|
+ RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
|
|
|
+ VCEDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "SETM.VCESlitDoorClosed");
|
|
|
+ PMADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "SETM.PMASlitDoorClosed");
|
|
|
+ PMBDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "SETM.PMBSlitDoorClosed");
|
|
|
+ PMCDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "SETM.PMCSlitDoorClosed");
|
|
|
+ VCEOutDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "VCE1.VCEOutDoorClosed");
|
|
|
+ RobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("SETM.RobotMoveAction");
|
|
|
+ RobotUpperWafer = TMModuleInfo.WaferManager.Wafers[0];
|
|
|
+ RobotLowerWafer = TMModuleInfo.WaferManager.Wafers[1];
|
|
|
+ PAWafer = ModuleManager.ModuleInfos["VPA"].WaferManager.Wafers[0];
|
|
|
+
|
|
|
+ }
|
|
|
+ private async void RobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
|
|
|
+ {
|
|
|
+ string RobotTarget;
|
|
|
+ if (oldValue == null || newValue == null)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ #region Rotating
|
|
|
+ if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Rotating))
|
|
|
+ {
|
|
|
+ var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
|
|
|
+ if (TMRobotMoveActionBladeTarget != null)
|
|
|
+ {
|
|
|
+ RobotTarget = TMRobotMoveActionBladeTarget.ToString();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var values = RobotTarget.Split('.');
|
|
|
+ var arm = values[0];
|
|
|
+ var module = values[1];
|
|
|
+ if (arm == "ArmA")
|
|
|
+ {
|
|
|
+ var SERobotTAction = (SERobotTAction)Enum.Parse(typeof(SERobotTAction), module, true);
|
|
|
+ if (SERobotTAction != Robot1TAction)
|
|
|
+ {
|
|
|
+ Robot1TAction = SERobotTAction;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (arm == "ArmB")
|
|
|
+ {
|
|
|
+ var SERobotTAction = (SERobotTAction)Enum.Parse(typeof(SERobotTAction), module, true);
|
|
|
+ if (SERobotTAction != Robot2TAction)
|
|
|
+ {
|
|
|
+ Robot2TAction = SERobotTAction;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region VPA、VCE1 Pick、Place
|
|
|
+ else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
|
|
|
+ {
|
|
|
+ var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
|
|
|
+ if (TMRobotMoveActionBladeTarget != null)
|
|
|
+ {
|
|
|
+ RobotTarget = TMRobotMoveActionBladeTarget.ToString();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var values = RobotTarget.Split('.');
|
|
|
+ var arm = values[0];
|
|
|
+ var module = values[1];
|
|
|
+ //if (module == "VPA")
|
|
|
+ //{
|
|
|
+ // module = PMCIsInstalled ? "VPA" : "VPARight";
|
|
|
+ //}
|
|
|
+ if (arm == "ArmA")
|
|
|
+ {
|
|
|
+ var SERobotTAction = (SERobotTAction)Enum.Parse(typeof(SERobotTAction), module, true);
|
|
|
+ if (SERobotTAction != Robot1TAction)
|
|
|
+ {
|
|
|
+ Robot1TAction = SERobotTAction;
|
|
|
+ }
|
|
|
+ await Task.Delay(600);
|
|
|
+
|
|
|
+ if (module == "VCE1")
|
|
|
+ {
|
|
|
+ Robot1XAction = SERobotXAction.ToVCE;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Robot1XAction = SERobotXAction.Extend;
|
|
|
+ }
|
|
|
+ while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0].WaferStatus == 0))
|
|
|
+ {
|
|
|
+ await Task.Delay(100);
|
|
|
+ }
|
|
|
+ Robot1XAction = SERobotXAction.Retract;
|
|
|
+ }
|
|
|
+ else if (arm == "ArmB")
|
|
|
+ {
|
|
|
+ var SERobotTAction = (SERobotTAction)Enum.Parse(typeof(SERobotTAction), module, true);
|
|
|
+ if (SERobotTAction != Robot2TAction)
|
|
|
+ {
|
|
|
+ Robot2TAction = SERobotTAction;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //await Task.Delay(100);
|
|
|
+ }
|
|
|
+ await Task.Delay(600);
|
|
|
+ if (module == "VCE1")
|
|
|
+ {
|
|
|
+ Robot2XAction = SERobotXAction.ToVCE2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Robot2XAction = SERobotXAction.Extend2;
|
|
|
+ }
|
|
|
+ while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1].WaferStatus == 0))
|
|
|
+ {
|
|
|
+ await Task.Delay(100);
|
|
|
+ }
|
|
|
+ Robot2XAction = SERobotXAction.Retract2;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region PM pick、PM place
|
|
|
+ else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Extending)
|
|
|
+ {
|
|
|
+ var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
|
|
|
+ if (TMRobotMoveActionBladeTarget != null)
|
|
|
+ {
|
|
|
+ RobotTarget = TMRobotMoveActionBladeTarget.ToString();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var values = RobotTarget.Split('.');
|
|
|
+ var arm = values[0];
|
|
|
+ var module = values[1];
|
|
|
+ if (arm == "ArmA")
|
|
|
+ {
|
|
|
+ var SERobotTAction = (SERobotTAction)Enum.Parse(typeof(SERobotTAction), module, true);
|
|
|
+ if (SERobotTAction != Robot1TAction)
|
|
|
+ {
|
|
|
+ Robot1TAction = SERobotTAction;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // await Task.Delay(100);
|
|
|
+ }
|
|
|
+ await Task.Delay(600);
|
|
|
+
|
|
|
+ Robot1XAction = SERobotXAction.Extend;
|
|
|
+ }
|
|
|
+ else if (arm == "ArmB")
|
|
|
+ {
|
|
|
+ var SERobotTAction = (SERobotTAction)Enum.Parse(typeof(SERobotTAction), module, true);
|
|
|
+ if (SERobotTAction != Robot2TAction)
|
|
|
+ {
|
|
|
+ Robot2TAction = SERobotTAction;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // await Task.Delay(100);
|
|
|
+ }
|
|
|
+ await Task.Delay(600);
|
|
|
+
|
|
|
+ Robot2XAction = SERobotXAction.Extend2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Retracting)
|
|
|
+ {
|
|
|
+ var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
|
|
|
+ if (TMRobotMoveActionBladeTarget != null)
|
|
|
+ {
|
|
|
+ RobotTarget = TMRobotMoveActionBladeTarget.ToString();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var values = RobotTarget.Split('.');
|
|
|
+ var arm = values[0];
|
|
|
+ if (arm == "ArmA")
|
|
|
+ {
|
|
|
+ Robot1XAction = SERobotXAction.Retract;
|
|
|
+ }
|
|
|
+ else if (arm == "ArmB")
|
|
|
+ {
|
|
|
+ Robot2XAction = SERobotXAction.Retract2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+ #region Home
|
|
|
+ else if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Homing)
|
|
|
+ {
|
|
|
+ if (Robot1XAction == SERobotXAction.Extend)
|
|
|
+ {
|
|
|
+ Robot1XAction = SERobotXAction.Retract;
|
|
|
+ }
|
|
|
+ if (Robot2XAction == SERobotXAction.Extend2)
|
|
|
+ {
|
|
|
+ Robot2XAction = SERobotXAction.Retract2;
|
|
|
+ }
|
|
|
+ await Task.Delay(2000);
|
|
|
+ if (Robot1TAction != SERobotTAction.T_Origin)
|
|
|
+ {
|
|
|
+ Robot1TAction = SERobotTAction.T_Origin;
|
|
|
+ }
|
|
|
+ if (Robot2TAction != SERobotTAction.T_Origin)
|
|
|
+ {
|
|
|
+ Robot2TAction = SERobotTAction.T_Origin;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+
|
|
|
+}
|