JetPMBase.cs 19 KB

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