12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043 |
- using MECF.Framework.Common.CommonData;
- using MECF.Framework.Common.DataCenter;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.OperationCenter;
- using OpenSEMI.ClientBase;
- using Prism.Commands;
- using Prism.Mvvm;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Venus_Core;
- using Venus_Themes.CustomControls;
- using System.Windows.Threading;
- using Venus_MainPages.Unity;
- using Microsoft.VisualBasic;
- using ExcelLibrary.BinaryFileFormat;
- using MECF.Framework.Common.Schedulers;
- using Venus_MainPages.Views;
- using System.Windows;
- using static Venus_Themes.CustomControls.SERobot;
- using System.Security.RightsManagement;
- namespace Venus_MainPages.ViewModels
- {
- public class VenusSeOperationOverViewModel : BindableBase
- {
- #region 私有字段
- private ModuleInfo m_VCE1ModuleInfo;
- private ModuleInfo m_PMAModuleInfo;
- private ModuleInfo m_PMBModuleInfo;
- private ModuleInfo m_PMCModuleInfo;
- private ModuleInfo m_AlignerModuleInfo;
- private ModuleInfo m_TMModuleInfo;
- public WaferInfo m_PMAWafer;
- public WaferInfo m_PMBWafer;
- public WaferInfo m_PMCWafer;
- public WaferInfo m_RobotUpperWafer;
- public WaferInfo m_RobotLowerWafer;
- public WaferInfo m_PAWafer;
- private SERobotTAction m_Robot1TAction;
- private SERobotXAction m_Robot1XAction;
- private SERobotTAction m_Robot2TAction;
- private SERobotXAction m_Robot2XAction;
- public RobotMoveInfo m_robotMoveInfo;
- private int m_VCE1WaferCount;
- private bool m_NeedAutoUnLoad;
- private bool m_PMAIsInstalled;
- private bool m_PMBIsInstalled;
- private bool m_PMCIsInstalled;
- private bool m_VCEIsInstalled;
- private bool m_VCEDoorIsOpen;
- private bool m_PMADoorIsOpen;
- private bool m_PMBDoorIsOpen;
- private bool m_PMCDoorIsOpen;
- private bool m_VCEOutDoorIsOpen;
- private bool m_TMIsVAC;
- private bool m_VCE1IsVAC;
- private Dictionary<string, object> m_RtDataValues = new Dictionary<string, object>();
- private List<string> m_RtDataKeys = new List<string>();
- private double m_PMAPercent;
- private double m_PMBPercent;
- private double m_PMCPercent;
- private double m_VCEPercent;
- private int m_PickNum;
- private RecipeResult m_PMARecipeResult;
- private RecipeResult m_PMBRecipeResult;
- private RecipeResult m_PMCRecipeResult;
- private WaferAssociationInfo m_VCEwaferAssociation;
- private bool loadflag;
- private string m_PMAChamberLabel;
- private string m_PMBChamberLabel;
- private string m_PMCChamberLabel;
- private string m_PMDChamberLabel;
- #endregion
- #region 属性
- 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 SERobotTAction Robot1TAction
- {
- get { return m_Robot1TAction; }
- set { SetProperty(ref m_Robot1TAction, value); }
- }
- private DelegateCommand<object> _AbortJobCommand;
- public DelegateCommand<object> AbortJobCommand =>
- _AbortJobCommand ?? (_AbortJobCommand = new DelegateCommand<object>(OnAbortJob));
- 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;
- }
- }
- public RecipeResult PMARecipeResult
- {
- get { return m_PMARecipeResult; }
- set { SetProperty(ref m_PMARecipeResult, value); }
- }
- public RecipeResult PMBRecipeResult
- {
- get { return m_PMBRecipeResult; }
- set { SetProperty(ref m_PMBRecipeResult, value); }
- }
- public RecipeResult PMCRecipeResult
- {
- get { return m_PMCRecipeResult; }
- set { SetProperty(ref m_PMCRecipeResult, value); }
- }
- public double PMAPercent
- {
- get { return m_PMAPercent; }
- set { SetProperty(ref m_PMAPercent, value); }
- }
- public double PMBPercent
- {
- get { return m_PMBPercent; }
- set { SetProperty(ref m_PMBPercent, value); }
- }
- public double PMCPercent
- {
- get { return m_PMCPercent; }
- set { SetProperty(ref m_PMCPercent, value); }
- }
- public double VCEPercent
- {
- get { return m_VCEPercent; }
- set { SetProperty(ref m_VCEPercent, value); }
- }
- public int PickNum
- {
- get { return m_PickNum; }
- set { SetProperty(ref m_PickNum, 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 ModuleInfo VCE1ModuleInfo
- {
- get { return m_VCE1ModuleInfo; }
- set
- {
- SetProperty(ref m_VCE1ModuleInfo, value);
- }
- }
- public ModuleInfo PMAModuleInfo
- {
- get { return m_PMAModuleInfo; }
- set
- {
- SetProperty(ref m_PMAModuleInfo, value);
- }
- }
- public ModuleInfo PMBModuleInfo
- {
- get { return m_PMBModuleInfo; }
- set
- {
- SetProperty(ref m_PMBModuleInfo, value);
- }
- }
- public ModuleInfo PMCModuleInfo
- {
- get { return m_PMCModuleInfo; }
- set
- {
- SetProperty(ref m_PMCModuleInfo, value);
- }
- }
- public ModuleInfo AligenrModuleInfo
- {
- get { return m_AlignerModuleInfo; }
- set
- {
- SetProperty(ref m_AlignerModuleInfo, value);
- }
- }
- public ModuleInfo TMModuleInfo
- {
- get { return m_TMModuleInfo; }
- set
- {
- SetProperty(ref m_TMModuleInfo, value);
- }
- }
- public bool NeedAutoUnLoad
- {
- get { return m_NeedAutoUnLoad; }
- set { SetProperty(ref m_NeedAutoUnLoad, 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 TMIsVAC
- {
- get { return m_TMIsVAC; }
- set { SetProperty(ref m_TMIsVAC, value); }
- }
- public bool VCE1IsVAC
- {
- get { return m_VCE1IsVAC; }
- set { SetProperty(ref m_VCE1IsVAC, value); }
- }
- public bool VCEDoorIsOpen { get => m_VCEDoorIsOpen; set => SetProperty(ref m_VCEDoorIsOpen, value); }
- public bool PMADoorIsOpen { get => m_PMADoorIsOpen; set => SetProperty(ref m_PMADoorIsOpen, value); }
- public bool PMBDoorIsOpen { get => m_PMBDoorIsOpen; set => SetProperty(ref m_PMBDoorIsOpen, value); }
- public bool PMCDoorIsOpen { get => m_PMCDoorIsOpen; set => SetProperty(ref m_PMCDoorIsOpen, value); }
- public bool VCEOutDoorIsOpen { get => m_VCEOutDoorIsOpen; set => SetProperty(ref m_VCEOutDoorIsOpen, value); }
- public int VCE1WaferCount
- {
- get { return m_VCE1WaferCount; }
- set
- {
- SetProperty(ref m_VCE1WaferCount, value);
- }
- }
- public Dictionary<string, object> RtDataValues
- {
- get { return m_RtDataValues; }
- set { SetProperty(ref m_RtDataValues, value); }
- }
- public WaferAssociationInfo VCEwaferAssociation
- {
- get { return m_VCEwaferAssociation; }
- set { SetProperty(ref m_VCEwaferAssociation, value); }
- }
- #endregion
- #region 命令
- private DelegateCommand _HomeAll;
- public DelegateCommand HomeAll => _HomeAll ?? (_HomeAll = new DelegateCommand(onHomeAll));
- private DelegateCommand _SetAutoMode;
- public DelegateCommand SetAutoMode => _SetAutoMode ?? (_SetAutoMode = new DelegateCommand(onSetAutoMode));
- private DelegateCommand _SetManualMode;
- public DelegateCommand SetManualMode => _SetManualMode ?? (_SetManualMode = new DelegateCommand(onSetManualMode));
- private DelegateCommand _StartSETMCycle;
- public DelegateCommand StartSETMCycle => _StartSETMCycle ?? (_StartSETMCycle = new DelegateCommand(onStartSETMCycle));
- private DelegateCommand<object> _StartCommand;
- public DelegateCommand<object> StartCommand =>
- _StartCommand ?? (_StartCommand = new DelegateCommand<object>(OnStart));
- private DelegateCommand _StopCycle;
- public DelegateCommand StopCycle => _StopCycle ?? (_StopCycle = new DelegateCommand(onStopCycle));
- private DelegateCommand _VCEHome;
- public DelegateCommand VCEHome => _VCEHome ?? (_VCEHome = new DelegateCommand(vceHome));
- private DelegateCommand _VCEReadMap;
- public DelegateCommand VCEReadMap => _VCEReadMap ?? (_VCEReadMap = new DelegateCommand(vceReadMap));
- private DelegateCommand _VCELoadPrepare;
- public DelegateCommand VCELoadPrepare =>
- _VCELoadPrepare ?? (_VCELoadPrepare = new DelegateCommand(vceLoadPrepare));
- private DelegateCommand __VCELoad;
- public DelegateCommand VCELoad =>
- __VCELoad ?? (__VCELoad = new DelegateCommand(vceLoad));
- private DelegateCommand __VCELoadWithSMIF;
- public DelegateCommand VCELoadWithSMIF =>
- __VCELoadWithSMIF ?? (__VCELoadWithSMIF = new DelegateCommand(vceLoadWithSMIF));
- private DelegateCommand __VCEUnLoadWithSMIF;
- public DelegateCommand VCEUnLoadWithSMIF =>
- __VCEUnLoadWithSMIF ?? (__VCEUnLoadWithSMIF = new DelegateCommand(vceUnLoadWithSMIF));
- private DelegateCommand _VCEUnLoad;
- public DelegateCommand VCEUnLoad =>
- _VCEUnLoad ?? (_VCEUnLoad = new DelegateCommand(vceUnLoad));
- private DelegateCommand _SMIFLoad;
- public DelegateCommand SMIFLoad =>
- _SMIFLoad ?? (_SMIFLoad = new DelegateCommand(smifLoad));
- private DelegateCommand _SMIFULoad;
- public DelegateCommand SMIFULoad =>
- _SMIFULoad ?? (_SMIFULoad = new DelegateCommand(smifUnLoad));
- private DelegateCommand _tmhome;
- public DelegateCommand TmHome =>
- _tmhome ?? (_tmhome = new DelegateCommand(tmhome));
- private DelegateCommand _tmPick;
- public DelegateCommand TmPick =>
- _tmPick ?? (_tmPick = new DelegateCommand(tmpick));
- private DelegateCommand _tmPlace;
- public DelegateCommand TMPlace =>
- _tmPlace ?? (_tmPlace = new DelegateCommand(tmplace));
- //private DelegateCommand _tmSave;
- private DelegateCommand _LoadCommand;
- public DelegateCommand LoadCommand =>
- _LoadCommand ?? (_LoadCommand = new DelegateCommand(OnLoad));
- private DelegateCommand _PauseAllJobCommand;
- public DelegateCommand PauseAllJobCommand =>
- _PauseAllJobCommand ?? (_PauseAllJobCommand = new DelegateCommand(OnPauseAllJob));
- private DelegateCommand _AbortAllCommand;
- public DelegateCommand AbortAllCommand =>
- _AbortAllCommand ?? (_AbortAllCommand = new DelegateCommand(OnAbortAll));
- private DelegateCommand<object> _SetSequenceCommand;
- public DelegateCommand<object> SetSequenceCommand =>
- _SetSequenceCommand ?? (_SetSequenceCommand = new DelegateCommand<object>(OnSetSequence));
- private DelegateCommand<object> _CreateJobCommand;
- public DelegateCommand<object> CreateJobCommand =>
- _CreateJobCommand ?? (_CreateJobCommand = new DelegateCommand<object>(OnCreateJob));
- private DelegateCommand<object> _SelectAllCommand;
- public DelegateCommand<object> SelectAllCommand =>
- _SelectAllCommand ?? (_SelectAllCommand = new DelegateCommand<object>(OnSelectAll));
- private DelegateCommand<object> _UnSelectAllCommand;
- public DelegateCommand<object> UnSelectAllCommand =>
- _UnSelectAllCommand ?? (_UnSelectAllCommand = new DelegateCommand<object>(OnDeSelectAll));
- private DelegateCommand<object> _ReturnAllWafer;
- public DelegateCommand<object> ReturnAllWafer =>
- _ReturnAllWafer ?? (_ReturnAllWafer = new DelegateCommand<object>(OnReturnAllWafer));
- private DelegateCommand _NeedUnloadCommand;
- public DelegateCommand NeedUnloadCommand =>
- _NeedUnloadCommand ?? (_NeedUnloadCommand = new DelegateCommand(OnNeedUnloadCommand));
- #endregion
- #region 构造函数
- public VenusSeOperationOverViewModel()
- {
- //页面不刷错的方法 页面中的PM做成List的形式 通过itemsource显示 同时提供各个位置的pm点位 旋转角度
- VCE1WaferCount = 25;
- string[] allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString().Split(',');
- NeedAutoUnLoad = (bool)QueryDataClient.Instance.Service.GetConfig($"System.IsAutoUnload");
- PMAIsInstalled = allModules.Contains("PMA");
- PMBIsInstalled = allModules.Contains("PMB");
- PMCIsInstalled = allModules.Contains("PMC");
- VCEIsInstalled = allModules.Contains("VCE1");
- addDataKeys();
- RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
- VCEDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.VCESlitDoorClosed");
- PMADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMASlitDoorClosed");
- PMBDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMBSlitDoorClosed");
- PMCDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMCSlitDoorClosed");
- VCEOutDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "VCE1.VCEOutDoorClosed");
- loadflag = false;
- DispatcherTimer timer = new DispatcherTimer();
- timer.Interval = TimeSpan.FromSeconds(0.1);
- timer.Tick += Timer_Tick;
- timer.Start();
- }
- #endregion
- #region 命令实现
- private void OnLoad()
- {
- if (VCEIsInstalled && !loadflag && VCEwaferAssociation == null)
- {
- VCEwaferAssociation = new WaferAssociationInfo
- {
- ModuleData = ModuleManager.ModuleInfos["LP1"]
- };
- loadflag = true;
- }
- }
- private void OnAbortJob(object obj)
- {
- InvokeClient.Instance.Service.DoOperation("SE.AbortJob", obj.ToString());
- }
- private void OnSelectAll(object obj)
- {
- var info = obj as WaferAssociationInfo;
- info.SlotFrom = 1;
- info.SlotTo = 25;
- AssociateSequence(info, true);
- }
- private void OnDeSelectAll(object obj)
- {
- var info = obj as WaferAssociationInfo;
- info.SlotFrom = 1;
- info.SlotTo = 25;
- AssociateSequence(info, false);
- }
- private void OnNeedUnloadCommand()
- {
- if (NeedAutoUnLoad != (bool)QueryDataClient.Instance.Service.GetConfig($"System.IsAutoUnload"))
- {
- InvokeClient.Instance.Service.DoOperation("System.SetConfig", $"System.IsAutoUnload", NeedAutoUnLoad.ToString());
- NeedAutoUnLoad = (bool)QueryDataClient.Instance.Service.GetConfig($"System.IsAutoUnload");
- }
- }
- private void OnReturnAllWafer(object obj)
- {
- WaferDialogView dialog = new WaferDialogView()
- {
- Owner = Application.Current.MainWindow,
- };
- dialog.Height = 300;
- dialog.Width = 400;
- double angel = 0;
- double coolingtime = 0;
- string message = "Please Confirm Return Wafer";
- WaferDialogViewModel vm = new WaferDialogViewModel();
- vm.ConfirmText = message;
- dialog.DataContext = vm;
- if (dialog.ShowDialog() == true)
- {
- if ((bool)dialog.AlignFlag == true && !string.IsNullOrEmpty(dialog.Angle))
- {
- angel = Convert.ToDouble(dialog.Angle);
- }
- if ((bool)dialog.CoolingFlag == true && !string.IsNullOrEmpty(dialog.CoolingTime))
- {
- coolingtime = Convert.ToDouble(dialog.CoolingTime);
- }
- InvokeClient.Instance.Service.DoOperation("System.ReturnAllSEWafer", dialog.CoolingFlag, coolingtime, dialog.AlignFlag, angel);
- }
- }
- private void OnCreateJob(object obj)
- {
- var info = obj as WaferAssociationInfo;
- List<string> slotSequence = new List<string>();
- info.ModuleData.WaferManager.Wafers.ForEach(key => { slotSequence.Insert(0, key.SequenceName); });
- string jobId = info.LotId.Trim();
- if (string.IsNullOrEmpty(jobId))
- jobId = "CJ_Local_" + info.ModuleData.ModuleID;
- info.LotId = jobId;
- info.JobID = jobId;
- info.JobStatus = "WaitingForStart";
- info.LotIdSaved = true;
- Dictionary<string, object> param = new Dictionary<string, object>()
- {
- {"JobId", jobId},
- {"Module", info.ModuleData.ModuleID},
- {"SlotSequence", slotSequence.ToArray()},
- {"AutoStart", true},
- { "PreCleanRecipeName",info.PreCleanRecipeName},
- { "PostCleanRecipeName",info.PostCleanRecipeName}
- };
- InvokeClient.Instance.Service.DoOperation("System.CreateSEJob", param);
- }
- private void OnSetSequence(object obj)
- {
- var info = obj as WaferInfo;
- bool flag = info.SequenceName != "" ? false : true;
- if (info.ModuleID == "LP1")
- {
- AssociateSequence(VCEwaferAssociation, flag, info.SlotID);
- }
- }
- private void OnPauseAllJob()
- {
- InvokeClient.Instance.Service.DoOperation("System.PauseJob", VCEwaferAssociation.JobID);
- }
- private void OnAbortAll()
- {
- InvokeClient.Instance.Service.DoOperation("System.SEAbort");
- }
- private void AssociateSequence(WaferAssociationInfo info, bool flag, int slot = -1)
- {
- List<WaferInfo> wafers = info.ModuleData.WaferManager.Wafers;
- if (slot >= 0) //by wafer
- {
- int index = wafers.Count - slot - 1;
- if (index < wafers.Count)
- {
- //has wafer
- if (flag && !(wafers[index].WaferStatus == 0))
- wafers[index].SequenceName = info.SequenceName;
- else
- wafers[index].SequenceName = string.Empty;
- }
- }
- else //by from-to
- {
- for (int i = info.SlotFrom - 1; i < info.SlotTo; i++)
- {
- int index = wafers.Count - i - 1;
- if (index < wafers.Count)
- {
- if (flag && !(wafers[index].WaferStatus == 0))
- wafers[index].SequenceName = info.SequenceName;
- else
- wafers[index].SequenceName = string.Empty;
- }
- }
- }
- if (VCEIsInstalled)
- {
- VCEwaferAssociation = info;
- }
- }
- private void addDataKeys()
- {
- m_RtDataKeys.Add($"TM.VCESlitDoorClosed");
- m_RtDataKeys.Add($"TM.PMASlitDoorClosed");
- m_RtDataKeys.Add($"TM.PMBSlitDoorClosed");
- m_RtDataKeys.Add($"TM.PMCSlitDoorClosed");
- m_RtDataKeys.Add($"TM.VCEPressure.Value");
- m_RtDataKeys.Add($"TM.TMPressure.Value");
- m_RtDataKeys.Add($"VCE1.VCEOutDoorClosed");
- m_RtDataKeys.Add($"VCE1.CassetteArrive");
- m_RtDataKeys.Add("LP1.CycledCount");
- m_RtDataKeys.Add("LP1.CycledWafer");
- m_RtDataKeys.Add("LP1.CycleSetPoint");
- m_RtDataKeys.Add("LP1.Throughput");
- m_RtDataKeys.Add($"PMA.ChamberPressure");
- m_RtDataKeys.Add($"PMA.VentingFlag");
- m_RtDataKeys.Add($"PMA.CurrentRecipeResult");
- m_RtDataKeys.Add($"PMB.ChamberPressure");
- m_RtDataKeys.Add($"PMB.VentingFlag");
- m_RtDataKeys.Add($"PMB.CurrentRecipeResult");
- m_RtDataKeys.Add($"PMC.ChamberPressure");
- m_RtDataKeys.Add($"PMC.VentingFlag");
- m_RtDataKeys.Add($"PMC.CurrentRecipeResult");
- m_RtDataKeys.Add($"TM.TMIsATM");
- m_RtDataKeys.Add($"TM.VCEIsATM");
- m_RtDataKeys.Add("System.IsAutoMode");
- m_RtDataKeys.Add("System.IsBusy");
- m_RtDataKeys.Add($"TM.IsOnline");
- m_RtDataKeys.Add($"VCE1.IsOnline");
- m_RtDataKeys.Add($"PMA.IsOnline");
- m_RtDataKeys.Add($"PMB.IsOnline");
- m_RtDataKeys.Add($"PMC.IsOnline");
- //if (PMAIsInstalled)
- //{
- // m_RtDataKeys.Add($"PMA.ChamberPressure");
- // m_RtDataKeys.Add($"PMA.VentingFlag");
- // m_RtDataKeys.Add($"PMA.CurrentRecipeResult");
- //}
- //if (PMBIsInstalled)
- //{
- // m_RtDataKeys.Add($"PMB.ChamberPressure");
- // m_RtDataKeys.Add($"PMB.VentingFlag");
- // m_RtDataKeys.Add($"PMB.CurrentRecipeResult");
- //}
- //if (PMCIsInstalled)
- //{
- // m_RtDataKeys.Add($"PMC.ChamberPressure");
- // m_RtDataKeys.Add($"PMC.VentingFlag");
- // m_RtDataKeys.Add($"PMC.CurrentRecipeResult");
- //}
- }
- private void onHomeAll()
- {
- InvokeClient.Instance.Service.DoOperation("System.HomeAll");
- }
- private void onSetAutoMode()
- {
- InvokeClient.Instance.Service.DoOperation("System.SetAutoMode");
- }
- private void onSetManualMode()
- {
- InvokeClient.Instance.Service.DoOperation("System.SetManualMode");
- }
- private void onStopCycle()
- {
- InvokeClient.Instance.Service.DoOperation("System.StopSECycle");
- }
- private void onStartSETMCycle()
- {
- List<string> stations = new List<string>();
- stations.Add("VCE1");
- stations.Add("Aligner1");
- if (PMAIsInstalled)
- {
- stations.Add("PMA");
- }
- if (PMBIsInstalled)
- {
- stations.Add("PMB");
- }
- if (PMCIsInstalled)
- {
- stations.Add("PMC");
- }
- stations.Add("VCE1");
- InvokeClient.Instance.Service.DoOperation("System.SETMCycle", stations.ToArray(), 1);
- }
- private void OnStart(object obj)
- {
- var info = obj as WaferAssociationInfo;
- InvokeClient.Instance.Service.DoOperation("System.StartSEJob", info.LotId);
- }
- private void vceHome()
- {
- InvokeClient.Instance.Service.DoOperation("VCE1.HOME");
- }
- private void vceReadMap()
- {
- InvokeClient.Instance.Service.DoOperation("VCE1.ReadMap");
- }
- private void vceLoadPrepare()
- {
- InvokeClient.Instance.Service.DoOperation("VCE1.LoadPrepare");
- }
- private void vceLoad()
- {
- InvokeClient.Instance.Service.DoOperation("VCE1.SafeLoad");
- }
- private void vceLoadWithSMIF()
- {
- InvokeClient.Instance.Service.DoOperation("VCE1.LoadWithSMIF");
- }
- private void vceUnLoadWithSMIF()
- {
- InvokeClient.Instance.Service.DoOperation("VCE1.UnLoadWithSMIF");
- }
- private void vceUnLoad()
- {
- InvokeClient.Instance.Service.DoOperation("VCE1.SafeUnload");
- }
- private void smifLoad() { }
- private void smifUnLoad() { }
- private void tmhome()
- {
- InvokeClient.Instance.Service.DoOperation("TM.Home");
- }
- private void tmpick()
- {
- ModuleName target = ModuleName.VCE1;
- int slot = PickNum;
- MoveItem moveItem = new MoveItem(target, slot - 1, ModuleName.TMRobot, 0, 0);
- Queue<MoveItem> que = new Queue<MoveItem>();
- que.Enqueue(moveItem);
- InvokeClient.Instance.Service.DoOperation("TM.Pick", que);
- }
- private void tmplace()
- {
- ModuleName target = ModuleName.VCE1;
- int slot = PickNum;
- MoveItem moveItem = new MoveItem(ModuleName.TMRobot, 0, target, slot - 1, 0);
- Queue<MoveItem> que = new Queue<MoveItem>();
- que.Enqueue(moveItem);
- InvokeClient.Instance.Service.DoOperation("TM.Place", que);
- }
- #endregion
- #region 私有方法
- private void Timer_Tick(object sender, EventArgs e)
- {
- try
- {
- RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
- VCEDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.VCESlitDoorClosed");
- PMADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMASlitDoorClosed");
- PMBDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMBSlitDoorClosed");
- PMCDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMCSlitDoorClosed");
- VCEOutDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "VCE1.VCEOutDoorClosed");
- VCEPercent = CommonFunction.GetValue<double>(RtDataValues, "TM.VCEPressure.Value") * 260 / 750000;
- TMIsVAC = (CommonFunction.GetValue<int>(RtDataValues, "TM.TMPressure.Value") < Convert.ToInt32(QueryDataClient.Instance.Service.GetConfig($"TM.VACTargetPressure")));
- VCE1IsVAC = (CommonFunction.GetValue<int>(RtDataValues, "TM.VCEPressure.Value") < Convert.ToInt32(QueryDataClient.Instance.Service.GetConfig($"VCE1.VACTargetPressure")));
- if (PMAIsInstalled == true)
- {
- PMAModuleInfo = ModuleManager.ModuleInfos["PMA"];
- PMAWafer = PMAModuleInfo.WaferManager.Wafers[0];
- PMAPercent = CommonFunction.GetValue<double>(RtDataValues, "PMA.ChamberPressure") * 260 / 750000;
- PMARecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, "PMA.CurrentRecipeResult");
- }
- if (PMBIsInstalled == true)
- {
- PMBModuleInfo = ModuleManager.ModuleInfos["PMB"];
- PMBWafer = PMBModuleInfo.WaferManager.Wafers[0];
- PMBPercent = CommonFunction.GetValue<double>(RtDataValues, "PMB.ChamberPressure") * 260 / 750000;
- PMBRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, "PMB.CurrentRecipeResult");
- }
- if (PMCIsInstalled == true)
- {
- PMCModuleInfo = ModuleManager.ModuleInfos["PMC"];
- PMCWafer = PMCModuleInfo.WaferManager.Wafers[0];
- PMCPercent = CommonFunction.GetValue<double>(RtDataValues, "PMC.ChamberPressure") * 260 / 750000;
- PMCRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, "PMC.CurrentRecipeResult");
- }
- if (VCEIsInstalled == true)
- {
- VCE1ModuleInfo = ModuleManager.ModuleInfos["LP1"];
- }
- RobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction");
- PAWafer = ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers[0];
- TMModuleInfo = ModuleManager.ModuleInfos["TMRobot"];
- 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();
- }
- catch
- {
- }
- }
- #endregion
- 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 SERobotTAction = (SERobotTAction)Enum.Parse(typeof(SERobotTAction), module, true);
- if (SERobotTAction != Robot1TAction || SERobotTAction != Robot2TAction)
- {
- Robot1TAction = SERobotTAction;
- Robot2TAction = SERobotTAction;
- }
- }
- #endregion
- #region Aligner1、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 == "Aligner1")
- {
- module = PMCIsInstalled ? "Aligner1" : "VPARight";
- }
- var SERobotTAction = (SERobotTAction)Enum.Parse(typeof(SERobotTAction), module, true);
- if (SERobotTAction != Robot1TAction || SERobotTAction != Robot2TAction)
- {
- Robot1TAction = SERobotTAction;
- Robot2TAction = SERobotTAction;
- }
- if (arm == "ArmA")
- {
- await Task.Delay(600);
- if (module == "VCE1")
- {
- Robot1XAction = SERobotXAction.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 = SERobotXAction.FromVCE;
- }
- else if (module == "Aligner1" || module == "VPARight")
- {
- Robot1XAction = SERobotXAction.ToAligner;
- 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.FromAligner;
- }
- 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")
- {
- await Task.Delay(600);
- if (module == "VCE1")
- {
- Robot2XAction = SERobotXAction.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 = SERobotXAction.FromVCE2;
- }
- else if (module == "Aligner1" || module == "VPARight")
- {
- Robot2XAction = SERobotXAction.ToAligner2;
- 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.FromAligner2;
- }
- 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];
- var SERobotTAction = (SERobotTAction)Enum.Parse(typeof(SERobotTAction), module, true);
- if (SERobotTAction != Robot1TAction || SERobotTAction != Robot2TAction)
- {
- Robot1TAction = SERobotTAction;
- Robot2TAction = SERobotTAction;
- }
- if (arm == "ArmA")
- {
- await Task.Delay(600);
- Robot1XAction = SERobotXAction.Extend;
- }
- else if (arm == "ArmB")
- {
- 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")
- {
- await Task.Delay(100);
- Robot1XAction = SERobotXAction.Retract;
- }
- else if (arm == "ArmB")
- {
- await Task.Delay(100);
- 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
- }
- }
- }
|