JetPMBase.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. using Aitex.Core.RT.DataCenter;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.OperationCenter;
  4. using Aitex.Core.Util;
  5. using MECF.Framework.Common.Equipment;
  6. using System.Collections.Generic;
  7. using Venus_Core;
  8. using Aitex.Core.RT.Device.Unit;
  9. using Venus_RT.Modules;
  10. using System;
  11. using Aitex.Core.RT.SCCore;
  12. using System.Threading.Tasks;
  13. namespace Venus_RT.Devices
  14. {
  15. abstract class JetPMBase : BaseDevice, IDevice
  16. {
  17. // 盖子的状态
  18. public abstract bool IsLidClosed { get; }
  19. public virtual bool IsLidLoadlockClosed { get; }
  20. public abstract bool IsSlitDoorClosed { get; }
  21. public abstract bool IsPumpRunning { get; }
  22. public abstract bool IsTurboPumpRunning { get; }
  23. public abstract bool IsTurboPumpAtSpeed { get; }
  24. public abstract float TurboPumpSpeed { get; }
  25. public abstract bool HasPumpError { get; }
  26. public abstract bool HasTurboPumpError { get; }
  27. public abstract bool IsCDA_OK { get; }
  28. public abstract bool IsFastPumpOpened { get; }
  29. public abstract bool IsSoftPumpOpened { get; }
  30. public abstract bool IsMfc1ValveOpened { get; }
  31. public abstract bool IsMfc2ValveOpened { get; }
  32. public abstract bool IsMfc3ValveOpened { get; }
  33. public abstract bool IsMfc4ValveOpened { get; }
  34. public abstract bool IsMfc5ValveOpened { get; }
  35. public abstract bool IsMfc6ValveOpened { get; }
  36. public abstract bool IsMfc7ValveOpened { get; }
  37. public abstract bool IsMfc8ValveOpened { get; }
  38. public abstract bool IsGuageValveOpened { get; }
  39. public abstract bool IsATM { get; }
  40. public abstract bool PVN22ValveIsOpen { get; }
  41. public abstract bool LiftPinIsDown { get; }
  42. public abstract bool LiftPinIsUp { get; }
  43. public abstract bool IsATMLoadlock { get; }
  44. public abstract bool IsVACLoadLock { get; }
  45. public abstract bool IsVAC { get; }
  46. public abstract bool IsWaterFlowOk { get; }
  47. public abstract bool IsWLK { get; }
  48. public abstract bool IsRFGInterlockOn { get; }
  49. public abstract bool PMLidClosed { get; }
  50. public abstract bool TurboPumpInterlock { get; }
  51. public virtual bool SourceRFFanInterlock { get; }
  52. public virtual bool SourceRFMatchInterlock { get; }
  53. public abstract bool SlitDoorClosed { get; }
  54. public abstract double ProcessLowPressure { get; }
  55. public abstract double ProcessHighPressure { get; }
  56. public abstract double ProcessPressure { get; }
  57. public abstract double ChamberPressure { get; }
  58. public virtual double CalculationPressure { get; }
  59. public abstract double ForelinePressure { get; }
  60. public abstract double TargetPressure { get; }
  61. public virtual double ESCHePressure { get; }
  62. public virtual int ESCOutputVoltage { get; }
  63. public virtual double ESCPositiveOutputCurrent { get; }//R+
  64. public virtual double ESCNegativeOutputCurrent { get; }//R-
  65. public virtual bool IsHVOn { get; }
  66. public abstract float CoolantInletTempFB { get; }
  67. public abstract float CoolantOutletTempFB { get; }
  68. public abstract bool ChillerIsRunning { get; }
  69. //Loadlock_Arm
  70. public virtual bool IsLoadlockArmRetract { get; }
  71. public virtual bool IsLoadlockArmExtend { get; }
  72. //Loadlock_Arm DO
  73. public virtual bool LoadlockArmRetract { get; }
  74. public virtual bool LoadlockArmExtend { get; }
  75. public abstract float ReflectPower { get; }
  76. public virtual float BiasReflectPower { get; }
  77. public virtual float ForwardPower { get; }
  78. public virtual float BiasForwardPower { get; }
  79. public abstract bool BackSideHeOutOfRange { get; }
  80. public abstract float RFMatchC1 { get; }
  81. public abstract float RFMatchC2 { get; }
  82. public virtual float BiasRFMatchC1 { get; }
  83. public virtual float BiasRFMatchC2 { get; }
  84. public new ModuleName Module;
  85. public abstract MovementPosition LiftPinPosition { get; }
  86. public abstract bool CheckAtm();
  87. public abstract bool CheckSlitDoorOpen();
  88. public abstract bool CheckSlitDoorClose();
  89. public abstract bool CheckLiftUp();
  90. public abstract bool CheckLiftDown();
  91. public abstract double TotalGasSetpoint { get; }
  92. public abstract bool HasGasOutOfRange { get; }
  93. public abstract bool PendulumValveIsOpen();
  94. public abstract double LoadlockPressure { get; }
  95. public virtual double MFC1FeedBack { get; }
  96. public virtual double MFC2FeedBack { get; }
  97. public virtual double MFC3FeedBack { get; }
  98. public virtual double MFC4FeedBack { get; }
  99. public virtual double MFC5FeedBack { get; }
  100. public virtual double MFC6FeedBack { get; }
  101. public virtual double MFC7FeedBack { get; }
  102. public virtual double MFC8FeedBack { get; }
  103. public double TMPressure { get { return Singleton<RouteManager>.Instance.TM.TMPressure; } }
  104. public bool IsTMATM
  105. {
  106. get
  107. {
  108. if (Singleton<RouteManager>.Instance.TM != null)
  109. {
  110. return Singleton<RouteManager>.Instance.TM.IsTMATM;
  111. }
  112. else
  113. {
  114. return Singleton<RouteManager>.Instance.seTM.TMIsATM;
  115. }
  116. }
  117. }
  118. public bool IsTMVAC
  119. {
  120. get
  121. {
  122. if (Singleton<RouteManager>.Instance.TM != null)
  123. {
  124. return Singleton<RouteManager>.Instance.TM.IsTMVac;
  125. }
  126. else
  127. {
  128. return Singleton<RouteManager>.Instance.seTM.TMIsVAC;
  129. }
  130. }
  131. }
  132. // EndPoint
  133. private readonly JetEPDBase _epdClient;
  134. public List<string> EPDCfgList => _epdClient?.CFGFileList;
  135. //public List<string> EPDCfgList=new List<string>() { "1","2"};
  136. public bool EPDCaptured => _epdClient.Captured;
  137. public bool EPDConnected => _epdClient.IsEPDConnected;
  138. public JetChamber ChamberType = JetChamber.None;
  139. public JetPMBase(ModuleName module) : base(module.ToString(), module.ToString(), module.ToString(), module.ToString())
  140. {
  141. Module = module;
  142. _epdClient = DEVICE.GetDevice<JetEPDBase>($"{Module}.{VenusDevice.EndPoint}");
  143. ChamberType = (JetChamber)SC.GetValue<int>($"{Module}.ChamberType");
  144. DATA.Subscribe($"{Name}.ForelinePressure", () => ForelinePressure);
  145. DATA.Subscribe($"{Name}.ProcessHighPressure", () => ProcessHighPressure);
  146. DATA.Subscribe($"{Name}.ProcessLowPressure", () => ProcessLowPressure);
  147. DATA.Subscribe($"{Name}.CalculationPressure", () => CalculationPressure);
  148. DATA.Subscribe($"{Name}.ESCHePressure", () => ESCHePressure);
  149. DATA.Subscribe($"{Name}.LoadlockPressure", () => LoadlockPressure);
  150. DATA.Subscribe($"{Name}.IsATM", () => IsATM, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  151. DATA.Subscribe($"{Name}.IsVAC", () => IsVAC, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  152. DATA.Subscribe($"{Name}.LiftPinIsUp", () => LiftPinIsUp, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  153. DATA.Subscribe($"{Name}.LiftPinIsDown", () => LiftPinIsDown, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  154. DATA.Subscribe($"{Name}.PumpIsRunning", () => IsPumpRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  155. DATA.Subscribe($"{Name}.TurboPumpIsRunning", () => IsTurboPumpRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  156. DATA.Subscribe($"{Name}.IsSlitDoorClosed", () => IsSlitDoorClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  157. DATA.Subscribe($"{Name}.IsLidClosed", () => IsLidClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  158. DATA.Subscribe($"{Name}.TurboPumpRotationalSpeed", () => TurboPumpSpeed);
  159. DATA.Subscribe($"{Name}.IsWaterFlowOk", () => IsWaterFlowOk, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  160. DATA.Subscribe($"{Name}.IsWLK", () => IsWLK, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  161. DATA.Subscribe($"{Name}.IsCDA_OK", () => IsCDA_OK, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  162. DATA.Subscribe($"{Name}.SourceRFFanInterlock", () => SourceRFFanInterlock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  163. DATA.Subscribe($"{Name}.SourceRFMatchInterlock", () => SourceRFMatchInterlock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  164. DATA.Subscribe($"{Name}.IsTurboPumpInterlock", () => TurboPumpInterlock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  165. DATA.Subscribe($"{Name}.IsATMLoadlock", () => IsATMLoadlock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  166. DATA.Subscribe($"{Name}.IsVACLoadlock", () => IsVACLoadLock, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  167. DATA.Subscribe($"{Name}.GetPVPosition", () => GetPVPosition());
  168. DATA.Subscribe($"{Name}.ESCHV.Temp", () => CoolantOutletTempFB);
  169. DATA.Subscribe($"{Name}.Chiller.Temp", () => CoolantInletTempFB);
  170. //DATA.Subscribe($"{Name}.Chiller.IsOn", () => ChillerIsRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  171. DATA.Subscribe($"{Name}.IsTurboPumpAtSpeed", () => IsTurboPumpAtSpeed);
  172. DATA.Subscribe($"{Name}.EPDCfgList", () => EPDCfgList, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  173. OP.Subscribe($"{Module}.SetLiftPin", (cmd, args) =>
  174. {
  175. if ((bool)args[0] == true)
  176. {
  177. return SetLiftPin(MovementPosition.Up, out _);
  178. }
  179. else
  180. {
  181. return SetLiftPin(MovementPosition.Down, out _);
  182. }
  183. });
  184. OP.Subscribe($"{Module}.SetSRf", (cmd, args) =>
  185. {
  186. var ison = (bool)args[1];
  187. if (ison == true)
  188. {
  189. GeneratorPowerOn(true);
  190. GeneratorSetpower((float)args[0]);
  191. }
  192. else
  193. {
  194. GeneratorPowerOn(false);
  195. }
  196. return true;
  197. });
  198. OP.Subscribe($"{Module}.SetBRf", (cmd, args) =>
  199. {
  200. var ison = (bool)args[1];
  201. if (ison == true)
  202. {
  203. GeneratorBiasPowerOn(true);
  204. GeneratorBiasSetpower((float)args[0]);
  205. }
  206. else
  207. {
  208. GeneratorBiasPowerOn(false);
  209. }
  210. return true;
  211. });
  212. OP.Subscribe($"{Module}.SetSlitDoor", (cmd, args) =>
  213. {
  214. SetSlitDoor((bool)args[0], out _);
  215. return true;
  216. });
  217. OP.Subscribe($"{Module}.SetESCHVIsOn", (cmd, args) =>
  218. {
  219. OnOffSetESCHV((bool)args[0]);
  220. return true;
  221. });
  222. OP.Subscribe($"{Module}.SetESCHV", (cmd, args) =>
  223. {
  224. SetESCClampVoltage((int)args[0]);
  225. return true;
  226. });
  227. OP.Subscribe($"{Module}.SetPVPostion", (cmd, args) =>
  228. {
  229. SetPVPostion((int)args[0]);
  230. return true;
  231. });
  232. OP.Subscribe($"{Module}.SetPVPressure", (cmd, args) =>
  233. {
  234. SetPVPressure((int)args[0]);
  235. return true;
  236. });
  237. OP.Subscribe($"{Module}.ClosePump", (cmd, args) =>
  238. {
  239. TurnDryPump(false);
  240. return true;
  241. });
  242. OP.Subscribe($"{Module}.CloseTurboPump", (cmd, args) =>
  243. {
  244. TurnTurboPump(false);
  245. return true;
  246. });
  247. OP.Subscribe($"{Module}.ControlValve", (cmd, args) =>
  248. {
  249. if (ChamberType == JetChamber.VenusSE|| ChamberType == JetChamber.VenusDE)
  250. {
  251. if (Enum.TryParse(args[0].ToString(), out ValveType targetvalve))
  252. {
  253. OpenValve(targetvalve, (bool)args[1]);
  254. }
  255. }
  256. else
  257. {
  258. OpenValve((ValveType)((int)args[0]), (bool)args[1]);
  259. }
  260. return true;
  261. });
  262. OP.Subscribe($"{Module}.TurnPendulumValve", (cmd, args) =>
  263. {
  264. TurnPendulumValve((bool)args[0]);
  265. return true;
  266. });
  267. OP.Subscribe($"{Module}.HeatChiller", (cmd, args) =>
  268. {
  269. var chillerType = (ChillerType)Enum.Parse(typeof(ChillerType), args[0].ToString());
  270. HeatChiller(chillerType, (float)args[1], (float)args[2]);
  271. return true;
  272. });
  273. OP.Subscribe($"{Module}.OnOffChiller", (cmd, args) =>
  274. {
  275. var chillerType = (ChillerType)Enum.Parse(typeof(ChillerType), args[0].ToString());
  276. var ison = Convert.ToBoolean(args[1]);
  277. OnOffChiller(chillerType, ison);
  278. return true;
  279. });
  280. OP.Subscribe($"{Module}.WallChiller", (cmd, args) =>
  281. {
  282. float value;
  283. float.TryParse(args[0].ToString(), out value);
  284. SetWallTCTemperature(value);
  285. return true;
  286. });
  287. OP.Subscribe($"{Module}.SetBacksideHeFlow", (cmd, args) =>
  288. {
  289. double value;
  290. double.TryParse(args[0].ToString(), out value);
  291. SetBacksideHeFlow(value);
  292. return true;
  293. });
  294. OP.Subscribe($"{Module}.SetBacksideHePressure", (cmd, args) =>
  295. {
  296. float value;
  297. float.TryParse(args[0].ToString(), out value);
  298. SetBacksideHePressure(value);
  299. return true;
  300. });
  301. OP.Subscribe($"{Module}.EndPoint.SearchCfg", (cmd, args) =>
  302. {
  303. _epdClient?.QueryConfigList();
  304. return true;
  305. });
  306. }
  307. public abstract void CloseValves(int? delayTime=null);
  308. public abstract void TurnDryPump(bool on);
  309. public abstract void TurnTurboPump(bool on);
  310. public abstract void OpenValve(ValveType vlvType, bool on);
  311. public virtual void Monitor()
  312. {
  313. }
  314. public virtual bool Initialize()
  315. {
  316. return true;
  317. }
  318. public virtual void Terminate()
  319. {
  320. }
  321. public virtual void Reset()
  322. {
  323. }
  324. public virtual bool OnOffSetESCHV(bool on)
  325. {
  326. return false;
  327. }
  328. public abstract bool SetWallTCTemperature(float value);
  329. protected abstract void CheckPermanentInterlock();
  330. public abstract void CheckIdleInterlock();
  331. public virtual void BuzzerBlinking(double time)
  332. {
  333. }
  334. public virtual void SwitchOnBuzzerAndRed()
  335. {
  336. }
  337. public abstract void Home();
  338. public virtual bool SetLiftPin(MovementPosition dirt, out string reason)
  339. {
  340. reason = "";
  341. return false;
  342. }
  343. public abstract bool SetSlitDoor(bool open, out string reason);
  344. public virtual bool RetractWafer()
  345. {
  346. return false;
  347. }
  348. public virtual bool ExtendWafer()
  349. {
  350. return false;
  351. }
  352. public abstract bool FlowGas(int gasNum, double val);
  353. public abstract bool StopGas(int gasNum);
  354. public abstract bool FlowN2(double val);
  355. public abstract bool StopN2();
  356. public abstract void StopAllGases();
  357. public abstract bool TurnPendulumValve(bool on);
  358. public abstract bool SetPVPressure(int pressure);
  359. public abstract bool SetPVPostion(int position);
  360. public abstract int GetPVPosition();
  361. public virtual void HeatChiller(ChillerType chillerType, double value, double offset)
  362. {
  363. }
  364. public virtual void OnOffChiller(ChillerType chillerType, bool onoff)
  365. {
  366. }
  367. public virtual bool CheckChillerStatus()
  368. {
  369. return false;
  370. }
  371. public abstract void SetGeneratorCommunicationMode(int mode);
  372. public abstract bool GeneratorPowerOn(bool on);
  373. public abstract bool GeneratorSetpower(float val);
  374. public virtual bool GeneratorBiasPowerOn(bool on)
  375. { return false; }
  376. public virtual bool GeneratorBiasSetpower(float val)
  377. { return false; }
  378. public virtual bool GeneratorBiasSetMatchMode(bool val)
  379. { return false; }
  380. public abstract bool SetMatchPosition(float c1, float c2);
  381. public virtual bool SetBiasMatchPosition(float c1, float c2)
  382. { return false; }
  383. public virtual bool SetMatchWorkMode(MatchWorkMode matchWorkMode)
  384. {
  385. return false;
  386. }
  387. public virtual bool SetBiasMatchWorkMode(MatchWorkMode matchWorkMode)
  388. {
  389. return false;
  390. }
  391. public virtual bool SetBiasPulseMode(bool on)
  392. { return false; }
  393. public virtual bool SetBiasPulseRateFreq(int nFreq)
  394. {
  395. return false;
  396. }
  397. public virtual bool SetDiasPulseDutyCycle(int percentage)
  398. {
  399. return false;
  400. }
  401. public virtual bool SetESCClampVoltage(int nVoltage)
  402. {
  403. return false;
  404. }
  405. public abstract bool CheckGeneratorAndHVInterlock(VenusDevice device);
  406. #region EndPoint
  407. public void EPDRecipeStart(string recipe)
  408. {
  409. try
  410. {
  411. _epdClient?.RecipeStart(recipe);
  412. }
  413. catch
  414. {
  415. }
  416. }
  417. public void EPDRecipeStop()
  418. {
  419. try
  420. {
  421. _epdClient?.RecipeStop();
  422. }
  423. catch
  424. {
  425. }
  426. }
  427. public void EPDStepStart(string cfgName, int step)
  428. {
  429. try
  430. {
  431. _epdClient?.StepStart(cfgName, step);
  432. }
  433. catch
  434. {
  435. }
  436. }
  437. public void EPDStepStop()
  438. {
  439. try
  440. {
  441. _epdClient?.StepStop();
  442. }
  443. catch
  444. {
  445. }
  446. }
  447. #endregion
  448. public virtual void SetBacksideHeFlow(double flow)
  449. {
  450. }
  451. public virtual bool SetBacksideHePressure(float mTorr)
  452. {
  453. return false;
  454. }
  455. public abstract bool SetBacksideHeThreshold(int nMin, int nMax);
  456. public virtual bool HighTemperatureHeaterGotoPosition(HighTemperatureHeaterPosition highTemperatureHeaterPosition)
  457. {
  458. return false;
  459. }
  460. public virtual bool SetHighTemperatureHeaterRate(int rate)
  461. {
  462. return false;
  463. }
  464. public virtual bool StartControlPressure(int pressureSetpoint, int flowSetpoint)
  465. {
  466. return false;
  467. }
  468. public virtual async Task<bool> AbortControlPressure()
  469. {
  470. return false;
  471. }
  472. public virtual bool PreparePlace()
  473. {
  474. return false;
  475. }
  476. public virtual bool PreparePlaceIsOK()
  477. {
  478. return false;
  479. }
  480. public virtual bool PreparePick()
  481. {
  482. return false;
  483. }
  484. public virtual bool PreparePickIsOK()
  485. {
  486. return false;
  487. }
  488. public virtual bool EndPlace()
  489. {
  490. return false;
  491. }
  492. public virtual bool EndPlaceIsOK()
  493. {
  494. return false;
  495. }
  496. public virtual bool EndPick()
  497. {
  498. return false;
  499. }
  500. public virtual bool EndPickIsOK()
  501. {
  502. return false;
  503. }
  504. public virtual void RTCloseEvent()
  505. {
  506. }
  507. public virtual bool RFInterlock(VenusDevice device)
  508. {
  509. return true;
  510. }
  511. }
  512. }