JetPMBase.cs 21 KB

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