123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377 |
- 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 System.Security.RightsManagement;
- using System.Collections.ObjectModel;
- using Aitex.Core.Util;
- using static Venus_MainPages.ViewModels.VenusDETMViewModel;
- using static Venus_Themes.CustomControls.DERobot;
- using MECF.Framework.Common.Jobs;
- using Aitex.Core.RT.Log;
- using Venus_Themes.UserControls;
- namespace Venus_MainPages.ViewModels
- {
- public class VenusDeOperationOverViewModel : BindableBase
- {
- #region 私有字段
- private ModuleInfo m_VCEAModuleInfo;
- private ModuleInfo m_VCEBModuleInfo;
- private ModuleInfo m_PMAModuleInfo;
- private ModuleInfo m_PMBModuleInfo;
- private ModuleInfo m_PMCModuleInfo;
- private ModuleInfo m_PMDModuleInfo;
- private ModuleInfo m_AlignerModuleInfo;
- private ModuleInfo m_TMModuleInfo;
- public WaferInfo m_PMAWafer;
- public WaferInfo m_PMBWafer;
- public WaferInfo m_PMCWafer;
- public WaferInfo m_PMDWafer;
- public WaferInfo m_RobotUpperWafer;
- public WaferInfo m_RobotLowerWafer;
- public WaferInfo m_PAWafer;
- private DERobotTAction m_Robot1TAction;
- private DERobotXAction m_Robot1XAction;
- private DERobotTAction m_Robot2TAction;
- private DERobotXAction m_Robot2XAction;
- public RobotMoveInfo m_robotMoveInfo;
- private int m_VCEAWaferCount;
- private int m_VCEBWaferCount;
- 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_ButtonIsEnableVCEA;
- private bool m_ButtonIsEnableVCEB;
- private bool m_VCEADoorIsOpen;
- private bool m_VCEBDoorIsOpen;
- private bool m_PMADoorIsOpen;
- private bool m_PMBDoorIsOpen;
- private bool m_PMCDoorIsOpen;
- private bool m_PMDDoorIsOpen;
- private bool m_VCEAOutDoorIsOpen;
- private bool m_VCEBOutDoorIsOpen;
- private bool m_IsAlignerOnRight;
- 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_PMDPercent;
- private double m_VCEAPercent;
- private double m_VCEBPercent;
- private int m_PickNum;
- private RecipeResult m_PMARecipeResult;
- private RecipeResult m_PMBRecipeResult;
- private RecipeResult m_PMCRecipeResult;
- private RecipeResult m_PMDRecipeResult;
- private WaferAssociationInfo m_VCEAwaferAssociation;
- private WaferAssociationInfo m_VCEBwaferAssociation;
- private bool loadflag;
- private bool m_NeedAutoUnLoad;
- private bool m_IsCycleInfoVisibility;
- private bool m_TMIsVAC;
- private bool m_VCEAIsVAC;
- private bool m_VCEBIsVAC;
- private string m_PMAChamberLabel;
- private string m_PMBChamberLabel;
- private string m_PMCChamberLabel;
- private string m_PMDChamberLabel;
- private int m_CurrentSlotA;
- private int m_CurrentSlotB;
- private ObservableCollection<int> m_VCEASlots = new ObservableCollection<int>();
- private ObservableCollection<int> m_VCEBSlots = new ObservableCollection<int>();
- #endregion
- #region 属性
- public bool IsAligner1OnRight
- {
- get => m_IsAlignerOnRight;
- set => SetProperty(ref m_IsAlignerOnRight, value);
- }
- public int CurrentSlotA
- {
- get { return m_CurrentSlotA; }
- set { SetProperty(ref m_CurrentSlotA, value); }
- }
- public int CurrentSlotB
- {
- get { return m_CurrentSlotB; }
- set { SetProperty(ref m_CurrentSlotB, value); }
- }
- public ObservableCollection<int> VCEASlots
- {
- get { return m_VCEASlots; }
- set { SetProperty(ref m_VCEASlots, value); }
- }
- public ObservableCollection<int> VCEBSlots
- {
- get { return m_VCEBSlots; }
- set { SetProperty(ref m_VCEBSlots, value); }
- }
- public bool NeedAutoUnLoad
- {
- get { return m_NeedAutoUnLoad; }
- set { SetProperty(ref m_NeedAutoUnLoad, value); }
- }
- public bool IsCycleInfoVisibility
- {
- get { return m_IsCycleInfoVisibility; }
- set { SetProperty(ref m_IsCycleInfoVisibility, value); }
- }
- public bool TMIsVAC
- {
- get { return m_TMIsVAC; }
- set { SetProperty(ref m_TMIsVAC, value); }
- }
- public bool VCEAIsVAC
- {
- get { return m_VCEAIsVAC; }
- set { SetProperty(ref m_VCEAIsVAC, value); }
- }
- public bool VCEBIsVAC
- {
- get { return m_VCEBIsVAC; }
- set { SetProperty(ref m_VCEBIsVAC, 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 DERobotTAction 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 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);
- }
- }
- 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 RecipeResult PMDRecipeResult
- {
- get { return m_PMDRecipeResult; }
- set { SetProperty(ref m_PMDRecipeResult, 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 PMDPercent
- {
- get { return m_PMDPercent; }
- set { SetProperty(ref m_PMDPercent, value); }
- }
- public double VCEAPercent
- {
- get { return m_VCEAPercent; }
- set { SetProperty(ref m_VCEAPercent, value); }
- }
- public double VCEBPercent
- {
- get { return m_VCEBPercent; }
- set { SetProperty(ref m_VCEBPercent, 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 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 ModuleInfo VCEAModuleInfo
- {
- get { return m_VCEAModuleInfo; }
- set
- {
- SetProperty(ref m_VCEAModuleInfo, value);
- }
- }
- public ModuleInfo VCEBModuleInfo
- {
- get { return m_VCEBModuleInfo; }
- set
- {
- SetProperty(ref m_VCEBModuleInfo, 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 PMDModuleInfo
- {
- get { return m_PMDModuleInfo; }
- set
- {
- SetProperty(ref m_PMDModuleInfo, value);
- }
- }
- public ModuleInfo AlignerModuleInfo
- {
- 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 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 ButtonIsEnableVCEA
- {
- get { return m_ButtonIsEnableVCEA; }
- set { SetProperty(ref m_ButtonIsEnableVCEA, value); }
- }
- public bool ButtonIsEnableVCEB
- {
- get { return m_ButtonIsEnableVCEB; }
- set { SetProperty(ref m_ButtonIsEnableVCEB, 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 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 PMDDoorIsOpen { get => m_PMDDoorIsOpen; set => SetProperty(ref m_PMDDoorIsOpen, 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 int VCEAWaferCount
- {
- get { return m_VCEAWaferCount; }
- set
- {
- SetProperty(ref m_VCEAWaferCount, value);
- }
- }
- public int VCEBWaferCount
- {
- get { return m_VCEBWaferCount; }
- set
- {
- SetProperty(ref m_VCEBWaferCount, value);
- }
- }
- public Dictionary<string, object> RtDataValues
- {
- get { return m_RtDataValues; }
- set { SetProperty(ref m_RtDataValues, value); }
- }
- public WaferAssociationInfo VCEAwaferAssociation
- {
- get { return m_VCEAwaferAssociation; }
- set { SetProperty(ref m_VCEAwaferAssociation, value); }
- }
- public WaferAssociationInfo VCEBwaferAssociation
- {
- get { return m_VCEBwaferAssociation; }
- set { SetProperty(ref m_VCEBwaferAssociation, 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<object> _StopCommand;
- public DelegateCommand<object> StopCommand =>
- _StopCommand ?? (_StopCommand = new DelegateCommand<object>(OnStop));
- private DelegateCommand<object> _AbortCommand;
- public DelegateCommand<object> AbortCommand =>
- _AbortCommand ?? (_AbortCommand = new DelegateCommand<object>(OnAbort));
- private DelegateCommand _StopCycle;
- public DelegateCommand StopCycle => _StopCycle ?? (_StopCycle = new DelegateCommand(onStopCycle));
- private DelegateCommand<object> _VCEHome;
- public DelegateCommand<object> VCEHome => _VCEHome ?? (_VCEHome = new DelegateCommand<object>(vceHome));
- private DelegateCommand<object> _VCEReadMap;
- public DelegateCommand<object> VCEReadMap => _VCEReadMap ?? (_VCEReadMap = new DelegateCommand<object>(vceReadMap));
- private DelegateCommand<object> _VCELoadPrepare;
- public DelegateCommand<object> VCELoadPrepare =>
- _VCELoadPrepare ?? (_VCELoadPrepare = new DelegateCommand<object>(vceLoadPrepare));
- private DelegateCommand<object> __VCELoad;
- public DelegateCommand<object> VCELoad =>
- __VCELoad ?? (__VCELoad = new DelegateCommand<object>(vceLoad));
- private DelegateCommand<object> __VCELoadWithSMIF;
- public DelegateCommand<object> VCELoadWithSMIF =>
- __VCELoadWithSMIF ?? (__VCELoadWithSMIF = new DelegateCommand<object>(vceLoadWithSMIF));
- private DelegateCommand<object> __VCEUnLoadWithSMIF;
- public DelegateCommand<object> VCEUnLoadWithSMIF =>
- __VCEUnLoadWithSMIF ?? (__VCEUnLoadWithSMIF = new DelegateCommand<object>(vceUnLoadWithSMIF));
- private DelegateCommand<object> _VCEUnLoad;
- public DelegateCommand<object> VCEUnLoad =>
- _VCEUnLoad ?? (_VCEUnLoad = new DelegateCommand<object>(vceUnLoad));
- private DelegateCommand<object> _VCEOpen;
- public DelegateCommand<object> VCEOpen =>
- _VCEOpen ?? (_VCEOpen = new DelegateCommand<object>(vceOpen));
- 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 VenusDeOperationOverViewModel()
- {
- //页面不刷错的方法 页面中的PM做成List的形式 通过itemsource显示 同时提供各个位置的pm点位 旋转角度
- VCEAWaferCount = 25;
- VCEBWaferCount = 25;
- string[] allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString().Split(',');
- IsCycleInfoVisibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.IsCycleMode");
- NeedAutoUnLoad = (bool)QueryDataClient.Instance.Service.GetConfig($"System.IsAutoUnload");
- PMAIsInstalled = allModules.Contains("PMA");
- PMBIsInstalled = allModules.Contains("PMB");
- PMCIsInstalled = allModules.Contains("PMC");
- PMDIsInstalled = allModules.Contains("PMD");
- VCEAIsInstalled = allModules.Contains("VCEA");
- VCEBIsInstalled = allModules.Contains("VCEB");
- IsAligner1OnRight = true;
- if (PMDIsInstalled == true)
- {
- IsAligner1OnRight = false;
- }
- addDataKeys();
- RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
- VCEADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.VCESlitDoorClosed");
- VCEBDoorIsOpen = !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");
- PMDDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.PMDSlitDoorClosed");
- VCEAOutDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "VCEA.VCEOutDoorClosed");
- VCEBOutDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "VCEB.VCEOutDoorClosed");
- for (int i = 26; i >= 1; --i)
- {
- if (i == 26)
- {
- VCEASlots.Add(0);
- VCEBSlots.Add(0);
- }
- else
- {
- VCEASlots.Add(i);
- VCEBSlots.Add(i);
- }
- }
- loadflag = false;
- DispatcherTimer timer = new DispatcherTimer();
- timer.Interval = TimeSpan.FromSeconds(0.1);
- timer.Tick += Timer_Tick;
- timer.Start();
- }
- #endregion
- #region 命令实现
- private void OnLoad()
- {
- if (!loadflag)
- {
- if (VCEAIsInstalled && VCEAwaferAssociation == null)
- {
- VCEAwaferAssociation = new WaferAssociationInfo
- {
- ModuleData = ModuleManager.ModuleInfos["LP1"]
- };
- }
- if (VCEBIsInstalled && VCEBwaferAssociation == null)
- {
- VCEBwaferAssociation = new WaferAssociationInfo
- {
- ModuleData = ModuleManager.ModuleInfos["LP2"]
- };
- }
- loadflag = true;
- }
- }
- private void OnResumeAllJob()
- {
- var t = CommonFunction.GetValue<List<string>>(RtDataValues, "Scheduler.PjNameList");
- if (t == null && t.Count == 0)
- {
- return;
- }
- if (CommonFunction.GetValue<int>(RtDataValues, "EquipmentStatus") == 4)
- {
- t.ForEach(x =>
- {
- InvokeClient.Instance.Service.DoOperation("System.ResumeJob", x);
- });
- }
- else
- {
- t.ForEach(x =>
- {
- InvokeClient.Instance.Service.DoOperation("System.PauseJob", x);
- });
- }
- }
- private void OnAbortJob(object obj)
- {
- InvokeClient.Instance.Service.DoOperation("System.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(VCEAwaferAssociation, flag, info.SlotID);
- }
- if (info.ModuleID == "LP2")
- {
- AssociateSequence(VCEBwaferAssociation, flag, info.SlotID);
- }
- }
- private void OnPauseAllJob()
- {
- }
- private void OnAbortAll()
- {
- ControlJobInfo lp1Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP1.CurrentControlJob");
- UPdateWaferAssociation(VCEAwaferAssociation, lp1Cj);
- ControlJobInfo lp2Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP2.CurrentControlJob");
- UPdateWaferAssociation(VCEBwaferAssociation, lp2Cj);
- InvokeClient.Instance.Service.DoOperation("System.Abort");
- }
- 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;
- }
- }
- }
- }
- private void addDataKeys()
- {
- 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($"TM.TMPressure.Value");
- m_RtDataKeys.Add($"TM.VCEAPressure.Value");
- m_RtDataKeys.Add($"TM.VCEBPressure.Value");
- m_RtDataKeys.Add($"TM.IsOnline");
- m_RtDataKeys.Add($"VCEA.VCEOutDoorClosed");
- m_RtDataKeys.Add($"VCEA.IsOnline");
- m_RtDataKeys.Add($"LP1.CassettePlaced");
- m_RtDataKeys.Add($"LP1.CurrentControlJob");
- m_RtDataKeys.Add($"VCEB.VCEOutDoorClosed");
- m_RtDataKeys.Add($"VCEB.IsOnline");
- m_RtDataKeys.Add($"LP2.CassettePlaced");
- m_RtDataKeys.Add($"LP2.CurrentControlJob");
- //m_RtDataKeys.Add($"SEScheduler.CycledWafer");
- //m_RtDataKeys.Add($"SEScheduler.CycleSetPoint");
- //m_RtDataKeys.Add($"SEScheduler.CycleCount");
- //m_RtDataKeys.Add($"SEScheduler.ThroughPut");
- m_RtDataKeys.Add($"PMA.ChamberPressure");
- m_RtDataKeys.Add($"PMA.VentingFlag");
- m_RtDataKeys.Add($"PMA.CurrentRecipeResult");
- m_RtDataKeys.Add($"PMA.IsOnline");
- m_RtDataKeys.Add($"PMB.ChamberPressure");
- m_RtDataKeys.Add($"PMB.VentingFlag");
- m_RtDataKeys.Add($"PMB.CurrentRecipeResult");
- m_RtDataKeys.Add($"PMB.IsOnline");
- m_RtDataKeys.Add($"PMC.ChamberPressure");
- m_RtDataKeys.Add($"PMC.VentingFlag");
- m_RtDataKeys.Add($"PMC.CurrentRecipeResult");
- m_RtDataKeys.Add($"PMC.IsOnline");
- m_RtDataKeys.Add($"PMD.ChamberPressure");
- m_RtDataKeys.Add($"PMD.VentingFlag");
- m_RtDataKeys.Add($"PMD.CurrentRecipeResult");
- m_RtDataKeys.Add($"PMD.IsOnline");
- m_RtDataKeys.Add($"VCEA.CurrentSlot");
- m_RtDataKeys.Add($"VCEB.CurrentSlot");
- m_RtDataKeys.Add($"TM.TMIsATM");
- m_RtDataKeys.Add($"TM.VCEAIsATM");
- m_RtDataKeys.Add($"TM.VCEBIsATM");
- m_RtDataKeys.Add("System.IsAutoMode");
- m_RtDataKeys.Add("System.IsBusy");
- m_RtDataKeys.Add("LP1.CycledCount");
- m_RtDataKeys.Add("LP1.CycledWafer");
- m_RtDataKeys.Add("LP1.CycleSetPoint");
- m_RtDataKeys.Add("LP1.Throughput");
- m_RtDataKeys.Add("LP2.CycledCount");
- m_RtDataKeys.Add("LP2.CycledWafer");
- m_RtDataKeys.Add("LP2.CycleSetPoint");
- m_RtDataKeys.Add("LP2.Throughput");
- //m_RtDataKeys.Add("EquipmentStatus");
- m_RtDataKeys.Add("Scheduler.PjNameList");
- //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("VCEA");
- stations.Add("Aligner1");
- if (PMAIsInstalled)
- {
- stations.Add("PMA");
- }
- if (PMBIsInstalled)
- {
- stations.Add("PMB");
- }
- if (PMCIsInstalled)
- {
- stations.Add("PMC");
- }
- if (PMCIsInstalled)
- {
- stations.Add("PMD");
- }
- stations.Add("VCEA");
- 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 OnStop(object obj)
- {
- var info = obj as WaferAssociationInfo;
- InvokeClient.Instance.Service.DoOperation("System.StopJob", info.JobID);
- }
- private void OnAbort(object obj)
- {
- var info = obj as WaferAssociationInfo;
- InvokeClient.Instance.Service.DoOperation("System.AbortJob", info.JobID);
- }
- private void UPdateWaferAssociation(WaferAssociationInfo info, ControlJobInfo cjInfo)
- {
- if (info == null)
- {
- return;
- }
- if (cjInfo != null)
- {
- info.LotId = cjInfo.Name;
- info.JobID = cjInfo.Name;
- info.JobStatus = cjInfo.State.ToString();
- if (cjInfo.SequenceNameList != null)
- {
- for (int i = 0; i < cjInfo.SequenceNameList.Length; i++)
- {
- info.ModuleData.WaferManager.Wafers[24 - i].SequenceName = cjInfo.SequenceNameList[i];
- }
- }
- info.PreCleanRecipeName = cjInfo.PreJobClean;
- info.PostCleanRecipeName = cjInfo.PostJobClean;
- }
- else
- {
- if (!string.IsNullOrEmpty(info.JobID))
- {
- info.LotId = "";
- info.JobID = "";
- info.JobStatus = "";
- //info.PreCleanRecipeName = "";
- //info.PostCleanRecipeName = "";
- AssociateSequence(info, false);
- }
- }
- }
- private void vceHome(object obj)
- {
- InvokeClient.Instance.Service.DoOperation($"{obj}.HOME");
- }
- private void vceReadMap(object obj)
- {
- InvokeClient.Instance.Service.DoOperation($"{obj}.ReadMap");
- }
- private void vceLoadPrepare(object obj)
- {
- InvokeClient.Instance.Service.DoOperation($"{obj}.LoadPrepare");
- }
- private void vceLoad(object obj)
- {
- InvokeClient.Instance.Service.DoOperation($"{obj}.SafeLoad");
- }
- private void vceLoadWithSMIF(object obj)
- {
- InvokeClient.Instance.Service.DoOperation($"{obj}.LoadWithSMIF");
- }
- private void vceUnLoadWithSMIF(object obj)
- {
- InvokeClient.Instance.Service.DoOperation($"{obj}.UnLoadWithSMIF");
- }
- private void vceUnLoad(object obj)
- {
- InvokeClient.Instance.Service.DoOperation($"{obj}.SafeUnload");
- }
- private void vceOpen(object obj)
- {
- string[] param = obj.ToString().Split(',');
- if (param[1] == "0")
- InvokeClient.Instance.Service.DoOperation($"{param[0]}.DoorClose");
- else
- InvokeClient.Instance.Service.DoOperation($"{param[0]}.DoorOpen");
- }
- 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);
- IsCycleInfoVisibility = (bool)QueryDataClient.Instance.Service.GetConfig($"System.IsCycleMode");
- VCEADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.VCEASlitDoorClosed");
- VCEBDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "TM.VCEBSlitDoorClosed");
- 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");
- VCEAOutDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "VCEA.VCEOutDoorClosed");
- VCEBOutDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "VCEB.VCEOutDoorClosed");
- VCEAPercent = CommonFunction.GetValue<double>(RtDataValues, "TM.VCEAPressure.Value") * 260 / 750000;
- VCEBPercent = CommonFunction.GetValue<double>(RtDataValues, "TM.VCEBPressure.Value") * 260 / 750000;
- CurrentSlotA = CommonFunction.GetValue<int>(RtDataValues, "VCEA.CurrentSlot");
- CurrentSlotB = CommonFunction.GetValue<int>(RtDataValues, "VCEB.CurrentSlot");
- TMIsVAC = (CommonFunction.GetValue<int>(RtDataValues, "TM.TMPressure.Value") < Convert.ToInt32(QueryDataClient.Instance.Service.GetConfig($"TM.VACTargetPressure")));
- VCEAIsVAC = (CommonFunction.GetValue<int>(RtDataValues, "TM.VCEAPressure.Value") < Convert.ToInt32(QueryDataClient.Instance.Service.GetConfig($"VCEA.VACTargetPressure")));
- VCEBIsVAC = (CommonFunction.GetValue<int>(RtDataValues, "TM.VCEBPressure.Value") < Convert.ToInt32(QueryDataClient.Instance.Service.GetConfig($"VCEB.VACTargetPressure")));
- 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();
- 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 (PMDIsInstalled == true)
- {
- PMDModuleInfo = ModuleManager.ModuleInfos["PMD"];
- PMDWafer = PMDModuleInfo.WaferManager.Wafers[0];
- PMDPercent = CommonFunction.GetValue<double>(RtDataValues, "PMD.ChamberPressure") * 260 / 750000;
- PMDRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, "PMD.CurrentRecipeResult");
- }
- if (VCEAIsInstalled == true)
- {
- VCEAModuleInfo = ModuleManager.ModuleInfos["LP1"];
- ControlJobInfo lp1Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP1.CurrentControlJob");
- if (lp1Cj != null)
- ButtonIsEnableVCEA = false;
- else
- ButtonIsEnableVCEA = true;
- UPdateWaferAssociation(VCEAwaferAssociation, lp1Cj);
- }
- if (VCEBIsInstalled == true)
- {
- VCEBModuleInfo = ModuleManager.ModuleInfos["LP2"];
- ControlJobInfo lp2Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP2.CurrentControlJob");
- if (lp2Cj != null)
- ButtonIsEnableVCEB = false;
- else
- ButtonIsEnableVCEB = true;
- UPdateWaferAssociation(VCEBwaferAssociation, lp2Cj);
- }
- 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];
- }
- 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 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];
- 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
- }
- }
- }
|