JetPMBase.cs 21 KB

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