JetTM.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. using Aitex.Core.Common.DeviceData;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.Device.Unit;
  4. using Aitex.Core.Util;
  5. using Aitex.Core.RT.SCCore;
  6. using Aitex.Core.RT.Log;
  7. using Aitex.Sorter.Common;
  8. using MECF.Framework.Common.Device.Bases;
  9. using MECF.Framework.Common.Equipment;
  10. using System;
  11. using System.Collections.Generic;
  12. using Venus_Core;
  13. using Venus_RT.Modules;
  14. using Venus_RT.Modules.PMs;
  15. using Venus_RT.Devices.IODevices;
  16. using Venus_RT.Devices.EPD;
  17. using Aitex.Core.RT.DataCenter;
  18. using Aitex.Core.RT.OperationCenter;
  19. using MECF.Framework.Common.SubstrateTrackings;
  20. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.TMs;
  21. namespace Venus_RT.Devices
  22. {
  23. class JetTM : TM
  24. {
  25. private readonly IoLid _TMLid;
  26. private readonly IoLid _LLALid;
  27. private readonly IoLid _LLBLid;
  28. private readonly IoCylinder _LLATSlitDoor;
  29. private readonly IoCylinder _LLBTSlitDoor;
  30. private readonly IoCylinder _LLAESlitDoor;
  31. private readonly IoCylinder _LLBESlitDoor;
  32. private readonly IoValve _TMN2Valve;
  33. private readonly IoValve _TMSoftPumpValve;
  34. private readonly IoValve _TMFastPumpValve;
  35. private readonly IoValve _TMPurgeValve;
  36. //private readonly IoValve _TMVentValve;
  37. private readonly IoValve _TMSoftVentValve;
  38. private readonly IoValve _TMFastVentValve;
  39. private readonly IoValve _LLASoftPumpValve;
  40. private readonly IoValve _LLAFastPumpValve;
  41. private readonly IoValve _LLAPurgeValve;
  42. private readonly IoValve _LLAVentValve;
  43. private readonly IoValve _LLBSoftPumpValve;
  44. private readonly IoValve _LLBFastPumpValve;
  45. private readonly IoValve _LLBPurgeValve;
  46. private readonly IoValve _LLBVentValve;
  47. private readonly IoValve _WaferRelayValve;
  48. private readonly IoSensor _TMPowerOn;
  49. private readonly IoSensor _TMInSafty;
  50. private readonly IoSensor _WaferLeakSensor;
  51. private readonly IoSensor _EFEMSideDoorClosed;
  52. private readonly IoSensor _TMPCWFlowSwitch;
  53. private readonly IoSensor _LLAPCWFlowSwitch;
  54. private readonly IoSensor _LLBPCWFlowSwitch;
  55. private readonly IoSensor _TMLidClosed;
  56. private readonly IoSensor _CDAPressureSwitch;
  57. private readonly IoSensor _VaccumPressureSwitch;
  58. private readonly IoSensor _N2PressureSwitch;
  59. private readonly IoSensor _TMRobotNotExtendPMA;
  60. private readonly IoSensor _TMRobotNotExtendPMB;
  61. private readonly IoSensor _TMRobotNotExtendPMC;
  62. private readonly IoSensor _TMRobotNotExtendPMD;
  63. private readonly IoSensor _TMRobotNotExtendLLA;
  64. private readonly IoSensor _TMRobotNotExtendLLB;
  65. private readonly IoSensor _EfemRobotNotExtendLLA;
  66. private readonly IoSensor _EfemRobotNotExtendLLB;
  67. private readonly IoSensor _TMVacSwitch;
  68. private readonly IoSensor _LLAVacSwitch;
  69. private readonly IoSensor _LLBVacSwitch;
  70. private readonly IoSensor _TMATMSwitch;
  71. private readonly IoSensor _LLAATMSwitch;
  72. private readonly IoSensor _LLBATMSwitch;
  73. private readonly IoSwitch _LLAWaferSizeCheck;
  74. private readonly IoSwitch _LLBWaferSizeCheck;
  75. private readonly IoSwitch _PMAWaferSizeCheck;
  76. private readonly IoSwitch _PMBWaferSizeCheck;
  77. private readonly IoSwitch _PMCWaferSizeCheck;
  78. private readonly IoSwitch _PMDWaferSizeCheck;
  79. private readonly PumpBase _TMPump;
  80. private readonly PumpBase _LLPump;
  81. private readonly IoTMPressureCtrl _presureCtrl;
  82. public bool TMLidClosed => _TMLid.OFFFeedback;
  83. public bool LLALidClosed => _LLALid.OFFFeedback;
  84. public bool LLBLidClosed => _LLBLid.OFFFeedback;
  85. public bool IsLLASlitDoorClosed => _LLATSlitDoor.State == CylinderState.Close;
  86. public bool IsLLASlitDoorOpen => _LLATSlitDoor.State == CylinderState.Open;
  87. public bool IsLLAESlitDoorClosed => _LLAESlitDoor.State == CylinderState.Close;
  88. public bool IsLLAESlitDoorOpen => _LLAESlitDoor.State == CylinderState.Open;
  89. public bool IsLLBSlitDoorClosed => _LLBTSlitDoor.State == CylinderState.Close;
  90. public bool IsLLBSlitDoorOpen => _LLBTSlitDoor.State == CylinderState.Open;
  91. public bool IsLLBESlitDoorClosed => _LLBESlitDoor.State == CylinderState.Close;
  92. public bool IsLLBESlitDoorOpen => _LLBESlitDoor.State == CylinderState.Open;
  93. public bool IsTMVac => _TMVacSwitch.Value;
  94. public bool IsLLAVac => _LLAVacSwitch.Value;
  95. public bool IsLLBVac => _LLBVacSwitch.Value;
  96. public bool IsTMATM => _TMATMSwitch.Value;
  97. public bool IsLLAATM => _LLAATMSwitch.Value;
  98. public bool IsLLBATM => _LLBATMSwitch.Value;
  99. public bool IsTMPowerOn => _TMPowerOn.Value;
  100. public bool IsTMInSafty => _TMInSafty.Value;
  101. public bool IsLLAFastPumpOpen => _LLAFastPumpValve.Status;
  102. public bool IsLLASoftPumpOpen => _LLASoftPumpValve.Status;
  103. public bool IsLLBFastPumpOpen => _LLBFastPumpValve.Status;
  104. public bool IsLLBSoftPumpOpen => _LLBSoftPumpValve.Status;
  105. public bool IsLLAVentValveOpen => _LLAVentValve.Status;
  106. public bool IsLLAPurgeValveOpen => _LLAPurgeValve.Status;
  107. public bool IsLLBVentValveOpen => _LLBVentValve.Status;
  108. public bool IsLLBPurgeValveOpen => _LLBPurgeValve.Status;
  109. public bool IsTMSoftVentValveOpen => _TMSoftVentValve.Status;
  110. public bool IsTMFastVentValveOpen => _TMFastVentValve.Status;
  111. public bool IsTMPurgeValveOpen => _TMPurgeValve.Status;
  112. public bool IsTMFastPumpOpen => _TMFastPumpValve.Status;
  113. public bool IsTMSoftPumpOpen => _TMSoftPumpValve.Status;
  114. public bool TMRobotNotExtendToPMA => _TMRobotNotExtendPMA.Value;
  115. public bool TMRobotNotExtendToPMB => _TMRobotNotExtendPMB.Value;
  116. public bool TMRobotNotExtendToPMC => _TMRobotNotExtendPMC.Value;
  117. public bool TMRobotNotExtendToPMD => _TMRobotNotExtendPMD.Value;
  118. public bool TMRobotNotExtendToLLA => _TMRobotNotExtendLLA.Value;
  119. public bool TMRobotNotExtendToLLB => _TMRobotNotExtendLLB.Value;
  120. public bool EfemRobotNotExtendToLLA => _EfemRobotNotExtendLLA.Value;
  121. public bool EfemRobotNotExtendToLLB => _EfemRobotNotExtendLLB.Value;
  122. public double TMPressure => _presureCtrl.TMPressureGauge.Value;
  123. public double LLAPressure => _presureCtrl.LLAPressureGauge.Value;
  124. public double LLBPressure => _presureCtrl.LLBPressureGauge.Value;
  125. public double TMForelinePressure => _presureCtrl.MFForelineGauge.Value;
  126. public double LoadlockForelinePressure => _presureCtrl.LLForelineGauge.Value;
  127. public bool? TMPumpIsRunning => _TMPump?.IsRunning;
  128. public bool? LLPumpIsRunning => _LLPump?.IsRunning;
  129. public JetTM() : base("TM")
  130. {
  131. _TMLid = DEVICE.GetDevice<IoLid>($"TM.{VenusDevice.TMLid}");
  132. _LLALid = DEVICE.GetDevice<IoLid>($"TM.{VenusDevice.LLALid}");
  133. _LLBLid = DEVICE.GetDevice<IoLid>($"TM.{VenusDevice.LLBLid}");
  134. _LLATSlitDoor = DEVICE.GetDevice<IoCylinder>($"TM.{VenusDevice.LLATSlitDoor}");
  135. _LLBTSlitDoor = DEVICE.GetDevice<IoCylinder>($"TM.{VenusDevice.LLBTSlitDoor}");
  136. _LLAESlitDoor = DEVICE.GetDevice<IoCylinder>($"TM.{VenusDevice.LLAESlitDoor}");
  137. _LLBESlitDoor = DEVICE.GetDevice<IoCylinder>($"TM.{VenusDevice.LLBESlitDoor}");
  138. _TMN2Valve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMValveN2}");
  139. _TMSoftPumpValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMSoftPumpValve}");
  140. _TMFastPumpValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMFastPumpValve}");
  141. _TMPurgeValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMPurgeValve}");
  142. //_TMVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMVentValve}");
  143. _TMSoftVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMSoftVentValve}");
  144. _TMFastVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMFastVentValve}");
  145. _LLASoftPumpValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLASoftPumpValve}");
  146. _LLAFastPumpValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLAFastPumpValve}");
  147. _LLAPurgeValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLAPurgeValve}");
  148. _LLAVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLAVentValve}");
  149. _LLBSoftPumpValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBSoftPumpValve}");
  150. _LLBFastPumpValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBFastPumpValve}");
  151. _LLBPurgeValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBPurgeValve}");
  152. _LLBVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBVentValve}");
  153. _WaferRelayValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.ValveWaterRelay}");
  154. _TMPowerOn = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMPowerOn}");
  155. _TMInSafty = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMInSafty}");
  156. _WaferLeakSensor = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.WaferLeakSensor}");
  157. _EFEMSideDoorClosed = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.EFEMSideDoorClosed}");
  158. _TMPCWFlowSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMPCWFlowSwitch}");
  159. _LLAPCWFlowSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLAPCWFlowSwitch}");
  160. _LLBPCWFlowSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLBPCWFlowSwitch}");
  161. _TMLidClosed = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMLidClosed}");
  162. _CDAPressureSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.CDAPressureSwitch}");
  163. _VaccumPressureSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.VaccumPressureSwitch}");
  164. _N2PressureSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.N2PressureSwitch}");
  165. _TMRobotNotExtendPMA = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendPMA}");
  166. _TMRobotNotExtendPMB = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendPMB}");
  167. _TMRobotNotExtendPMC = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendPMC}");
  168. _TMRobotNotExtendPMD = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendPMD}");
  169. _TMRobotNotExtendLLA = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendLLA}");
  170. _TMRobotNotExtendLLB = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendLLB}");
  171. _EfemRobotNotExtendLLA = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.EfemRobotNotExtendLLA}");
  172. _EfemRobotNotExtendLLB = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.EfemRobotNotExtendLLB}");
  173. _TMVacSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMVacSwitch}");
  174. _LLAVacSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLAVacSwitch}");
  175. _LLBVacSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLBVacSwitch}");
  176. _TMATMSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMATMSwitch}");
  177. _LLAATMSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLAATMSwitch}");
  178. _LLBATMSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLBATMSwitch}");
  179. _LLAWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.LLAWaferSizeCheckSwitch}");
  180. _LLBWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.LLBWaferSizeCheckSwitch}");
  181. _PMAWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.PMAWaferSizeCheckSwitch}");
  182. _PMBWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.PMBWaferSizeCheckSwitch}");
  183. _PMCWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.PMCWaferSizeCheckSwitch}");
  184. _PMDWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.PMDWaferSizeCheckSwitch}");
  185. _presureCtrl = DEVICE.GetDevice<IoTMPressureCtrl>($"TM.{VenusDevice.TMPressureCtrl}");
  186. if (SC.GetValue<int>($"TM.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  187. {
  188. if (SC.GetValue<int>($"TM.DryPump.MFG") == (int)DryPumpMFG.SKY)
  189. {
  190. _TMPump = DEVICE.GetDevice<SkyPump>($"TM.{VenusDevice.MainPump}");
  191. }
  192. else if (SC.GetValue<int>($"TM.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  193. {
  194. _TMPump = DEVICE.GetDevice<EdwardsPump>($"TM.{VenusDevice.MainPump}");
  195. }
  196. }
  197. if (SC.GetValue<int>($"LLA.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  198. {
  199. if (SC.GetValue<int>($"LLA.DryPump.MFG") == (int)DryPumpMFG.SKY)
  200. {
  201. _LLPump = DEVICE.GetDevice<SkyPump>($"LLA.{VenusDevice.MainPump}");
  202. }
  203. else if (SC.GetValue<int>($"LLA.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  204. {
  205. _LLPump = DEVICE.GetDevice<EdwardsPump>($"LLA.{VenusDevice.MainPump}");
  206. }
  207. }
  208. //_LLPump = DEVICE.GetDevice<SkyPump>($"LLA.{VenusDevice.MainPump}");
  209. //_TMPump = DEVICE.GetDevice<SkyPump>($"TM.{VenusDevice.MainPump}");
  210. DATA.Subscribe("TM.PumpIsRunning", () => TMPumpIsRunning);
  211. OP.Subscribe("TM.ControlPump", (cmd, args) =>
  212. {
  213. _TMPump.SetPumpOnOff((bool)args[0]);
  214. return true;
  215. });
  216. DATA.Subscribe("LL.PumpIsRunning", () => LLPumpIsRunning);
  217. OP.Subscribe("LL.ControlPump", (cmd, args) =>
  218. {
  219. _LLPump.SetPumpOnOff((bool)args[0]);
  220. return true;
  221. });
  222. OP.Subscribe("TM.SetChamberPressure", (cmd, args) =>
  223. {
  224. _presureCtrl.SetTMPressure((int)(args[0]));
  225. return true;
  226. });
  227. }
  228. public override void Monitor()
  229. {
  230. _WaferRelayValve.TurnValve(_WaferLeakSensor.Value, out string _);
  231. }
  232. public void TurnSoftPumpValve(ModuleName mod, bool bOn)
  233. {
  234. switch(mod)
  235. {
  236. case ModuleName.TM:
  237. _TMSoftPumpValve.TurnValve(bOn, out string _);
  238. break;
  239. case ModuleName.LLA:
  240. _LLASoftPumpValve.TurnValve(bOn, out string _);
  241. break;
  242. case ModuleName.LLB:
  243. _LLBSoftPumpValve.TurnValve(bOn, out string _);
  244. break;
  245. }
  246. }
  247. public void TurnFastPumpValve(ModuleName mod, bool bOn)
  248. {
  249. switch(mod)
  250. {
  251. case ModuleName.TM:
  252. _TMFastPumpValve.TurnValve(bOn, out string _);
  253. break;
  254. case ModuleName.LLA:
  255. _LLAFastPumpValve.TurnValve(bOn, out string _);
  256. break;
  257. case ModuleName.LLB:
  258. _LLBFastPumpValve.TurnValve(bOn, out string _);
  259. break;
  260. }
  261. }
  262. public void TurnVentValve(ModuleName mod, bool bOn)
  263. {
  264. switch(mod)
  265. {
  266. case ModuleName.TM:
  267. _TMSoftVentValve.TurnValve(bOn, out string _);
  268. break;
  269. case ModuleName.LLA:
  270. _LLAVentValve.TurnValve(bOn, out string _);
  271. break;
  272. case ModuleName.LLB:
  273. _LLBVentValve.TurnValve(bOn, out string _);
  274. break;
  275. }
  276. }
  277. public void TurnPurgeValve(ModuleName mod, bool bOn)
  278. {
  279. switch(mod)
  280. {
  281. case ModuleName.TM:
  282. _TMPurgeValve.TurnValve(bOn, out string _);
  283. break;
  284. case ModuleName.LLA:
  285. _LLAPurgeValve.TurnValve(bOn, out string _);
  286. break;
  287. case ModuleName.LLB:
  288. _LLBPurgeValve.TurnValve(bOn, out string _);
  289. break;
  290. }
  291. }
  292. public void TurnN2Valve(bool bOn)
  293. {
  294. _TMN2Valve.TurnValve(bOn, out string _);
  295. }
  296. public void CloseModuleAllValves(ModuleName mod)
  297. {
  298. TurnFastPumpValve(mod, false);
  299. TurnSoftPumpValve(mod, false);
  300. TurnVentValve(mod, false);
  301. TurnPurgeValve(mod, false);
  302. if (mod == ModuleName.TM)
  303. TurnN2Valve(false);
  304. }
  305. public double GetModulePressure(ModuleName mod)
  306. {
  307. switch (mod)
  308. {
  309. case ModuleName.TM:
  310. return TMPressure;
  311. case ModuleName.LLA:
  312. return LLAPressure;
  313. case ModuleName.LLB:
  314. return LLBPressure;
  315. }
  316. return 0;
  317. }
  318. public bool IsModuleATM(ModuleName mod)
  319. {
  320. switch (mod)
  321. {
  322. case ModuleName.TM:
  323. return IsTMATM;
  324. case ModuleName.LLA:
  325. return IsLLAATM;
  326. case ModuleName.LLB:
  327. return IsLLBATM;
  328. }
  329. return false;
  330. }
  331. public bool IsModuleVaccum(ModuleName mod)
  332. {
  333. switch (mod)
  334. {
  335. case ModuleName.TM:
  336. return IsTMVac;
  337. case ModuleName.LLA:
  338. return IsLLAVac;
  339. case ModuleName.LLB:
  340. return IsLLBVac;
  341. }
  342. return false;
  343. }
  344. public bool CheckLidClosed(ModuleName mod)
  345. {
  346. switch (mod)
  347. {
  348. case ModuleName.TM:
  349. if(!TMLidClosed)
  350. {
  351. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Lid not closed");
  352. return false;
  353. }
  354. break;
  355. case ModuleName.LLA:
  356. if(!LLALidClosed)
  357. {
  358. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Lid not closed");
  359. return false;
  360. }
  361. break;
  362. case ModuleName.LLB:
  363. if (!LLBLidClosed)
  364. {
  365. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Lid not closed");
  366. return false;
  367. }
  368. break;
  369. }
  370. return true;
  371. }
  372. public bool CheckVentValveClosed(ModuleName mod)
  373. {
  374. switch (mod)
  375. {
  376. case ModuleName.TM:
  377. if (IsTMSoftVentValveOpen)
  378. {
  379. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Vent Valve not closed");
  380. return false;
  381. }
  382. break;
  383. case ModuleName.LLA:
  384. if (IsLLAVentValveOpen)
  385. {
  386. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Vent Valve not closed");
  387. return false;
  388. }
  389. break;
  390. case ModuleName.LLB:
  391. if (IsLLBVentValveOpen)
  392. {
  393. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Vent Valve not closed");
  394. return false;
  395. }
  396. break;
  397. }
  398. return true;
  399. }
  400. public bool CheckPurgeValveClosed(ModuleName mod)
  401. {
  402. switch (mod)
  403. {
  404. case ModuleName.TM:
  405. if (IsTMPurgeValveOpen)
  406. {
  407. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Purge Valve not closed");
  408. return false;
  409. }
  410. break;
  411. case ModuleName.LLA:
  412. if (IsLLAPurgeValveOpen)
  413. {
  414. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Purge Valve not closed");
  415. return false;
  416. }
  417. break;
  418. case ModuleName.LLB:
  419. if (IsLLBPurgeValveOpen)
  420. {
  421. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Purge Valve not closed");
  422. return false;
  423. }
  424. break;
  425. }
  426. return true;
  427. }
  428. public bool CheckPumpValveClosed(ModuleName mod)
  429. {
  430. switch (mod)
  431. {
  432. case ModuleName.TM:
  433. if (IsTMFastPumpOpen)
  434. {
  435. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Fast Pump Valve not closed");
  436. return false;
  437. }
  438. else if(IsTMSoftPumpOpen)
  439. {
  440. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Soft Pump Valve not closed");
  441. return false;
  442. }
  443. break;
  444. case ModuleName.LLA:
  445. if (IsLLAFastPumpOpen)
  446. {
  447. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Fast Pump Valve not closed");
  448. return false;
  449. }
  450. else if(IsLLASoftPumpOpen)
  451. {
  452. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Soft Pump Valve not closed");
  453. return false;
  454. }
  455. break;
  456. case ModuleName.LLB:
  457. if (IsLLBFastPumpOpen)
  458. {
  459. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Fast Pump Valve not closed");
  460. return false;
  461. }
  462. else if(IsLLBSoftPumpOpen)
  463. {
  464. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Soft Pump Valve not closed");
  465. return false;
  466. }
  467. break;
  468. }
  469. return true;
  470. }
  471. public bool TurnMFSlitDoor(ModuleName loadlock, bool open, out string reason)
  472. {
  473. if (open)
  474. {
  475. bool _isATMMode = SC.GetValue<bool>("System.IsATMMode");
  476. if (_isATMMode)
  477. {
  478. if (!IsTMATM)
  479. {
  480. reason = $"TM is not ATM, can not open slit door";
  481. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  482. return false;
  483. }
  484. if (!IsModuleATM(loadlock))
  485. {
  486. reason = $"{loadlock} is not ATM, can not open slit door";
  487. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  488. return false;
  489. }
  490. }
  491. else
  492. {
  493. double maxPressureDifference = SC.GetValue<double>("System.TMLLMaxPressureDifference");
  494. if (Math.Abs(GetModulePressure(loadlock) - GetModulePressure(ModuleName.TM)) > maxPressureDifference)
  495. {
  496. reason = $"{loadlock} and TM pressure difference exceeds the max limit {maxPressureDifference}";
  497. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  498. return false;
  499. }
  500. }
  501. }
  502. switch(loadlock)
  503. {
  504. case ModuleName.LLA:
  505. return _LLATSlitDoor.SetCylinder(open, out reason);
  506. case ModuleName.LLB:
  507. return _LLBTSlitDoor.SetCylinder(open, out reason);
  508. }
  509. reason = $"Invalid module {loadlock}";
  510. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  511. return false;
  512. }
  513. public bool TurnEFEMSlitDoor(ModuleName loadlock, bool open, out string reason)
  514. {
  515. if(open && !IsModuleATM(loadlock))
  516. {
  517. reason = $"{loadlock} is not ATM, can not open EFEM side slit door";
  518. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  519. return false;
  520. }
  521. switch (loadlock)
  522. {
  523. case ModuleName.LLA:
  524. return _LLAESlitDoor.SetCylinder(open, out reason);
  525. case ModuleName.LLB:
  526. return _LLBESlitDoor.SetCylinder(open, out reason);
  527. }
  528. reason = $"Invalid module {loadlock}";
  529. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  530. return false;
  531. }
  532. //public bool ControlTMPump(bool ison)
  533. //{
  534. // _TMPump.SetPumpOnOff(ison);
  535. // return true;
  536. //}
  537. }
  538. }