JetTM.cs 26 KB

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