1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102 |
- 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.DERobot;
- namespace Venus_MainPages.ViewModels
- {
- public class VenusDETMViewModel : BindableBase
- {
- public enum DeTMModule
- {
- PMA, PMB, PMC, PMD, LP1, LP2, Aligner1
- }
- public enum DeTMBlade
- {
- Blade1, Blade2
- }
- #region 私有字段
- private ObservableCollection<string> _RobotSpeedLevel = new ObservableCollection<string>();
- private ObservableCollection<string> _RobotOption = new ObservableCollection<string>();
- private string _RobotSelectSpeedLevel = "";
- private string _RobotSelectOption = "";
- private string _WithWaferSpeed = "";
- private string _NoWaferSpeed = "";
- private ModuleInfo m_AlignerModuleInfo;
- private ModuleInfo m_TMModuleInfo;
- //Wafer
- private WaferInfo m_PMAWafer;
- private WaferInfo m_PMBWafer;
- private WaferInfo m_PMCWafer;
- private WaferInfo m_PMDWafer;
- 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_PMDDoorIsOpen;
- private bool m_VCEADoorIsOpen;
- private bool m_VCEBDoorIsOpen;
- private bool m_VCEAOutDoorIsOpen;
- private bool m_VCEBOutDoorIsOpen;
- private bool m_IsAlignerOnRight;
- //Pick、Place、Extend、Retract行下拉框内容
- private DeTMModule m_PickSelectedModule;
- private DeTMModule m_PlaceSelectedModule;
- private DeTMModule m_ExtendSelectedModule;
- private DeTMModule m_RetractSelectedModule;
- private DeTMModule m_GotoSelectedModule;
- private DeTMBlade m_PickSelectedBlade;
- private DeTMBlade m_PlaceSelectedBlade;
- private DeTMBlade m_ExtendSelectedBlade;
- private DeTMBlade m_RetractSelectedBlade;
- private DeTMBlade 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<DeTMModule> m_TMModules = new List<DeTMModule>();
- private bool m_PMAIsInstalled;
- private bool m_PMBIsInstalled;
- private bool m_PMCIsInstalled;
- private bool m_PMDIsInstalled;
- private bool m_VCEAIsInstalled;
- private bool m_VCEBIsInstalled;
- private bool m_AlignerIsInstalled;
- private Dictionary<string, object> m_RtDataValues = new Dictionary<string, object>();
- private List<string> m_RtDataKeys = new List<string>();
- //Robot动画
- private DERobotTAction m_DERobotTAction;
- private DERobotTAction m_Robot1TAction;
- private DERobotXAction m_Robot1XAction;
- private DERobotTAction m_Robot2TAction;
- private DERobotXAction 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 bool m_PMDIsCycle;
- private int m_CycleCount;
- private string m_PMAChamberLabel;
- private string m_PMBChamberLabel;
- private string m_PMCChamberLabel;
- private string m_PMDChamberLabel;
- #endregion
- #region 属性
- public ObservableCollection<string> RobotSpeedLevel
- {
- get { return _RobotSpeedLevel; }
- set { SetProperty(ref _RobotSpeedLevel, value); }
- }
- public ObservableCollection<string> RobotOption
- {
- get { return _RobotOption; }
- set { SetProperty(ref _RobotOption, value); }
- }
- public string RobotSelectSpeedLevel
- {
- get { return _RobotSelectSpeedLevel; }
- set
- {
- if (_RobotSelectSpeedLevel != value)
- SetProperty(ref _RobotSelectSpeedLevel, value);
- }
- }
- public string RobotSelectOption
- {
- get { return _RobotSelectOption; }
- set
- {
- if (_RobotSelectOption != value)
- SetProperty(ref _RobotSelectOption, value);
- }
- }
- public string WithWaferSpeed
- {
- get { return _WithWaferSpeed; }
- set
- {
- SetProperty(ref _WithWaferSpeed, value);
- }
- }
- public string NoWaferSpeed
- {
- get { return _NoWaferSpeed; }
- set
- {
- SetProperty(ref _NoWaferSpeed, value);
- }
- }
- public string PMAChamberLabel
- {
- get { return m_PMAChamberLabel; }
- set { SetProperty(ref m_PMAChamberLabel, value); }
- }
- public string PMBChamberLabel
- {
- get { return m_PMBChamberLabel; }
- set { SetProperty(ref m_PMBChamberLabel, value); }
- }
- public string PMCChamberLabel
- {
- get { return m_PMCChamberLabel; }
- set { SetProperty(ref m_PMCChamberLabel, value); }
- }
- public string PMDChamberLabel
- {
- get { return m_PMDChamberLabel; }
- set { SetProperty(ref m_PMDChamberLabel, 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 PMDWafer
- {
- get { return m_PMDWafer; }
- set { SetProperty(ref m_PMDWafer, 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 IsAligner1OnRight { get => m_IsAlignerOnRight; set => SetProperty(ref m_IsAlignerOnRight, value); }
- public bool VCEADoorIsOpen { get => m_VCEADoorIsOpen; set => SetProperty(ref m_VCEADoorIsOpen, value); }
- public bool VCEBDoorIsOpen { get => m_VCEBDoorIsOpen; set => SetProperty(ref m_VCEBDoorIsOpen, value); }
- public bool VCEAOutDoorIsOpen { get => m_VCEAOutDoorIsOpen; set => SetProperty(ref m_VCEAOutDoorIsOpen, value); }
- public bool VCEBOutDoorIsOpen { get => m_VCEBOutDoorIsOpen; set => SetProperty(ref m_VCEBOutDoorIsOpen, value); }
- public bool PMDDoorIsOpen { get => m_PMDDoorIsOpen; set => SetProperty(ref m_PMDDoorIsOpen, 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 AlignerModuleInfo
- {
- get { return m_AlignerModuleInfo; }
- set
- {
- SetProperty(ref m_AlignerModuleInfo, 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 PMDIsInstalled
- {
- get { return m_PMDIsInstalled; }
- set
- {
- SetProperty(ref m_PMDIsInstalled, value);
- }
- }
- public bool VCEAIsInstalled
- {
- get { return m_VCEAIsInstalled; }
- set { SetProperty(ref m_VCEAIsInstalled, value); }
- }
- public bool VCEBIsInstalled
- {
- get { return m_VCEBIsInstalled; }
- set
- {
- SetProperty(ref m_VCEBIsInstalled, value);
- }
- }
- public bool AlignerIsInstalled
- {
- get { return m_AlignerIsInstalled; }
- set { SetProperty(ref m_AlignerIsInstalled, value); }
- }
- public List<DeTMModule> TMModules
- {
- get { return m_TMModules; }
- set { SetProperty(ref m_TMModules, value); }
- }
- //Module属性
- public DeTMModule PickSelectedModule
- {
- get { return m_PickSelectedModule; }
- set { SetProperty(ref m_PickSelectedModule, value); }
- }
- public DeTMModule PlaceSelectedModule
- {
- get { return m_PlaceSelectedModule; }
- set { SetProperty(ref m_PlaceSelectedModule, value); }
- }
- public DeTMModule ExtendSelectedModule
- {
- get { return m_ExtendSelectedModule; }
- set { SetProperty(ref m_ExtendSelectedModule, value); }
- }
- public DeTMModule RetractSelectedModule
- {
- get { return m_RetractSelectedModule; }
- set { SetProperty(ref m_RetractSelectedModule, value); }
- }
- public DeTMModule 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 DeTMBlade PickSelectedBlade
- {
- get { return m_PickSelectedBlade; }
- set { SetProperty(ref m_PickSelectedBlade, value); }
- }
- public DeTMBlade PlaceSelectedBlade
- {
- get { return m_PlaceSelectedBlade; }
- set { SetProperty(ref m_PlaceSelectedBlade, value); }
- }
- public DeTMBlade ExtendSelectedBlade
- {
- get { return m_ExtendSelectedBlade; }
- set { SetProperty(ref m_ExtendSelectedBlade, value); }
- }
- public DeTMBlade RetractSelectedBlade
- {
- get { return m_RetractSelectedBlade; }
- set { SetProperty(ref m_RetractSelectedBlade, value); }
- }
- public DeTMBlade 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 DERobotTAction DERobotTAction
- {
- get { return m_DERobotTAction; }
- set { SetProperty(ref m_DERobotTAction, value); }
- }
- public DERobotTAction Robot1TAction
- {
- get { return m_Robot1TAction; }
- set { SetProperty(ref m_Robot1TAction, value); }
- }
- public DERobotXAction Robot1XAction
- {
- get { return m_Robot1XAction; }
- set { SetProperty(ref m_Robot1XAction, value); }
- }
- public DERobotTAction Robot2TAction
- {
- get { return m_Robot2TAction; }
- set { SetProperty(ref m_Robot2TAction, value); }
- }
- public DERobotXAction Robot2XAction
- {
- get { return m_Robot2XAction; }
- set { SetProperty(ref m_Robot2XAction, value); }
- }
- public RobotMoveInfo RobotMoveInfo
- {
- get { return m_robotMoveInfo; }
- set
- {
- RobotMoveInfoChanged(m_robotMoveInfo, value);
- SetProperty(ref 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 bool PMDIsCycle
- {
- get { return m_PMDIsCycle; }
- set { SetProperty(ref m_PMDIsCycle, 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));
- private DelegateCommand<object> _RQSpeedCommand;
- public DelegateCommand<object> RQSpeedCommand => _RQSpeedCommand ?? (_RQSpeedCommand = new DelegateCommand<object>(OnRQSpeed));
- private DelegateCommand<object> _SetSpeedCommand;
- public DelegateCommand<object> SetSpeedCommand => _SetSpeedCommand ?? (_SetSpeedCommand = new DelegateCommand<object>(OnSetSpeed));
- private DelegateCommand<object> _StoreSpeedCommand;
- public DelegateCommand<object> StoreSpeedCommand => _StoreSpeedCommand ?? (_StoreSpeedCommand = new DelegateCommand<object>(OnStoreSpeed));
- #region 构造函数
- public VenusDETMViewModel()
- {
- string allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString();
- PMAIsInstalled = allModules.Contains("PMA");
- PMBIsInstalled = allModules.Contains("PMB");
- PMCIsInstalled = allModules.Contains("PMC");
- PMDIsInstalled = allModules.Contains("PMD");
- VCEAIsInstalled = allModules.Contains("VCEA");
- VCEBIsInstalled = allModules.Contains("VCEB");
- AlignerIsInstalled = allModules.Contains("Aligner");
- IsAligner1OnRight = true;
- if (PMAIsInstalled == true)
- {
- TMModules.Add(DeTMModule.PMA);
- }
- if (PMBIsInstalled == true)
- {
- TMModules.Add(DeTMModule.PMB);
- }
- if (PMCIsInstalled == true)
- {
- TMModules.Add(DeTMModule.PMC);
- }
- if (PMDIsInstalled == true)
- {
- TMModules.Add(DeTMModule.PMD);
- IsAligner1OnRight = false;
- }
- if (VCEAIsInstalled == true)
- {
- TMModules.Add(DeTMModule.LP1);
- }
- if (VCEBIsInstalled == true)
- {
- TMModules.Add(DeTMModule.LP2);
- }
- if (AlignerIsInstalled == true)
- {
- TMModules.Add(DeTMModule.Aligner1);
- }
- PickSoltItemsSource.Add(1);
- PlaceSoltItemsSource.Add(1);
- ExtendSoltItemsSource.Add(1);
- RetractSoltItemsSource.Add(1);
- addDataKeys();
- RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
- PMADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMASlitDoorClosed");
- PMBDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMBSlitDoorClosed");
- PMCDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMCSlitDoorClosed");
- PMDDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMDSlitDoorClosed");
- VCEADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.VCEASlitDoorClosed");
- VCEBDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.VCEBSlitDoorClosed");
- DispatcherTimer timer = new DispatcherTimer();
- timer.Interval = TimeSpan.FromSeconds(0.5);
- timer.Tick += Timer_Tick;
- timer.Start();
- RobotSpeedLevel.Add("10%");
- RobotSpeedLevel.Add("20%");
- RobotSpeedLevel.Add("30%");
- RobotSpeedLevel.Add("40%");
- RobotSpeedLevel.Add("50%");
- RobotSpeedLevel.Add("60%");
- RobotSpeedLevel.Add("70%");
- RobotSpeedLevel.Add("80%");
- RobotSpeedLevel.Add("90%");
- RobotSpeedLevel.Add("100%");
- RobotOption.Add("With Wafer");
- RobotOption.Add("Without Wafer");
- RobotSelectOption = "With Wafer";
- RobotSelectSpeedLevel = "10%";
- }
- #endregion
- #region 命令方法
- private void addDataKeys()
- {
- m_RtDataKeys.Add($"TM.WithWaferSpeed");
- m_RtDataKeys.Add($"TM.NoWaferSpeed");
- m_RtDataKeys.Add($"TM.VCEASlitDoorClosed");
- m_RtDataKeys.Add($"TM.VCEBSlitDoorClosed");
- m_RtDataKeys.Add($"TM.PMASlitDoorClosed");
- m_RtDataKeys.Add($"TM.PMBSlitDoorClosed");
- m_RtDataKeys.Add($"TM.PMCSlitDoorClosed");
- m_RtDataKeys.Add($"TM.PMDSlitDoorClosed");
- m_RtDataKeys.Add($"LP1.CassettePlaced");
- m_RtDataKeys.Add($"LP2.CassettePlaced");
- m_RtDataKeys.Add($"PMA.ChamberPressure");
- m_RtDataKeys.Add($"PMB.ChamberPressure");
- m_RtDataKeys.Add($"PMC.ChamberPressure");
- m_RtDataKeys.Add($"PMD.ChamberPressure");
- m_RtDataKeys.Add($"TM.VCEPressure.Value");
- m_RtDataKeys.Add($"TMCycle.CycleIndex");
- }
- //模块选择根据obj选择下拉框内容
- private void OnModuleChange(object obj)
- {
- var value = obj.ToString();
- switch (value)
- {
- case "Pick":
- PickSoltItemsSource.Clear();
- if ((int)PickSelectedModule == 4|| (int)PickSelectedModule == 5)
- {
- for (int i = 1; i <= 25; i++)
- {
- PickSoltItemsSource.Add(i);
- }
- }
- else
- {
- PickSoltItemsSource.Add(1);
- }
- PickSoltSelectedIndex = 0;
- break;
- case "Place":
- PlaceSoltItemsSource.Clear();
- if ((int)PlaceSelectedModule == 4|| (int)PlaceSelectedModule == 5)
- {
- for (int i = 1; i <= 25; i++)
- {
- PlaceSoltItemsSource.Add(i);
- }
- }
- else
- {
- PlaceSoltItemsSource.Add(1);
- }
- PlaceSoltSelectedIndex = 0;
- break;
- case "Extend":
- ExtendSoltItemsSource.Clear();
- if ((int)ExtendSelectedModule == 4|| (int)ExtendSelectedModule == 5)
- {
- for (int i = 1; i <= 25; i++)
- {
- ExtendSoltItemsSource.Add(i);
- }
- }
- else
- {
- ExtendSoltItemsSource.Add(1);
- }
- ExtendSoltSelectedIndex = 0;
- break;
- case "Retract":
- RetractSoltItemsSource.Clear();
- if ((int)RetractSelectedModule == 4|| (int)RetractSelectedModule == 5)
- {
- 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 - 3)
- {
- InvokeClient.Instance.Service.DoOperation($"TM.PMPick", moveItems);
- }
- else
- {
- InvokeClient.Instance.Service.DoOperation($"TM.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 - 3)
- {
- InvokeClient.Instance.Service.DoOperation($"TM.PMPlace", moveItems);
- }
- //VCE、Aligner1
- else
- {
- InvokeClient.Instance.Service.DoOperation($"TM.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($"TM.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($"TM.Retract", moduleName, RetractSoltItemsSource[PlaceSoltSelectedIndex] - 1, selectedHand);
- }
- //令选择的模块下发Home指令
- private void OnRobotHome()
- {
- InvokeClient.Instance.Service.DoOperation($"TM.Home", "TMRobot");
- InvokeClient.Instance.Service.DoOperation($"TM.Retract");
- }
- private void OnHome()
- {
- InvokeClient.Instance.Service.DoOperation($"TM.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($"TM.Goto", moduleName, 0, selectedHand);
- }
- //Cycle
- private void OnStartCycle()
- {
- if (CycleEnable == false)
- {
- return;
- }
- List<string> stations = new List<string>();
- stations.Add("VCEA");
- stations.Add("Aligner1");
- if (PMAIsCycle == true)
- {
- stations.Add("PMA");
- }
- if (PMBIsCycle == true)
- {
- stations.Add("PMB");
- }
- if (PMCIsCycle == true)
- {
- stations.Add("PMC");
- }
- if (PMDIsCycle == true)
- {
- stations.Add("PMD");
- }
- stations.Add("VCEA");
- InvokeClient.Instance.Service.DoOperation("System.SETMCycle", stations.ToArray(), CycleCount);
- }
- private void OnStopCycle()
- {
- InvokeClient.Instance.Service.DoOperation("System.SEAbort");
- }
- private void OnRQSpeed(object obj)
- {
- InvokeClient.Instance.Service.DoOperation($"TM.QuerySpeed", obj);
- }
- private void OnSetSpeed(object obj)
- {
- string waferspeed;
- if (RobotSelectOption == "With Wafer")
- waferspeed = "WITHWAFER";
- else
- waferspeed = "NOWAFER";
- float RobotSpeed = Convert.ToInt32(RobotSelectSpeedLevel.Replace("%", ""));
- InvokeClient.Instance.Service.DoOperation($"TM.SetSpeed", waferspeed, RobotSpeed);
- }
- private void OnStoreSpeed(object obj)
- {
- string waferspeed;
- if (RobotSelectOption == "With Wafer")
- waferspeed = "WITHWAFER";
- else
- waferspeed = "NOWAFER";
- InvokeClient.Instance.Service.DoOperation($"TM.SaveSpeed", waferspeed);
- }
- #endregion
- #region 私有方法
- private void Timer_Tick(object sender, EventArgs e)
- {
- TMModuleInfo = ModuleManager.ModuleInfos["TMRobot"];
- 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];
- }
- if (PMDIsInstalled == true)
- {
- ModuleInfo PMDModuleInfo = ModuleManager.ModuleInfos["PMD"];
- PMDWafer = PMDModuleInfo.WaferManager.Wafers[0];
- }
- RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
- WithWaferSpeed = CommonFunction.GetValue<string>(RtDataValues, "TM.WithWaferSpeed");
- NoWaferSpeed = CommonFunction.GetValue<string>(RtDataValues, "TM.NoWaferSpeed");
- PMADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMASlitDoorClosed");
- PMBDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMBSlitDoorClosed");
- PMCDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMCSlitDoorClosed");
- PMDDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMDSlitDoorClosed");
- VCEADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.VCEASlitDoorClosed");
- VCEBDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.VCEBSlitDoorClosed");
- RobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction");
- PAWafer = ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers[0];
- RobotUpperWafer = TMModuleInfo.WaferManager.Wafers[0];
- RobotLowerWafer = TMModuleInfo.WaferManager.Wafers[1];
- PMAChamberLabel = QueryDataClient.Instance.Service.GetConfig($"PMA.ChamberLabel").ToString();
- PMBChamberLabel = QueryDataClient.Instance.Service.GetConfig($"PMB.ChamberLabel").ToString();
- PMCChamberLabel = QueryDataClient.Instance.Service.GetConfig($"PMC.ChamberLabel").ToString();
- PMDChamberLabel = QueryDataClient.Instance.Service.GetConfig($"PMD.ChamberLabel").ToString();
- }
- 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];
- var DERobotTAction = (DERobotTAction)Enum.Parse(typeof(DERobotTAction), module, true);
- if (DERobotTAction != Robot1TAction || DERobotTAction != Robot2TAction)
- {
- Robot1TAction = DERobotTAction;
- Robot2TAction = DERobotTAction;
- }
- }
- #endregion
- #region Aligner1、VCE 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 == "Aligner1")
- {
- module = IsAligner1OnRight ? "PMD" : "Aligner1";
- }
- var DERobotTAction = (DERobotTAction)Enum.Parse(typeof(DERobotTAction), module, true);
- if (DERobotTAction != Robot1TAction || DERobotTAction != Robot2TAction)
- {
- Robot1TAction = DERobotTAction;
- Robot2TAction = DERobotTAction;
- }
- if (arm == "ArmA")
- {
- await Task.Delay(600);
- if (module == "VCEA" || module == "VCEB")
- {
- Robot1XAction = DERobotXAction.ToVCE;
- 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 = DERobotXAction.FromVCE;
- }
- else
- {
- Robot1XAction = DERobotXAction.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 = DERobotXAction.Retract;
- }
- }
- else if (arm == "ArmB")
- {
- await Task.Delay(600);
- if (module == "VCEA" || module == "VCEB")
- {
- Robot2XAction = DERobotXAction.ToVCE2;
- 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 = DERobotXAction.FromVCE2;
- }
- else
- {
- Robot2XAction = DERobotXAction.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 = DERobotXAction.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];
- var DERobotTAction = (DERobotTAction)Enum.Parse(typeof(DERobotTAction), module, true);
- if (DERobotTAction != Robot1TAction || DERobotTAction != Robot2TAction)
- {
- Robot1TAction = DERobotTAction;
- Robot2TAction = DERobotTAction;
- }
- if (arm == "ArmA")
- {
- await Task.Delay(600);
- Robot1XAction = DERobotXAction.Extend;
- }
- else if (arm == "ArmB")
- {
- await Task.Delay(600);
- Robot2XAction = DERobotXAction.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];
- var module = values[1];
- if (arm == "ArmA")
- {
- await Task.Delay(100);
- Robot1XAction = DERobotXAction.Retract;
- }
- else if (arm == "ArmB")
- {
- await Task.Delay(100);
- Robot2XAction = DERobotXAction.Retract2;
- }
- }
- #endregion
- #region Home
- else if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Homing)
- {
- if (Robot1XAction == DERobotXAction.Extend)
- {
- Robot1XAction = DERobotXAction.Retract;
- }
- if (Robot2XAction == DERobotXAction.Extend2)
- {
- Robot2XAction = DERobotXAction.Retract2;
- }
- await Task.Delay(2000);
- if (Robot1TAction != DERobotTAction.T_Origin)
- {
- Robot1TAction = DERobotTAction.T_Origin;
- }
- if (Robot2TAction != DERobotTAction.T_Origin)
- {
- Robot2TAction = DERobotTAction.T_Origin;
- }
- }
- #endregion
- }
- #endregion
- }
- }
|