123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626 |
- using Aitex.Core.RT.Log;
- using MECF.Framework.Common.CommonData;
- using MECF.Framework.Common.DataCenter;
- using MECF.Framework.Common.Jobs;
- 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.Threading.Tasks;
- using System.Windows;
- using System.Windows.Threading;
- using Venus_Core;
- using Venus_MainPages.Unity;
- using Venus_MainPages.Views;
- using static Venus_Core.NiceRobotAction;
- namespace Venus_MainPages.ViewModels
- {
- public class OperationOverViewModel : BindableBase
- {
- #region 私有字段
- private bool m_TabIsChecked = true;
- private ModuleInfo m_LP1ModuleInfo;
- private ModuleInfo m_LP2ModuleInfo;
- private ModuleInfo m_LLAModuleInfo;
- private ModuleInfo m_LLBModuleInfo;
- private ModuleInfo m_LP3ModuleInfo;
- private ModuleInfo m_EFEMModuleInfo;
- private ModuleInfo m_TMModuleInfo;
- //private WaferRobotTAction m_Robot1TAction;
- //private WaferRobotXAction m_Robot1XAction;
- //private WaferRobotTAction m_Robot2TAction;
- //private WaferRobotXAction m_Robot2XAction;
- //private WaferRobotTAction m_Robot3TAction;
- //private WaferRobotXAction m_Robot3XAction;
- //private WaferRobotTAction m_Robot4TAction;
- //private WaferRobotXAction m_Robot4XAction;
- private NiceGuangChuanWaferRobotTAction m_BladeNiceGuangChuanWaferRobotTAction;
- //private NiceGuangChuanWaferRobotTAction m_Blade2NiceGuangChuanWaferRobotTAction;
- private NiceGuangChuanWaferRobotXAction m_Blade1NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract1;
- private NiceGuangChuanWaferRobotXAction m_Blade2NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract2;
- private NiceXinSongWaferRobotTAction m_BladeNiceXinSongWaferRobotTAction;
- //private NiceXinSongWaferRobotTAction m_Blade2NiceXinSongWaferRobotTAction;
- private NiceXinSongWaferRobotXAction m_Blade1NiceXinSongWaferRobotXAction;
- private NiceXinSongWaferRobotXAction m_Blade2NiceXinSongWaferRobotXAction;
- private RobotMoveInfo m_robotMoveInfo;
- private WaferInfo m_PMAWafer;
- private WaferInfo m_PMBWafer;
- private WaferInfo m_PMCWafer;
- private WaferInfo m_PMDWafer;
- private WaferInfo m_LLAWafer;
- private WaferInfo m_LLBWafer;
- private WaferInfo m_TMBladeAWafer;
- private WaferInfo m_TMBladeBWafer;
- private List<string> m_RtDataKeys = new List<string>();
- private Dictionary<string, object> m_RtDataValues;
- private bool m_PMAIsInstalled;
- private bool m_PMBIsInstalled;
- private bool m_PMCIsInstalled;
- private bool m_PMDIsInstalled;
- private bool m_LLAIsInstalled;
- private bool m_LLBIsInstalled;
- private bool m_TMIsInstalled;
- private bool m_EFEMIsInstalled;
- private bool m_ButtonIsEnableLP1;
- private bool m_ButtonIsEnableLP2;
- private bool m_ButtonIsEnableLP3;
- private WaferInfo m_EFEMBladeAWafer;
- private WaferInfo m_EFEMBladeBWafer;
- private WaferInfo m_Aligner1Wafer;
- private int m_LP1WaferCount;
- private int m_LP2WaferCount;
- private int m_LP3WaferCount;
- private WaferAssociationInfo _lp1WaferAssociation;
- private WaferAssociationInfo _lp2WaferAssociation;
- private WaferAssociationInfo _lp3WaferAssociation;
- private int m_CycledWafer;
- private int m_CycleCountDisplay;
- //private RobotPosition m_CurrentRobotPosition;
- private WaferInfo m_BladeAWafer;
- private WaferInfo m_BladeBWafer;
- private RecipeResult m_PMARecipeResult;
- private RecipeResult m_PMBRecipeResult;
- private RecipeResult m_PMCRecipeResult;
- private RecipeResult m_PMDRecipeResult;
- private bool m_ATMModeIsOn;
- private float m_TMPressure;
- private string m_RouteState;
- private PressureType m_PressureType;
- DispatcherTimer timer;
- private string m_PMAChamberType;
- private string m_PMBChamberType;
- private string m_PMCChamberType;
- private string m_PMDChamberType;
- private bool m_LP1Loaded;
- private bool m_LP2Loaded;
- private bool m_LP3Loaded;
- private OperationOverView m_View;
- #endregion
- #region 属性
- public bool LP1Loaded
- {
- get { return m_LP1Loaded; }
- set
- {
- if (value != m_LP1Loaded && value == true)
- {
- InvokeClient.Instance.Service.DoOperation($"LP1.ReadCarrierId");
- }
- //if (value != m_LP1Loaded && value == false)
- //{
- // RtDataValues["LP1.CarrierId"] = "";
- //}
- SetProperty(ref m_LP1Loaded, value);
- }
- }
- public bool LP2Loaded
- {
- get { return m_LP2Loaded; }
- set
- {
- if (value != m_LP2Loaded && value == true)
- {
- InvokeClient.Instance.Service.DoOperation($"LP2.ReadCarrierId");
- }
- //if (value != m_LP2Loaded && value == false)
- //{
- // RtDataValues["LP2.CarrierId"] = "";
- //}
- SetProperty(ref m_LP2Loaded, value);
- }
- }
- public bool LP3Loaded
- {
- get { return m_LP3Loaded; }
- set
- {
- if (value != m_LP3Loaded && value == true)
- {
- InvokeClient.Instance.Service.DoOperation($"LP3.ReadCarrierId");
- }
- //if (value!=m_LP3Loaded && value == false)
- //{
- // RtDataValues["LP3.CarrierId"] = "";
- //}
- SetProperty(ref m_LP3Loaded, value);
- }
- }
- public string PMAChamberType
- {
- get { return m_PMAChamberType; }
- set { SetProperty(ref m_PMAChamberType, value); }
- }
- public string PMBChamberType
- {
- get { return m_PMBChamberType; }
- set { SetProperty(ref m_PMBChamberType, value); }
- }
- public string PMCChamberType
- {
- get { return m_PMCChamberType; }
- set { SetProperty(ref m_PMCChamberType, value); }
- }
- public PressureType PressureType
- {
- get { return m_PressureType; }
- set { SetProperty(ref m_PressureType, value); }
- }
- public string PMDChamberType
- {
- get { return m_PMDChamberType; }
- set { SetProperty(ref m_PMDChamberType, value); }
- }
- public bool TabIsChecked
- {
- get { return m_TabIsChecked; }
- set { SetProperty(ref m_TabIsChecked, value); }
- }
- public ModuleInfo LP1ModuleInfo
- {
- get { return m_LP1ModuleInfo; }
- set { SetProperty(ref m_LP1ModuleInfo, value); }
- }
- public ModuleInfo LLAModuleInfo
- {
- get { return m_LLAModuleInfo; }
- set { SetProperty(ref m_LLAModuleInfo, value); }
- }
- public ModuleInfo LLBModuleInfo
- {
- get { return m_LLBModuleInfo; }
- set { SetProperty(ref m_LLBModuleInfo, value); }
- }
- public ModuleInfo EFEMModuleInfo
- {
- get { return m_EFEMModuleInfo; }
- set { SetProperty(ref m_EFEMModuleInfo, value); }
- }
- public ModuleInfo TMModuleInfo
- {
- get { return m_TMModuleInfo; }
- set { SetProperty(ref m_TMModuleInfo, value); }
- }
- public ModuleInfo LP2ModuleInfo
- {
- get { return m_LP2ModuleInfo; }
- set { SetProperty(ref m_LP2ModuleInfo, value); }
- }
- public ModuleInfo LP3ModuleInfo
- {
- get { return m_LP3ModuleInfo; }
- set { SetProperty(ref m_LP3ModuleInfo, value); }
- }
- //public WaferRobotTAction Robot1TAction
- //{
- // get { return m_Robot1TAction; }
- // set { SetProperty(ref m_Robot1TAction, value); }
- //}
- //public WaferRobotXAction Robot1XAction
- //{
- // get { return m_Robot1XAction; }
- // set { SetProperty(ref m_Robot1XAction, value); }
- //}
- //public WaferRobotTAction Robot2TAction
- //{
- // get { return m_Robot2TAction; }
- // set { SetProperty(ref m_Robot2TAction, value); }
- //}
- //public WaferRobotXAction Robot2XAction
- //{
- // get { return m_Robot2XAction; }
- // set { SetProperty(ref m_Robot2XAction, value); }
- //}
- //public WaferRobotTAction Robot3TAction
- //{
- // get { return m_Robot3TAction; }
- // set { SetProperty(ref m_Robot3TAction, value); }
- //}
- //public WaferRobotXAction Robot3XAction
- //{
- // get { return m_Robot3XAction; }
- // set { SetProperty(ref m_Robot3XAction, value); }
- //}
- //public WaferRobotTAction Robot4TAction
- //{
- // get { return m_Robot4TAction; }
- // set { SetProperty(ref m_Robot4TAction, value); }
- //}
- //public WaferRobotXAction Robot4XAction
- //{
- // get { return m_Robot4XAction; }
- // set { SetProperty(ref m_Robot4XAction, value); }
- //}
- public RobotMoveInfo RobotMoveInfo
- {
- get { return m_robotMoveInfo; }
- set
- {
- TMRobotMoveInfoChanged(m_robotMoveInfo, value);
- //m_robotMoveInfo = value;
- SetProperty(ref m_robotMoveInfo, value);
- }
- }
- public NiceGuangChuanWaferRobotTAction BladeNiceGuangChuanWaferRobotTAction
- {
- get { return m_BladeNiceGuangChuanWaferRobotTAction; }
- set
- {
- SetProperty(ref m_BladeNiceGuangChuanWaferRobotTAction, value);
- }
- }
- //public NiceGuangChuanWaferRobotTAction Blade2NiceGuangChuanWaferRobotTAction
- //{
- // get { return m_Blade2NiceGuangChuanWaferRobotTAction; }
- // set
- // {
- // SetProperty(ref m_Blade2NiceGuangChuanWaferRobotTAction, value);
- // }
- //}
- public NiceGuangChuanWaferRobotXAction Blade1NiceGuangChuanWaferRobotXAction
- {
- get { return m_Blade1NiceGuangChuanWaferRobotXAction; }
- set
- {
- SetProperty(ref m_Blade1NiceGuangChuanWaferRobotXAction, value);
- }
- }
- public NiceGuangChuanWaferRobotXAction Blade2NiceGuangChuanWaferRobotXAction
- {
- get { return m_Blade2NiceGuangChuanWaferRobotXAction; }
- set
- {
- SetProperty(ref m_Blade2NiceGuangChuanWaferRobotXAction, value);
- }
- }
- public NiceXinSongWaferRobotTAction BladeNiceXinSongWaferRobotTAction
- {
- get { return m_BladeNiceXinSongWaferRobotTAction; }
- set
- {
- SetProperty(ref m_BladeNiceXinSongWaferRobotTAction, value);
- }
- }
- //public NiceXinSongWaferRobotTAction Blade2NiceXinSongWaferRobotTAction
- //{
- // get { return m_Blade2NiceXinSongWaferRobotTAction; }
- // set
- // {
- // SetProperty(ref m_Blade2NiceXinSongWaferRobotTAction, value);
- // }
- //}
- public NiceXinSongWaferRobotXAction Blade1NiceXinSongWaferRobotXAction
- {
- get { return m_Blade1NiceXinSongWaferRobotXAction; }
- set
- {
- SetProperty(ref m_Blade1NiceXinSongWaferRobotXAction, value);
- }
- }
- public NiceXinSongWaferRobotXAction Blade2NiceXinSongWaferRobotXAction
- {
- get { return m_Blade2NiceXinSongWaferRobotXAction; }
- set
- {
- SetProperty(ref m_Blade2NiceXinSongWaferRobotXAction, value);
- }
- }
- public WaferInfo LLAWafer
- {
- get { return m_LLAWafer; }
- set { SetProperty(ref m_LLAWafer, value); }
- }
- public WaferInfo LLBWafer
- {
- get { return m_LLBWafer; }
- set { SetProperty(ref m_LLBWafer, 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 TMBladeAWafer
- {
- get { return m_TMBladeAWafer; }
- set { SetProperty(ref m_TMBladeAWafer, value); }
- }
- public WaferInfo TMBladeBWafer
- {
- get { return m_TMBladeBWafer; }
- set { SetProperty(ref m_TMBladeBWafer, 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 LLAIsInstalled
- {
- get { return m_LLAIsInstalled; }
- set { SetProperty(ref m_LLAIsInstalled, value); }
- }
- public bool LLBIsInstalled
- {
- get { return m_LLBIsInstalled; }
- set { SetProperty(ref m_LLBIsInstalled, value); }
- }
- public bool TMIsInstalled
- {
- get { return m_TMIsInstalled; }
- set { SetProperty(ref m_TMIsInstalled, value); }
- }
- public bool EFEMIsInstalled
- {
- get { return m_EFEMIsInstalled; }
- set { SetProperty(ref m_EFEMIsInstalled, value); }
- }
- public bool ButtonIsEnableLP1
- {
- get { return m_ButtonIsEnableLP1; }
- set
- {
- if (m_ButtonIsEnableLP1 == false && value == true && LP1WaferAssociation != null)
- {
- LP1WaferAssociation.IsEnableCycle = false;
- LP1WaferAssociation.CycleNumber = 1;
- }
- SetProperty(ref m_ButtonIsEnableLP1, value);
- }
- }
- public bool ButtonIsEnableLP2
- {
- get { return m_ButtonIsEnableLP2; }
- set
- {
- if (m_ButtonIsEnableLP2 == false && value == true && LP2WaferAssociation != null)
- {
- LP2WaferAssociation.IsEnableCycle = false;
- LP2WaferAssociation.CycleNumber = 1;
- }
- SetProperty(ref m_ButtonIsEnableLP2, value);
- }
- }
- public bool ButtonIsEnableLP3
- {
- get { return m_ButtonIsEnableLP3; }
- set
- {
- if (m_ButtonIsEnableLP3 == false && value == true && LP3WaferAssociation != null)
- {
- LP3WaferAssociation.IsEnableCycle = false;
- LP3WaferAssociation.CycleNumber = 1;
- }
- SetProperty(ref m_ButtonIsEnableLP3, value);
- }
- }
- public WaferInfo EFEMBladeAWafer
- {
- get { return m_EFEMBladeAWafer; }
- set { SetProperty(ref m_EFEMBladeAWafer, value); }
- }
- public WaferInfo EFEMBladeBWafer
- {
- get { return m_EFEMBladeBWafer; }
- set { SetProperty(ref m_EFEMBladeBWafer, value); }
- }
- public WaferInfo Aligner1Wafer
- {
- get { return m_Aligner1Wafer; }
- set { SetProperty(ref m_Aligner1Wafer, value); }
- }
- public int LP1WaferCount
- {
- get { return m_LP1WaferCount; }
- set { SetProperty(ref m_LP1WaferCount, value); }
- }
- public int LP2WaferCount
- {
- get { return m_LP2WaferCount; }
- set { SetProperty(ref m_LP2WaferCount, value); }
- }
- public int LP3WaferCount
- {
- get { return m_LP3WaferCount; }
- set { SetProperty(ref m_LP3WaferCount, value); }
- }
- public WaferAssociationInfo LP1WaferAssociation
- {
- get { return _lp1WaferAssociation; }
- set { SetProperty(ref _lp1WaferAssociation, value); }
- }
- public WaferAssociationInfo LP2WaferAssociation
- {
- get { return _lp2WaferAssociation; }
- set { SetProperty(ref _lp2WaferAssociation, value); }
- }
- public WaferAssociationInfo LP3WaferAssociation
- {
- get { return _lp3WaferAssociation; }
- set { SetProperty(ref _lp3WaferAssociation, value); }
- }
- public int CycledWafer
- {
- get { return m_CycledWafer; }
- set { SetProperty(ref m_CycledWafer, value); }
- }
- public int CycleCountDisplay
- {
- get { return m_CycleCountDisplay; }
- set { SetProperty(ref m_CycleCountDisplay, value); }
- }
- public RobotMoveInfo m_EfemRobotMoveInfo;
- public RobotMoveInfo EfemRobotMoveInfo
- {
- get { return m_EfemRobotMoveInfo; }
- set
- {
- EFEMRobotMoveInfoChanged(m_EfemRobotMoveInfo, value);
- //m_EfemRobotMoveInfo = value;
- SetProperty(ref m_EfemRobotMoveInfo, value);
- }
- }
- //public RobotPosition CurrentRobotPosition
- //{
- // get { return m_CurrentRobotPosition; }
- // set { SetProperty(ref m_CurrentRobotPosition, value); }
- //}
- public WaferInfo BladeAWafer
- {
- get { return m_BladeAWafer; }
- set { SetProperty(ref m_BladeAWafer, value); }
- }
- public WaferInfo BladeBWafer
- {
- get { return m_BladeBWafer; }
- set { SetProperty(ref m_BladeBWafer, 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 bool ATMModeIsOn
- {
- get { return m_ATMModeIsOn; }
- set { SetProperty(ref m_ATMModeIsOn, value); }
- }
- public float TMPressure
- {
- get { return m_TMPressure; }
- set { SetProperty(ref m_TMPressure, value); }
- }
- public string RouteState
- {
- get { return m_RouteState; }
- set { SetProperty(ref m_RouteState, value); }
- }
- #endregion
- #region 命令
- private DelegateCommand<object> _LoadCommand;
- public DelegateCommand<object> LoadCommand =>
- _LoadCommand ?? (_LoadCommand = new DelegateCommand<object>(OnLoad));
- private DelegateCommand<object> _LoadWaferCommand;
- public DelegateCommand<object> LoadWaferCommand =>
- _LoadWaferCommand ?? (_LoadWaferCommand = new DelegateCommand<object>(OnLoadWafer));
- private DelegateCommand<object> _UnLoadWaferCommand;
- public DelegateCommand<object> UnLoadWaferCommand =>
- _UnLoadWaferCommand ?? (_UnLoadWaferCommand = new DelegateCommand<object>(OnUnLoadWafer));
- 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>(OnUnSelectAll));
- 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 _HomeAllCommand;
- public DelegateCommand HomeAllCommand =>
- _HomeAllCommand ?? (_HomeAllCommand = new DelegateCommand(OnHomeAll));
- private DelegateCommand _ResumeAllJobCommand;
- public DelegateCommand ResumeAllJobCommand =>
- _ResumeAllJobCommand ?? (_ResumeAllJobCommand = new DelegateCommand(OnResumeAllJob));
- private DelegateCommand _AbortAllCommand;
- public DelegateCommand AbortAllCommand =>
- _AbortAllCommand ?? (_AbortAllCommand = new DelegateCommand(OnAbortAll));
- private DelegateCommand _ReturnAllWaferCommand;
- public DelegateCommand ReturnAllWaferCommand =>
- _ReturnAllWaferCommand ?? (_ReturnAllWaferCommand = new DelegateCommand(OnReturnAllWafer));
- 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> _AbortJobCommand;
- public DelegateCommand<object> AbortJobCommand =>
- _AbortJobCommand ?? (_AbortJobCommand = new DelegateCommand<object>(OnAbortJob));
- private DelegateCommand _EnableAutoCommand;
- public DelegateCommand EnableAutoCommand =>
- _EnableAutoCommand ?? (_EnableAutoCommand = new DelegateCommand(OnEnableAuto));
- private DelegateCommand _EnableManualCommand;
- public DelegateCommand EnableManualCommand =>
- _EnableManualCommand ?? (_EnableManualCommand = new DelegateCommand(OnEnableManual));
- private DelegateCommand _LostFocusCommand;
- public DelegateCommand LostFocusCommand =>
- _LostFocusCommand ?? (_LostFocusCommand = new DelegateCommand(OnLostFocus));
- private DelegateCommand _GotFocusCommand;
- public DelegateCommand GotFocusCommand =>
- _GotFocusCommand ?? (_GotFocusCommand = new DelegateCommand(OnGotFocus));
- public bool m_firstLoadFlag = true;
- #endregion
- #region 构造函数
- public OperationOverViewModel()
- {
- 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");
- LLAIsInstalled = allModules.Contains("LLA");
- LLBIsInstalled = allModules.Contains("LLB");
- EFEMIsInstalled = allModules.Contains("EFEM");
- TMIsInstalled = allModules.Contains("TM");
- timer = new DispatcherTimer();
- timer.Interval = TimeSpan.FromSeconds(0.5);
- addDataKeys();
- RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
- timer.Tick += Timer_Tick;
- timer.Start();
- if (PMAIsInstalled)
- {
- PMAChamberType = ((JetChamber)QueryDataClient.Instance.Service.GetConfig($"PMA.ChamberType")).ToString().Substring(6);
- }
- if (PMBIsInstalled)
- {
- PMBChamberType = ((JetChamber)QueryDataClient.Instance.Service.GetConfig($"PMB.ChamberType")).ToString().Substring(6);
- }
- if (PMCIsInstalled)
- {
- PMCChamberType = ((JetChamber)QueryDataClient.Instance.Service.GetConfig($"PMC.ChamberType")).ToString().Substring(6);
- }
- if (PMDIsInstalled)
- {
- PMDChamberType = ((JetChamber)QueryDataClient.Instance.Service.GetConfig($"PMD.ChamberType")).ToString().Substring(6);
- }
- ATMModeIsOn = Convert.ToBoolean(QueryDataClient.Instance.Service.GetConfig("System.IsATMMode"));
- LOG.Info("开启UI界面");
- }
- #endregion
- #region 命令方法
- private void OnLoad(object obj)
- {
- if (m_firstLoadFlag)
- {
- m_View = (obj as OperationOverView);
- LP1WaferAssociation = new WaferAssociationInfo();
- LP3WaferAssociation = new WaferAssociationInfo();
- LP2WaferAssociation = new WaferAssociationInfo();
- LP1WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP1"];
- LP2WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP2"];
- LP3WaferAssociation.ModuleData = ModuleManager.ModuleInfos["LP3"];
- m_firstLoadFlag = false;
- PressureType = (PressureType)Convert.ToInt32(QueryDataClient.Instance.Service.GetData("System.PressureUnitType"));
- if (!PMAIsInstalled)
- {
- m_View.moduleCanvas.Children.Remove(m_View.pmaChamber);
- m_View.pmaChamber = null;
- m_View.operationCanvas.Children.Remove(m_View.pmaGrid);
- for (int i = 0; i < m_View.pmaGrid.Children.Count; i++)
- {
- UIElement element = m_View.pmaGrid.Children[i];
- m_View.pmaGrid.Children.Remove(element);
- element = null;
- }
- m_View.pmaGrid.Children.Clear();
- m_View.pmaGrid = null;
- }
- if (!PMBIsInstalled)
- {
- m_View.moduleCanvas.Children.Remove(m_View.pmbChamber);
- m_View.pmbChamber = null;
- m_View.operationCanvas.Children.Remove(m_View.pmbGrid);
- for (int i = 0; i < m_View.pmbGrid.Children.Count; i++)
- {
- UIElement element = m_View.pmbGrid.Children[i];
- m_View.pmbGrid.Children.Remove(element);
- element = null;
- }
- m_View.pmbGrid = null;
- }
- if (!PMCIsInstalled)
- {
- m_View.moduleCanvas.Children.Remove(m_View.pmcChamber);
- m_View.pmcChamber = null;
- m_View.operationCanvas.Children.Remove(m_View.pmcGrid);
- for (int i = 0; i < m_View.pmcGrid.Children.Count; i++)
- {
- UIElement element = m_View.pmcGrid.Children[i];
- m_View.pmcGrid.Children.Remove(element);
- element = null;
- }
- m_View.pmcGrid = null;
- }
- if (!PMDIsInstalled)
- {
- m_View.moduleCanvas.Children.Remove(m_View.pmdChamber);
- m_View.pmdChamber = null;
- m_View.operationCanvas.Children.Remove(m_View.pmdGrid);
- for (int i = 0; i < m_View.pmdGrid.Children.Count; i++)
- {
- UIElement element = m_View.pmdGrid.Children[i];
- m_View.pmdGrid.Children.Remove(element);
- element = null;
- }
- m_View.pmdGrid.Children.Clear();
- m_View.pmdGrid = null;
- }
- GC.Collect(); // This should pick up the control removed at a previous MouseDown
- GC.WaitForPendingFinalizers(); // Doesn't help either
- }
- }
- //private void T_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
- //{
- // if (timer.IsEnabled)
- // {
- // timer.Stop();
- // }
- // else
- // {
- // timer.Start();
- // }
- //}
- private void OnLoadWafer(object obj)
- {
- InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Load", ModuleManager.ModuleInfos[obj.ToString()].ModuleID);
- }
- private void OnUnLoadWafer(object obj)
- {
- InvokeClient.Instance.Service.DoOperation($"{obj.ToString()}.Unload", ModuleManager.ModuleInfos[obj.ToString()].ModuleID);
- }
- private void OnSelectAll(object obj)
- {
- var info = obj as WaferAssociationInfo;
- var module = info.ModuleData.ModuleID;
- if (CommonFunction.GetValue<bool>(RtDataValues, $"{module}.IsLoaded"))
- {
- info.SlotFrom = 1;
- info.SlotTo = 25;
- AssociateSequence(info, true);
- }
- }
- private void OnUnSelectAll(object obj)
- {
- var info = obj as WaferAssociationInfo;
- var module = info.ModuleData.ModuleID;
- info.SlotFrom = 1;
- info.SlotTo = 25;
- AssociateSequence(info, false);
- }
- private void OnStart(object obj)
- {
- var info = obj as WaferAssociationInfo;
- InvokeClient.Instance.Service.DoOperation("System.StartJob", info.JobID);
- LOG.Info("System,Start Job");
- }
- private void OnStop(object obj)
- {
- var info = obj as WaferAssociationInfo;
- InvokeClient.Instance.Service.DoOperation("System.StopJob", info.JobID);
- LOG.Info($"System,Stop Job{info.JobID}");
- }
- private void OnAbort(object obj)
- {
- var info = obj as WaferAssociationInfo;
- InvokeClient.Instance.Service.DoOperation("System.AbortJob", info.JobID);
- LOG.Info($"System,Stop Job{info.JobID}");
- }
- private void OnHomeAll()
- {
- InvokeClient.Instance.Service.DoOperation("System.HomeAll");
- LOG.Info("System,Home All");
- }
- 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);
- });
- LOG.Info("System,Resume All Job");
- }
- else
- {
- t.ForEach(x =>
- {
- InvokeClient.Instance.Service.DoOperation("System.PauseJob", x);
- });
- LOG.Info("System,Pause All Job");
- }
- }
- private void OnAbortAll()
- {
- InvokeClient.Instance.Service.DoOperation("System.Abort");
- LOG.Info("System, Abort");
- }
- private void OnReturnAllWafer()
- {
- //Dialog
- //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.ReturnAllWafer", false, 0, false, 0);
- LOG.Info("System,Return All Wafer");
- }
- private void OnSetSequence(object obj)
- {
- var info = obj as WaferInfo;
- bool flag = info.SequenceName != "" ? false : true;
- if (info.ModuleID == "LP1" && (CommonFunction.GetValue<bool>(RtDataValues, "LP1.IsLoaded")))
- {
- AssociateSequence(LP1WaferAssociation, flag, info.SlotID);
- }
- else if (info.ModuleID == "LP2" && (CommonFunction.GetValue<bool>(RtDataValues, "LP2.IsLoaded")))
- {
- AssociateSequence(LP2WaferAssociation, flag, info.SlotID);
- }
- else if (info.ModuleID == "LP3" && (CommonFunction.GetValue<bool>(RtDataValues, "LP3.IsLoaded")))
- {
- AssociateSequence(LP3WaferAssociation, flag, info.SlotID);
- }
- }
- 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();
- info.LotIdSaved = true;
- Dictionary<string, object> param = new Dictionary<string, object>()
- {
- {"JobId", info.JobID},
- {"LotId", info.LotId},
- {"Module", info.ModuleData.ModuleID},
- {"SlotSequence", slotSequence.ToArray()},
- {"AutoStart", true},
- { "PreCleanRecipeName",info.PreCleanRecipeName},
- { "PostCleanRecipeName",info.PostCleanRecipeName},
- { "CycleNumber",info.CycleNumber}
- };
- InvokeClient.Instance.Service.DoOperation("System.CreateJob", param);
- }
- private void OnAbortJob(object obj)
- {
- InvokeClient.Instance.Service.DoOperation("System.AbortJob", obj.ToString());
- }
- private void OnEnableAuto()
- {
- InvokeClient.Instance.Service.DoOperation("System.SetAutoMode");
- }
- private void OnEnableManual()
- {
- InvokeClient.Instance.Service.DoOperation("System.SetManualMode");
- }
- private void OnLostFocus()
- {
- timer.Stop();
- }
- private void OnGotFocus()
- {
- timer.Start();
- }
- #endregion
- #region 私有方法
- private void Timer_Tick(object sender, EventArgs e)
- {
- RobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("TM.RobotMoveAction");
- EfemRobotMoveInfo = (RobotMoveInfo)QueryDataClient.Instance.Service.GetData("EFEM.RobotMoveAction");
- RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
- if (RtDataValues == null || RtDataValues.Count == 0)
- {
- return;
- }
- LP1ModuleInfo = ModuleManager.ModuleInfos["LP1"];
- LP2ModuleInfo = ModuleManager.ModuleInfos["LP2"];
- LP3ModuleInfo = ModuleManager.ModuleInfos["LP3"];
- EFEMModuleInfo = ModuleManager.ModuleInfos["EfemRobot"];
- TMModuleInfo = ModuleManager.ModuleInfos["TMRobot"];
- BladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
- BladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
- LP1Loaded = CommonFunction.GetValue<bool>(RtDataValues, $"LP1.CassettePlaced");
- LP2Loaded = CommonFunction.GetValue<bool>(RtDataValues, $"LP2.CassettePlaced");
- LP3Loaded = CommonFunction.GetValue<bool>(RtDataValues, $"LP3.CassettePlaced");
- if (LLAIsInstalled == true)
- {
- LLAModuleInfo = ModuleManager.ModuleInfos["LLA"];
- LLAWafer = ModuleManager.ModuleInfos["LLA"].WaferManager.Wafers.FirstOrDefault(x => x.WaferStatus != 0);
- }
- if (LLBIsInstalled == true)
- {
- LLBModuleInfo = ModuleManager.ModuleInfos["LLB"];
- LLBWafer = ModuleManager.ModuleInfos["LLB"].WaferManager.Wafers.FirstOrDefault(x => x.WaferStatus != 0);
- }
- if (PMAIsInstalled == true)
- {
- PMAWafer = ModuleManager.ModuleInfos["PMA"].WaferManager.Wafers[0];
- PMARecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMA.CurrentRecipeResult");
- }
- if (PMBIsInstalled == true)
- {
- PMBWafer = ModuleManager.ModuleInfos["PMB"].WaferManager.Wafers[0];
- PMBRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMB.CurrentRecipeResult");
- }
- if (PMCIsInstalled == true)
- {
- PMCWafer = ModuleManager.ModuleInfos["PMC"].WaferManager.Wafers[0];
- PMCRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMC.CurrentRecipeResult");
- }
- if (PMDIsInstalled == true)
- {
- PMDWafer = ModuleManager.ModuleInfos["PMD"].WaferManager.Wafers[0];
- PMDRecipeResult = CommonFunction.GetValue<RecipeResult>(RtDataValues, $"PMD.CurrentRecipeResult");
- }
- if (TMIsInstalled == true)
- {
- TMBladeAWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0];
- TMBladeBWafer = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1];
- TMPressure = CommonFunction.GetValue<float>(RtDataValues, $"TM.TMProcessGauge.Value");
- }
- if (EFEMIsInstalled == true)
- {
- EFEMBladeAWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0];
- EFEMBladeBWafer = ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1];
- Aligner1Wafer = ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers[0];
- ControlJobInfo lp1Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP1.CurrentControlJob");
- if (lp1Cj == null)
- {
- ButtonIsEnableLP1 = true;
- }
- else
- {
- ButtonIsEnableLP1 = false;
- }
- UPdateWaferAssociation(LP1WaferAssociation, lp1Cj);
- ControlJobInfo lp2Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP2.CurrentControlJob");
- if (lp2Cj == null)
- {
- ButtonIsEnableLP2 = true;
- }
- else
- {
- ButtonIsEnableLP2 = false;
- }
- UPdateWaferAssociation(LP2WaferAssociation, lp2Cj);
- ControlJobInfo lp3Cj = CommonFunction.GetValue<ControlJobInfo>(RtDataValues, "LP3.CurrentControlJob");
- if (lp3Cj == null)
- {
- ButtonIsEnableLP3 = true;
- }
- else
- {
- ButtonIsEnableLP3 = false;
- }
- UPdateWaferAssociation(LP3WaferAssociation, lp3Cj);
- }
- //LP1WaferCount = LP1ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
- //LP2WaferCount = LP2ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
- //LP3WaferCount = LP3ModuleInfo.WaferManager.Wafers.Where(x => x.WaferStatus != 0).Count();
- if (CommonFunction.GetValue<int>(RtDataValues, "EquipmentStatus") == 4)
- {
- RouteState = "Resume";
- }
- else
- {
- RouteState = "Pause";
- }
- }
- /// <summary>
- /// 更新Wafer情况
- /// </summary>
- /// <param name="info"></param>
- /// <param name="cjInfo"></param>
- private void UPdateWaferAssociation(WaferAssociationInfo info, ControlJobInfo cjInfo)
- {
- if (cjInfo != null)
- {
- info.LotId = cjInfo.LotName;
- 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 async void TMRobotMoveInfoChanged(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];
- bool isParseOK;
- BladeNiceXinSongWaferRobotTAction = CommonFunction.ToEnum<NiceXinSongWaferRobotTAction>(module, out isParseOK);
- if (isParseOK == false)
- {
- return;
- }
- //if (arm == "ArmA")
- //{
- //}
- //else if (arm == "ArmB")
- //{
- // Blade2NiceXinSongWaferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
- //}
- }
- #endregion
- #region pick 和 place LL
- 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 (arm == "ArmA")
- {
- bool isParseOK;
- BladeNiceXinSongWaferRobotTAction = CommonFunction.ToEnum<NiceXinSongWaferRobotTAction>(module, out isParseOK);
- if (isParseOK == false)
- {
- return;
- }
- //var waferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
- //BladeNiceXinSongWaferRobotTAction = waferRobotTAction;
- await Task.Delay(600);
- Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Extend1;
- 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 = WaferRobotXAction.Retract;
- Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract1;
- }
- else if (arm == "ArmB")
- {
- bool isParseOK;
- BladeNiceXinSongWaferRobotTAction = CommonFunction.ToEnum<NiceXinSongWaferRobotTAction>(module, out isParseOK);
- if (isParseOK == false)
- {
- return;
- }
- //var waferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
- //BladeNiceXinSongWaferRobotTAction = waferRobotTAction;
- //var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
- //var waferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
- //Blade2NiceXinSongWaferRobotTAction = waferRobotTAction;
- //if (waferRobotTAction != Blade2NiceXinSongWaferRobotTAction)
- //{
- //}
- await Task.Delay(600);
- Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.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);
- }
- Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract2;
- }
- }
- #endregion
- #region pick 和 place pm
- 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];
- bool isParseOK;
- BladeNiceXinSongWaferRobotTAction = CommonFunction.ToEnum<NiceXinSongWaferRobotTAction>(module, out isParseOK);
- if (isParseOK == false)
- {
- return;
- }
- //var waferRobotTAction = (NiceXinSongWaferRobotTAction)Enum.Parse(typeof(NiceXinSongWaferRobotTAction), module, true);
- //BladeNiceXinSongWaferRobotTAction = waferRobotTAction;
- if (arm == "ArmA")
- {
- await Task.Delay(600);
- Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Extend1;
- }
- else if (arm == "ArmB")
- {
- await Task.Delay(600);
- Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Extend2;
- }
- }
- else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Retracting)
- {
- var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
- if (TMRobotMoveActionBladeTarget != null)
- {
- RobotTarget = TMRobotMoveActionBladeTarget.ToString();
- }
- else
- {
- return;
- }
- var values = RobotTarget.Split('.');
- var arm = values[0];
- if (arm == "ArmA")
- {
- //Robot1XAction = WaferRobotXAction.Retract;
- Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract1;
- }
- else if (arm == "ArmB")
- {
- //Robot2XAction = WaferRobotXAction.Retract;
- Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract2;
- }
- }
- #endregion
- #region Home
- else if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Homing)
- {
- Blade1NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract1;
- Blade2NiceXinSongWaferRobotXAction = NiceXinSongWaferRobotXAction.Retract2;
- await Task.Delay(2000);
- BladeNiceXinSongWaferRobotTAction = NiceXinSongWaferRobotTAction.T_Origin;
- }
- #endregion
- }
- private async void EFEMRobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
- {
- string RobotTarget;
- if (oldValue == null || newValue == null)
- {
- return;
- }
- #region pick 和 place LL
- if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget))
- {
- var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
- if (TMRobotMoveActionBladeTarget != null)
- {
- RobotTarget = TMRobotMoveActionBladeTarget.ToString();
- }
- else
- {
- return;
- }
- var values = RobotTarget.Split('.');
- var arm = values[0];
- var module = values[1];
- if (arm == "ArmA")
- {
- var bladeWaferRobotTAction = (NiceGuangChuanWaferRobotTAction)Enum.Parse(typeof(NiceGuangChuanWaferRobotTAction), module, true);
- if (BladeNiceGuangChuanWaferRobotTAction != bladeWaferRobotTAction)
- {
- BladeNiceGuangChuanWaferRobotTAction = bladeWaferRobotTAction;
- await Task.Delay(600);
- }
- Blade1NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Extend1;
- //Robot3XAction = WaferRobotXAction.Extend;
- while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0].WaferStatus == 0))
- {
- await Task.Delay(100);
- }
- //Robot3XAction = WaferRobotXAction.Retract;
- Blade1NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract1;
- }
- else if (arm == "ArmB")
- {
- var bladeWaferRobotTAction = (NiceGuangChuanWaferRobotTAction)Enum.Parse(typeof(NiceGuangChuanWaferRobotTAction), module, true);
- if (BladeNiceGuangChuanWaferRobotTAction != bladeWaferRobotTAction)
- {
- BladeNiceGuangChuanWaferRobotTAction = bladeWaferRobotTAction;
- await Task.Delay(600);
- }
- //var blade2WaferRobotTAction = (NiceGuangChuanWaferRobotTAction)Enum.Parse(typeof(NiceGuangChuanWaferRobotTAction), module, true);
- //if (Blade2NiceGuangChuanWaferRobotTAction != blade2WaferRobotTAction)
- //{
- // Blade2NiceGuangChuanWaferRobotTAction = blade2WaferRobotTAction;
- // await Task.Delay(600);
- //}
- Blade2NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Extend2;
- while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1].WaferStatus == 0))
- {
- await Task.Delay(100);
- }
- // Robot4XAction = WaferRobotXAction.Retract;
- Blade2NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract2;
- }
- }
- #endregion
- #region Home
- else if (oldValue.Action == RobotAction.Homing && newValue.Action == RobotAction.None)
- {
- Blade1NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract1;
- Blade2NiceGuangChuanWaferRobotXAction = NiceGuangChuanWaferRobotXAction.Retract2;
- await Task.Delay(1000);
- BladeNiceGuangChuanWaferRobotTAction = NiceGuangChuanWaferRobotTAction.T_Origin;
- //Blade2NiceGuangChuanWaferRobotTAction = NiceGuangChuanWaferRobotTAction.T_Origin;
- }
- #endregion
- }
- private void addDataKeys()
- {
- if (PMAIsInstalled)
- {
- m_RtDataKeys.Add("PMA.IsSlitDoorClosed");
- m_RtDataKeys.Add("PMA.CurrentRecipeResult");
- m_RtDataKeys.Add("PMA.IsOnline");
- m_RtDataKeys.Add("PMA.CalculationPressure");
- m_RtDataKeys.Add("PMA.IsLidClosed");
- m_RtDataKeys.Add("PMA.HighTemperatureHeater.DeviceData");
- }
- if (PMBIsInstalled)
- {
- m_RtDataKeys.Add("PMB.IsSlitDoorClosed");
- m_RtDataKeys.Add("PMB.CurrentRecipeResult");
- m_RtDataKeys.Add("PMB.IsOnline");
- m_RtDataKeys.Add("PMB.CalculationPressure");
- m_RtDataKeys.Add("PMB.IsLidClosed");
- m_RtDataKeys.Add("PMB.HighTemperatureHeater.DeviceData");
- }
- if (PMCIsInstalled)
- {
- m_RtDataKeys.Add("PMC.IsSlitDoorClosed");
- m_RtDataKeys.Add("PMC.CurrentRecipeResult");
- m_RtDataKeys.Add("PMC.IsOnline");
- m_RtDataKeys.Add("PMC.CalculationPressure");
- m_RtDataKeys.Add("PMC.IsLidClosed");
- m_RtDataKeys.Add("PMC.HighTemperatureHeater.DeviceData");
- }
- if (PMDIsInstalled)
- {
- m_RtDataKeys.Add("PMD.IsSlitDoorClosed");
- m_RtDataKeys.Add("PMD.CurrentRecipeResult");
- m_RtDataKeys.Add("PMD.IsOnline");
- m_RtDataKeys.Add("PMD.CalculationPressure");
- m_RtDataKeys.Add("PMD.IsLidClosed");
- m_RtDataKeys.Add("PMD.HighTemperatureHeater.DeviceData");
- }
- m_RtDataKeys.Add("TM.LLATSlitDoor.IsClosed");
- m_RtDataKeys.Add("TM.LLBTSlitDoor.IsClosed");
- m_RtDataKeys.Add("TM.LLAESlitDoor.IsClosed");
- m_RtDataKeys.Add("TM.LLBESlitDoor.IsClosed");
- m_RtDataKeys.Add("TM.IsOnline");
- m_RtDataKeys.Add("TM.TMProcessGauge.Value");
- m_RtDataKeys.Add("TM.IoSensor.TMATMSwitch.Value");
- m_RtDataKeys.Add("TM.IoSensor.TMVacSwitch.Value");
- m_RtDataKeys.Add("TM.TMProcessGauge.Value");
- //m_RtDataKeys.Add("TM.TMLidClosed");
- //m_RtDataKeys.Add("TM.LLALidClosed");
- //m_RtDataKeys.Add("TM.LLBLidClosed");
- m_RtDataKeys.Add("TM.PMASlitDoor.IsClosed");
- m_RtDataKeys.Add("TM.PMBSlitDoor.IsClosed");
- m_RtDataKeys.Add("TM.PMCSlitDoor.IsClosed");
- m_RtDataKeys.Add("TM.PMDSlitDoor.IsClosed");
- m_RtDataKeys.Add("LLA.IsOnline");
- m_RtDataKeys.Add($"TM.LLAPressureGauge.Value");
- m_RtDataKeys.Add($"TM.IoSensor.LLAVacSwitch.Value");
- m_RtDataKeys.Add($"TM.IoSensor.LLAATMSwitch.Value");
- m_RtDataKeys.Add("LLB.IsOnline");
- m_RtDataKeys.Add($"TM.LLBPressureGauge.Value");
- m_RtDataKeys.Add($"TM.IoSensor.LLBVacSwitch.Value");
- m_RtDataKeys.Add($"TM.IoSensor.LLBATMSwitch.Value");
- m_RtDataKeys.Add("LP1.IsLoaded");
- m_RtDataKeys.Add("LP2.IsLoaded");
- m_RtDataKeys.Add("LP3.IsLoaded");
- m_RtDataKeys.Add("LP1.CassettePlaced");
- m_RtDataKeys.Add("LP2.CassettePlaced");
- m_RtDataKeys.Add("LP3.CassettePlaced");
- m_RtDataKeys.Add("LP1.CurrentControlJob");
- m_RtDataKeys.Add("LP2.CurrentControlJob");
- m_RtDataKeys.Add("LP3.CurrentControlJob");
- m_RtDataKeys.Add("EFEM.IsOnline");
- 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("LP3.CycledCount");
- m_RtDataKeys.Add("LP3.CycledWafer");
- m_RtDataKeys.Add("LP3.CycleSetPoint");
- //m_RtDataKeys.Add("LP3.Throughput");
- m_RtDataKeys.Add("EquipmentStatus");
- m_RtDataKeys.Add("Scheduler.PjNameList");
- m_RtDataKeys.Add("LLA.CoolingTime");
- m_RtDataKeys.Add("LLB.CoolingTime");
- m_RtDataKeys.Add("LP1.CarrierId");
- m_RtDataKeys.Add("LP2.CarrierId");
- m_RtDataKeys.Add("LP3.CarrierId");
- }
- 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)
- {
- if (flag && HasWaferOnSlot(wafers, index))
- 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 && HasWaferOnSlot(wafers, index))
- wafers[index].SequenceName = info.SequenceName;
- else
- wafers[index].SequenceName = string.Empty;
- }
- }
- }
- switch (info.ModuleData.ModuleID)
- {
- case "LP1":
- LP1WaferAssociation = info;
- break;
- case "LP2":
- LP2WaferAssociation = info;
- break;
- case "LP3":
- LP3WaferAssociation = info;
- break;
- }
- }
- private bool HasWaferOnSlot(List<WaferInfo> wafers, int index)
- {
- if (wafers[index].WaferStatus == 0)
- return false;
- return true;
- }
- public void EnterExitView(bool isEnter)
- {
- if (isEnter)
- {
- Timer_Tick(null, null);
- timer.Start();
- }
- else
- {
- timer.Stop();
- }
- }
- #endregion
- }
- }
|