JetTM.cs 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212
  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 MECF.Framework.Common.Device.Bases;
  8. using MECF.Framework.Common.Equipment;
  9. using System;
  10. using System.Collections.Generic;
  11. using Venus_Core;
  12. using Venus_RT.Modules;
  13. using Venus_RT.Devices.IODevices;
  14. using Aitex.Core.RT.DataCenter;
  15. using Aitex.Core.RT.OperationCenter;
  16. using IoMfc = Venus_RT.Devices.IODevices.IoMfc;
  17. namespace Venus_RT.Devices
  18. {
  19. class JetTM : MECF.Framework.RT.EquipmentLibrary.HardwareUnits.TMs.TM
  20. {
  21. private readonly IoLid _TMLid;
  22. private readonly IoLid _LLALid;
  23. private readonly IoLid _LLBLid;
  24. private readonly IoLid _PMALid;
  25. private readonly IoLid _PMBLid;
  26. private readonly IoLid _PMCLid;
  27. private readonly IoLid _PMDLid;
  28. private readonly IoCylinder _LLATSlitDoor;
  29. private readonly IoCylinder _LLBTSlitDoor;
  30. private readonly IoCylinder _PMASlitDoor;
  31. private readonly IoCylinder _PMBSlitDoor;
  32. private readonly IoCylinder _PMCSlitDoor;
  33. private readonly IoCylinder _PMDSlitDoor;
  34. private readonly IoCylinder _LLAESlitDoor;
  35. private readonly IoCylinder _LLBESlitDoor;
  36. private readonly IoValve _TMN2Valve;
  37. private readonly IoValve _TMSoftPumpValve;
  38. private readonly IoValve _TMFastPumpValve;
  39. private readonly IoValve _TMPurgeValve;
  40. private readonly IoValve _TMVentValve;
  41. //private readonly IoValve _TMSoftVentValve;
  42. //private readonly IoValve _TMFastVentValve;
  43. private readonly IoValve _LLASoftPumpValve;
  44. private readonly IoValve _LLAFastPumpValve;
  45. private readonly IoValve _LLAPurgeValve;
  46. private readonly IoValve _LLAVentValve;
  47. private readonly IoValve _LLASoftVentValve;
  48. private readonly IoValve _LLAFastVentValve;
  49. private readonly IoValve _LLBSoftVentValve;
  50. private readonly IoValve _LLBFastVentValve;
  51. private readonly IoValve _LLBSoftPumpValve;
  52. private readonly IoValve _LLBFastPumpValve;
  53. private readonly IoValve _LLBPurgeValve;
  54. private readonly IoValve _LLBVentValve;
  55. private readonly IoValve _WaferRelayValve;
  56. private readonly IoValve _TMVacAtmMode;
  57. private readonly IoValve _TMVentExhaustValve;
  58. private readonly IoValve _LLAVentExhaustValve;
  59. private readonly IoValve _LLBVentExhaustValve;
  60. private readonly IoSensor _TMPowerOn;
  61. private readonly IoSensor _TMInSafty;
  62. private readonly IoSensor _WaferLeakSensor;
  63. private readonly IoSensor _EFEMSideDoorClosed;
  64. private readonly IoSensor _TMPCWFlowSwitch;
  65. private readonly IoSensor _LLAPCWFlowSwitch;
  66. private readonly IoSensor _LLBPCWFlowSwitch;
  67. private readonly IoSensor _TMLidClosed;
  68. private readonly IoSensor _CDAPressureSwitch;
  69. private readonly IoSensor _VaccumPressureSwitch;
  70. private readonly IoSensor _N2PressureSwitch;
  71. private readonly IoSensor _TMRobotNotExtendPMA;
  72. private readonly IoSensor _TMRobotNotExtendPMB;
  73. private readonly IoSensor _TMRobotNotExtendPMC;
  74. private readonly IoSensor _TMRobotNotExtendPMD;
  75. private readonly IoSensor _TMRobotNotExtendLLA;
  76. private readonly IoSensor _TMRobotNotExtendLLB;
  77. private readonly IoSensor _EfemRobotNotExtendLLA;
  78. private readonly IoSensor _EfemRobotNotExtendLLB;
  79. private readonly IoSensor _TMVacSwitch;
  80. private readonly IoSensor _LLAVacSwitch;
  81. private readonly IoSensor _LLBVacSwitch;
  82. private readonly IoSensor _TMATMSwitch;
  83. private readonly IoSensor _LLAATMSwitch;
  84. private readonly IoSensor _LLBATMSwitch;
  85. //private readonly IoSwitch _LLAWaferSizeCheck;
  86. //private readonly IoSwitch _LLBWaferSizeCheck;
  87. //private readonly IoSwitch _PMAWaferSizeCheck;
  88. //private readonly IoSwitch _PMBWaferSizeCheck;
  89. //private readonly IoSwitch _PMCWaferSizeCheck;
  90. //private readonly IoSwitch _PMDWaferSizeCheck;
  91. private readonly IoSwitch _TM_PressureMode_Switch;
  92. private readonly IoSwitch _LLA_PressureMode_Switch;
  93. private readonly IoSwitch _LLB_PressureMode_Switch;
  94. private readonly IoMfc _TMMfc;
  95. private readonly IoMfc _LLAMfc;
  96. private readonly IoMfc _LLBMfc;
  97. private readonly PumpBase _TMPump;
  98. private readonly PumpBase _LLAPump;
  99. private readonly PumpBase _LLBPump;
  100. private readonly IoTMPressureCtrl _presureCtrl;
  101. public bool TMLidClosed => _TMLid.OFFFeedback;
  102. public bool LLALidClosed => _LLALid.OFFFeedback;
  103. public bool LLBLidClosed => _LLBLid.OFFFeedback;
  104. public bool PMALidClosed => _PMALid.OFFFeedback;
  105. public bool PMBLidClosed => _PMBLid.OFFFeedback;
  106. public bool PMCLidClosed => _PMCLid.OFFFeedback;
  107. public bool PMDLidClosed => _PMDLid.OFFFeedback;
  108. public bool IsLLASlitDoorClosed => _LLATSlitDoor.State == CylinderState.Close;
  109. public bool IsLLASlitDoorOpen => _LLATSlitDoor.State == CylinderState.Open;
  110. public bool IsLLAESlitDoorClosed => _LLAESlitDoor.State == CylinderState.Close;
  111. public bool IsLLAESlitDoorOpen => _LLAESlitDoor.State == CylinderState.Open;
  112. public bool IsLLBSlitDoorClosed => _LLBTSlitDoor.State == CylinderState.Close;
  113. public bool IsLLBSlitDoorOpen => _LLBTSlitDoor.State == CylinderState.Open;
  114. public bool IsLLBESlitDoorClosed => _LLBESlitDoor.State == CylinderState.Close;
  115. public bool IsLLBESlitDoorOpen => _LLBESlitDoor.State == CylinderState.Open;
  116. public bool IsTMVac => _TMVacSwitch.Value;
  117. public bool IsLLAVac => _LLAVacSwitch.Value;
  118. public bool IsLLBVac => _LLBVacSwitch.Value;
  119. public bool IsTMATM => _TMATMSwitch.Value;
  120. public bool IsLLAATM => _LLAATMSwitch.Value;
  121. public bool IsLLBATM => _LLBATMSwitch.Value;
  122. public bool IsTMPowerOn => _TMPowerOn.Value;
  123. public bool IsTMInSafty => _TMInSafty.Value;
  124. public bool IsLLAFastPumpOpen => _LLAFastPumpValve.Status;
  125. public bool IsLLASoftPumpOpen => _LLASoftPumpValve.Status;
  126. public bool IsLLBFastPumpOpen => _LLBFastPumpValve.Status;
  127. public bool IsLLBSoftPumpOpen => _LLBSoftPumpValve.Status;
  128. public bool IsLLAVentValveOpen => _LLAVentValve.Status;
  129. public bool IsLLAPurgeValveOpen => _LLAPurgeValve.Status;
  130. public bool IsLLBVentValveOpen => _LLBVentValve.Status;
  131. public bool IsLLBPurgeValveOpen => _LLBPurgeValve.Status;
  132. public bool IsTMVentValveOpen => _TMVentValve.Status;
  133. // public bool IsTMFastVentValveOpen => _TMFastVentValve.Status;
  134. public bool IsTMPurgeValveOpen => _TMPurgeValve.Status;
  135. public bool IsTMFastPumpOpen => _TMFastPumpValve.Status;
  136. public bool IsTMSoftPumpOpen => _TMSoftPumpValve.Status;
  137. public bool TMRobotNotExtendToPMA => _TMRobotNotExtendPMA.Value;
  138. public bool TMRobotNotExtendToPMB => _TMRobotNotExtendPMB.Value;
  139. public bool TMRobotNotExtendToPMC => _TMRobotNotExtendPMC.Value;
  140. public bool TMRobotNotExtendToPMD => _TMRobotNotExtendPMD.Value;
  141. public bool TMRobotNotExtendToLLA => _TMRobotNotExtendLLA.Value;
  142. public bool TMRobotNotExtendToLLB => _TMRobotNotExtendLLB.Value;
  143. public bool EfemRobotNotExtendToLLA => _EfemRobotNotExtendLLA.Value;
  144. public bool EfemRobotNotExtendToLLB => _EfemRobotNotExtendLLB.Value;
  145. public override double ChamberPressure => _presureCtrl.TMPressureGauge.Value;
  146. public double LLAPressure => _presureCtrl.LLAPressureGauge.Value;
  147. public double LLBPressure => _presureCtrl.LLBPressureGauge.Value;
  148. public override double ForelinePressure => _presureCtrl.MFForelineGauge.Value;
  149. public double LLAForelinePressure => _presureCtrl.LLAForelineGauge.Value;
  150. public double LLBForelinePressure => _presureCtrl.LLBForelineGauge.Value;
  151. public bool TMPumpIsRunning => _TMPump != null ? _TMPump.IsRunning : false;
  152. public bool LLAPumpIsRunning => _LLAPump != null ? _LLAPump.IsRunning : false;
  153. public bool LLBPumpIsRunning => _LLBPump != null ? _LLBPump.IsRunning : false;
  154. public double PMAPressure { get { return Singleton<RouteManager>.Instance.PMA.ChamberPressure; } }
  155. //public bool PMAIsVAC { get { return Singleton<RouteManager>.Instance.PMA.IsVac; } }
  156. public double PMBPressure { get { return Singleton<RouteManager>.Instance.PMB.ChamberPressure; } }
  157. //public bool PMBIsATM { get { return Singleton<RouteManager>.Instance.PMB.IsAtm; } }
  158. public double PMCPressure { get { return Singleton<RouteManager>.Instance.PMC.ChamberPressure; } }
  159. //public bool PMCIsATM { get { return Singleton<RouteManager>.Instance.PMC.IsAtm; } }
  160. public double PMDPressure { get { return Singleton<RouteManager>.Instance.PMD.ChamberPressure; } }
  161. //public bool PMDIsATM { get { return Singleton<RouteManager>.Instance.PMD.IsAtm; } }
  162. public enum LLPumpState
  163. {
  164. Idle,
  165. LLAUsing,
  166. LLBUsing,
  167. }
  168. LLPumpState _llPumpingState = LLPumpState.Idle;
  169. public LLPumpState LLPumpStatus { get { return _llPumpingState; } }
  170. public bool PMASlitDoorClosed => _PMASlitDoor.State == CylinderState.Close;
  171. public bool PMASlitDoorOpened => _PMASlitDoor.State == CylinderState.Open;
  172. public bool PMBSlitDoorClosed => _PMBSlitDoor.State == CylinderState.Close;
  173. public bool PMBSlitDoorOpened => _PMBSlitDoor.State == CylinderState.Open;
  174. public bool PMCSlitDoorClosed => _PMCSlitDoor.State == CylinderState.Close;
  175. public bool PMCSlitDoorOpened => _PMCSlitDoor.State == CylinderState.Open;
  176. public bool PMDSlitDoorClosed => _PMDSlitDoor.State == CylinderState.Close;
  177. public bool PMDSlitDoorOpened => _PMDSlitDoor.State == CylinderState.Open;
  178. public bool AllPMSlitDoorClosed
  179. {
  180. get
  181. {
  182. if (PMASlitDoorClosed == true && PMBSlitDoorClosed == true && PMCSlitDoorClosed == true && PMDSlitDoorClosed == true)
  183. {
  184. return true;
  185. }
  186. else
  187. {
  188. return false;
  189. }
  190. }
  191. }
  192. public Dictionary<ModuleName, ModuleName> PreRotateModules { get; private set; }
  193. public JetTM() : base("TM")
  194. {
  195. _TMLid = DEVICE.GetDevice<IoLid>($"TM.{VenusDevice.TMLid}");
  196. _LLALid = DEVICE.GetDevice<IoLid>($"TM.{VenusDevice.LLALid}");
  197. _LLBLid = DEVICE.GetDevice<IoLid>($"TM.{VenusDevice.LLBLid}");
  198. _PMALid = DEVICE.GetDevice<IoLid>($"TM.PMALid");
  199. _PMBLid = DEVICE.GetDevice<IoLid>($"TM.PMBLid");
  200. _PMCLid = DEVICE.GetDevice<IoLid>($"TM.PMCLid");
  201. _PMDLid = DEVICE.GetDevice<IoLid>($"TM.PMDLid");
  202. _LLATSlitDoor = DEVICE.GetDevice<IoCylinder>($"TM.{VenusDevice.LLATSlitDoor}");
  203. _LLBTSlitDoor = DEVICE.GetDevice<IoCylinder>($"TM.{VenusDevice.LLBTSlitDoor}");
  204. _LLAESlitDoor = DEVICE.GetDevice<IoCylinder>($"TM.{VenusDevice.LLAESlitDoor}");
  205. _LLBESlitDoor = DEVICE.GetDevice<IoCylinder>($"TM.{VenusDevice.LLBESlitDoor}");
  206. _PMASlitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.PMASlitDoor");
  207. _PMBSlitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.PMBSlitDoor");
  208. _PMCSlitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.PMCSlitDoor");
  209. _PMDSlitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.PMDSlitDoor");
  210. _TMN2Valve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMValveN2}");
  211. _TMSoftPumpValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMSoftPumpValve}");
  212. _TMFastPumpValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMFastPumpValve}");
  213. _TMPurgeValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMPurgeValve}");
  214. _TMVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMVentValve}");
  215. //_TMSoftVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMSoftVentValve}");
  216. //_TMFastVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMFastVentValve}");
  217. _LLASoftPumpValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLASoftPumpValve}");
  218. _LLAFastPumpValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLAFastPumpValve}");
  219. _LLAPurgeValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLAPurgeValve}");
  220. _LLAVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLAVentValve}");
  221. _LLASoftVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLASoftVentValve}");
  222. _LLAFastVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLAFastVentValve}");
  223. _LLBSoftVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBSoftVentValve}");
  224. _LLBFastVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBFastVentValve}");
  225. _TMVacAtmMode = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMVacAtmMode}");
  226. _TMVentExhaustValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.TMVentExhaustValve}");
  227. _LLAVentExhaustValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLAVentExhaustValve}");
  228. _LLBVentExhaustValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBVentExhaustValve}");
  229. _LLBSoftPumpValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBSoftPumpValve}");
  230. _LLBFastPumpValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBFastPumpValve}");
  231. _LLBPurgeValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBPurgeValve}");
  232. _LLBVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBVentValve}");
  233. _WaferRelayValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.ValveWaterRelay}");
  234. _TMPowerOn = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMPowerOn}");
  235. _TMInSafty = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMInSafty}");
  236. _WaferLeakSensor = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.WaferLeakSensor}");
  237. _EFEMSideDoorClosed = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.EFEMSideDoorClosed}");
  238. _TMPCWFlowSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMPCWFlowSwitch}");
  239. _LLAPCWFlowSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLAPCWFlowSwitch}");
  240. _LLBPCWFlowSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLBPCWFlowSwitch}");
  241. _TMLidClosed = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMLidClosed}");
  242. _CDAPressureSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.CDAPressureSwitch}");
  243. _VaccumPressureSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.VaccumPressureSwitch}");
  244. _N2PressureSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.N2PressureSwitch}");
  245. _TMRobotNotExtendPMA = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendPMA}");
  246. _TMRobotNotExtendPMB = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendPMB}");
  247. _TMRobotNotExtendPMC = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendPMC}");
  248. _TMRobotNotExtendPMD = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendPMD}");
  249. _TMRobotNotExtendLLA = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendLLA}");
  250. _TMRobotNotExtendLLB = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendLLB}");
  251. _EfemRobotNotExtendLLA = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.EfemRobotNotExtendLLA}");
  252. _EfemRobotNotExtendLLB = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.EfemRobotNotExtendLLB}");
  253. _TMVacSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMVacSwitch}");
  254. _LLAVacSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLAVacSwitch}");
  255. _LLBVacSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLBVacSwitch}");
  256. _TMATMSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMATMSwitch}");
  257. _LLAATMSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLAATMSwitch}");
  258. _LLBATMSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLBATMSwitch}");
  259. //_LLAWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.LLAWaferSizeCheckSwitch}");
  260. //_LLBWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.LLBWaferSizeCheckSwitch}");
  261. //_PMAWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.PMAWaferSizeCheckSwitch}");
  262. //_PMBWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.PMBWaferSizeCheckSwitch}");
  263. //_PMCWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.PMCWaferSizeCheckSwitch}");
  264. //_PMDWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.PMDWaferSizeCheckSwitch}");
  265. _TM_PressureMode_Switch = DEVICE.GetDevice<IoSwitch>("TM.TMPressureModeSwitch");
  266. _LLA_PressureMode_Switch = DEVICE.GetDevice<IoSwitch>("TM.LLAPressureModeSwitch");
  267. _LLB_PressureMode_Switch = DEVICE.GetDevice<IoSwitch>("TM.LLBPressureModeSwitch");
  268. _TMMfc = DEVICE.GetDevice<IoMfc>($"{Module}.TM_MFC1");
  269. _LLAMfc = DEVICE.GetDevice<IoMfc>($"{Module}.LLA_MFC1");
  270. _LLBMfc = DEVICE.GetDevice<IoMfc>($"{Module}.LLB_MFC1");
  271. _presureCtrl = DEVICE.GetDevice<IoTMPressureCtrl>($"TM.{VenusDevice.TMPressureCtrl}");
  272. if (SC.GetValue<int>($"TM.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  273. {
  274. if (SC.GetValue<int>($"TM.DryPump.MFG") == (int)DryPumpMFG.SKY)
  275. {
  276. _TMPump = DEVICE.GetDevice<SkyPump>($"TM.{VenusDevice.MainPump}");
  277. }
  278. else if (SC.GetValue<int>($"TM.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  279. {
  280. _TMPump = DEVICE.GetDevice<EdwardsPump>($"TM.{VenusDevice.MainPump}");
  281. }
  282. }
  283. if (SC.GetValue<int>($"LLA.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  284. {
  285. if (SC.GetValue<int>($"LLA.DryPump.MFG") == (int)DryPumpMFG.SKY)
  286. {
  287. _LLAPump = DEVICE.GetDevice<SkyPump>($"LLA.{VenusDevice.MainPump}");
  288. }
  289. else if (SC.GetValue<int>($"LLA.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  290. {
  291. _LLAPump = DEVICE.GetDevice<EdwardsPump>($"LLA.{VenusDevice.MainPump}");
  292. }
  293. }
  294. if (SC.GetValue<int>($"LLB.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  295. {
  296. if (SC.GetValue<int>($"LLB.DryPump.MFG") == (int)DryPumpMFG.SKY)
  297. {
  298. _LLBPump = DEVICE.GetDevice<SkyPump>($"LLB.{VenusDevice.MainPump}");
  299. }
  300. else if (SC.GetValue<int>($"LLB.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  301. {
  302. _LLBPump = DEVICE.GetDevice<EdwardsPump>($"LLB.{VenusDevice.MainPump}");
  303. }
  304. }
  305. PreRotateModules = new Dictionary<ModuleName, ModuleName>();
  306. foreach (var mod in new List<ModuleName> { ModuleName.LLA, ModuleName.LLB, ModuleName.PMA, ModuleName.PMB, ModuleName.PMC, ModuleName.PMD })
  307. {
  308. string rotateModule = SC.GetStringValue($"TM.PreRotation.{mod}");
  309. if (rotateModule.Length == 3)
  310. {
  311. ModuleName rotModule = ModuleHelper.Converter(rotateModule);
  312. if ((ModuleHelper.IsPm(rotModule) || ModuleHelper.IsLoadLock(rotModule)) && rotModule != mod)
  313. {
  314. PreRotateModules.Add(mod, rotModule);
  315. }
  316. }
  317. }
  318. DATA.Subscribe("TM.PumpIsRunning", () => TMPumpIsRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  319. DATA.Subscribe("TM.TMLidClosed", () => TMLidClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  320. DATA.Subscribe("TM.LLALidClosed", () => LLALidClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  321. DATA.Subscribe("TM.LLBLidClosed", () => LLBLidClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  322. DATA.Subscribe("LLA.PumpIsRunning", () => LLAPumpIsRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  323. DATA.Subscribe("LLB.PumpIsRunning", () => LLBPumpIsRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  324. DATA.Subscribe($"{Name}.LLAPressure", () => LLAPressure);
  325. DATA.Subscribe($"{Name}.LLBPressure", () => LLBPressure);
  326. DATA.Subscribe($"{Name}.PV.CDA_PRES", () => GetAiValue($"{Module}.AI_CDA_PRES_PV"));
  327. DATA.Subscribe($"{Name}.PV.N2_PRES", () => GetAiValue($"{Module}.AI_N2_PRES_PV"));
  328. DATA.Subscribe($"{Name}.PV.TMWATER_FLOW", () => GetAiValue($"{Module}.AI_TM_WATER_FLOW_PV"));
  329. DATA.Subscribe($"{Name}.PV.LLAWATER_FLOW",() => GetAiValue($"{Module}.AI_LLA_WATER_FLOW_PV"));
  330. DATA.Subscribe($"{Name}.PV.LLBWATER_FLOW",() => GetAiValue($"{Module}.AI_LLB_WATER_FLOW_PV"));
  331. OP.Subscribe("TM.ControlPump", (cmd, args) =>
  332. {
  333. _TMPump.SetPumpOnOff((bool)args[0]);
  334. return true;
  335. });
  336. OP.Subscribe("LLA.ControlPump", (cmd, args) =>
  337. {
  338. _LLAPump.SetPumpOnOff((bool)args[0]);
  339. return true;
  340. });
  341. OP.Subscribe("LLB.ControlPump", (cmd, args) =>
  342. {
  343. _LLBPump.SetPumpOnOff((bool)args[0]);
  344. return true;
  345. });
  346. OP.Subscribe("TM.SetChamberPressure", (cmd, args) =>
  347. {
  348. _presureCtrl.SetTMPressure((int)(args[0]));
  349. return true;
  350. });
  351. OP.Subscribe("TM.SetChamberFlow", (cmd, args) =>
  352. {
  353. _TMMfc.SetPoint = (int)(args[0]);
  354. return true;
  355. });
  356. OP.Subscribe($"TM.SetMFSlitDoor", (cmd, args) =>
  357. {
  358. var module = (ModuleName)Enum.Parse(typeof(ModuleName), args[0].ToString());
  359. TurnMFSlitDoor(module, (bool)args[1], out _);
  360. return true;
  361. });
  362. OP.Subscribe($"TM.SetEFEMSlitDoor", (cmd, args) =>
  363. {
  364. var module = (ModuleName)Enum.Parse(typeof(ModuleName), args[0].ToString());
  365. TurnEFEMSlitDoor(module, (bool)args[1], out _);
  366. return true;
  367. });
  368. _TMVacAtmMode.TurnValve(RouteManager.IsATMMode, out string _);
  369. }
  370. public override void Monitor()
  371. {
  372. //if (_WaferLeakSensor.Value && _WaferRelayValve.Status == false)
  373. //{
  374. // _WaferRelayValve.TurnValve(true, out string _);
  375. //}
  376. //else if (_WaferLeakSensor.Value == false && _WaferRelayValve.Status == true)
  377. //{
  378. // _WaferRelayValve.TurnValve(false, out string _);
  379. //}
  380. }
  381. public void TurnSoftPumpValve(ModuleName mod, bool bOn)
  382. {
  383. switch (mod)
  384. {
  385. case ModuleName.TM:
  386. _TMSoftPumpValve.TurnValve(bOn, out string _);
  387. break;
  388. case ModuleName.LLA:
  389. _LLASoftPumpValve.TurnValve(bOn, out string _);
  390. break;
  391. case ModuleName.LLB:
  392. _LLBSoftPumpValve.TurnValve(bOn, out string _);
  393. break;
  394. }
  395. }
  396. public void TurnFastPumpValve(ModuleName mod, bool bOn)
  397. {
  398. switch (mod)
  399. {
  400. case ModuleName.TM:
  401. _TMFastPumpValve.TurnValve(bOn, out string _);
  402. break;
  403. case ModuleName.LLA:
  404. _LLAFastPumpValve.TurnValve(bOn, out string _);
  405. break;
  406. case ModuleName.LLB:
  407. _LLBFastPumpValve.TurnValve(bOn, out string _);
  408. break;
  409. }
  410. }
  411. public void TurnVentValve(ModuleName mod, bool bOn)
  412. {
  413. switch (mod)
  414. {
  415. case ModuleName.TM:
  416. _TMVentValve.TurnValve(bOn, out string _);
  417. break;
  418. case ModuleName.LLA:
  419. _LLAVentValve.TurnValve(bOn, out string _);
  420. break;
  421. case ModuleName.LLB:
  422. _LLBVentValve.TurnValve(bOn, out string _);
  423. break;
  424. }
  425. }
  426. public void TurnPurgeValve(ModuleName mod, bool bOn)
  427. {
  428. switch (mod)
  429. {
  430. case ModuleName.TM:
  431. _TMPurgeValve.TurnValve(bOn, out string _);
  432. break;
  433. case ModuleName.LLA:
  434. _LLAPurgeValve.TurnValve(bOn, out string _);
  435. break;
  436. case ModuleName.LLB:
  437. _LLBPurgeValve.TurnValve(bOn, out string _);
  438. break;
  439. }
  440. }
  441. public void TurnN2Valve(bool bOn)
  442. {
  443. _TMN2Valve.TurnValve(bOn, out string _);
  444. }
  445. public void CloseModuleAllValves(ModuleName mod)
  446. {
  447. TurnFastPumpValve(mod, false);
  448. TurnSoftPumpValve(mod, false);
  449. TurnVentValve(mod, false);
  450. TurnPurgeValve(mod, false);
  451. if (mod == ModuleName.TM)
  452. TurnN2Valve(false);
  453. }
  454. public double GetModulePressure(ModuleName mod)
  455. {
  456. switch (mod)
  457. {
  458. case ModuleName.TM:
  459. return ChamberPressure;
  460. case ModuleName.LLA:
  461. return LLAPressure;
  462. case ModuleName.LLB:
  463. return LLBPressure;
  464. case ModuleName.PMA:
  465. return PMAPressure;
  466. case ModuleName.PMB:
  467. return PMBPressure;
  468. case ModuleName.PMC:
  469. return PMCPressure;
  470. case ModuleName.PMD:
  471. return PMDPressure;
  472. }
  473. return 0;
  474. }
  475. public double GetModuleForelinePressure(ModuleName mod)
  476. {
  477. switch (mod)
  478. {
  479. case ModuleName.TM:
  480. return ForelinePressure;
  481. case ModuleName.LLA:
  482. return LLAForelinePressure;
  483. case ModuleName.LLB:
  484. return LLBForelinePressure;
  485. }
  486. return 0;
  487. }
  488. public bool IsModuleATM(ModuleName mod)
  489. {
  490. switch (mod)
  491. {
  492. case ModuleName.TM:
  493. return IsTMATM;
  494. case ModuleName.LLA:
  495. return IsLLAATM;
  496. case ModuleName.LLB:
  497. return IsLLBATM;
  498. case ModuleName.PMA:
  499. return Singleton<RouteManager>.Instance.PMA.IsAtm;
  500. case ModuleName.PMB:
  501. return Singleton<RouteManager>.Instance.PMB.IsAtm;
  502. case ModuleName.PMC:
  503. return Singleton<RouteManager>.Instance.PMC.IsAtm;
  504. case ModuleName.PMD:
  505. return Singleton<RouteManager>.Instance.PMD.IsAtm;
  506. }
  507. return false;
  508. }
  509. public bool IsModuleVaccum(ModuleName mod)
  510. {
  511. switch (mod)
  512. {
  513. case ModuleName.TM:
  514. return IsTMVac;
  515. case ModuleName.LLA:
  516. return IsLLAVac;
  517. case ModuleName.LLB:
  518. return IsLLBVac;
  519. case ModuleName.PMA:
  520. return Singleton<RouteManager>.Instance.PMA.IsVac;
  521. case ModuleName.PMB:
  522. return Singleton<RouteManager>.Instance.PMB.IsVac;
  523. case ModuleName.PMC:
  524. return Singleton<RouteManager>.Instance.PMC.IsVac;
  525. case ModuleName.PMD:
  526. return Singleton<RouteManager>.Instance.PMD.IsVac;
  527. }
  528. return false;
  529. }
  530. public bool IsPMSlitdoorOpened(ModuleName mod)
  531. {
  532. switch (mod)
  533. {
  534. case ModuleName.PMA:
  535. return PMASlitDoorOpened;
  536. case ModuleName.PMB:
  537. return PMBSlitDoorOpened;
  538. case ModuleName.PMC:
  539. return PMCSlitDoorOpened;
  540. case ModuleName.PMD:
  541. return PMDSlitDoorOpened;
  542. }
  543. return false;
  544. }
  545. public bool IsPMSlitdoorClosed(ModuleName mod)
  546. {
  547. switch (mod)
  548. {
  549. case ModuleName.PMA:
  550. return PMASlitDoorClosed;
  551. case ModuleName.PMB:
  552. return PMBSlitDoorClosed;
  553. case ModuleName.PMC:
  554. return PMCSlitDoorClosed;
  555. case ModuleName.PMD:
  556. return PMDSlitDoorClosed;
  557. }
  558. return false;
  559. }
  560. public bool TurnExhaustValve(ModuleName mod, bool bOn)
  561. {
  562. switch (mod)
  563. {
  564. case ModuleName.TM:
  565. _TMVentExhaustValve.TurnValve(bOn, out _);
  566. return true;
  567. case ModuleName.LLA:
  568. _LLAVentExhaustValve.TurnValve(bOn, out _);
  569. return true;
  570. case ModuleName.LLB:
  571. _LLBVentExhaustValve.TurnValve(bOn, out _);
  572. return true;
  573. default:
  574. return false;
  575. }
  576. }
  577. public bool CheckLidClosed(ModuleName mod)
  578. {
  579. switch (mod)
  580. {
  581. case ModuleName.TM:
  582. if (!TMLidClosed)
  583. {
  584. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Lid not closed");
  585. return false;
  586. }
  587. break;
  588. case ModuleName.LLA:
  589. if (!LLALidClosed)
  590. {
  591. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Lid not closed");
  592. return false;
  593. }
  594. break;
  595. case ModuleName.LLB:
  596. if (!LLBLidClosed)
  597. {
  598. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Lid not closed");
  599. return false;
  600. }
  601. break;
  602. case ModuleName.PMA:
  603. if (!PMALidClosed)
  604. {
  605. LOG.Write(eEvent.ERR_TM, ModuleName.PMA, "PMA Lid not closed");
  606. return false;
  607. }
  608. break;
  609. case ModuleName.PMB:
  610. if (!PMBLidClosed)
  611. {
  612. LOG.Write(eEvent.ERR_TM, ModuleName.PMB, "PMB Lid not closed");
  613. return false;
  614. }
  615. break;
  616. case ModuleName.PMC:
  617. if (!PMCLidClosed)
  618. {
  619. LOG.Write(eEvent.ERR_TM, ModuleName.PMC, "PMC Lid not closed");
  620. return false;
  621. }
  622. break;
  623. case ModuleName.PMD:
  624. if (!PMDLidClosed)
  625. {
  626. LOG.Write(eEvent.ERR_TM, ModuleName.PMD, "PMD Lid not closed");
  627. return false;
  628. }
  629. break;
  630. }
  631. return true;
  632. }
  633. public bool CheckVentValveClosed(ModuleName mod)
  634. {
  635. switch (mod)
  636. {
  637. case ModuleName.TM:
  638. if (IsTMVentValveOpen)
  639. {
  640. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Vent Valve not closed");
  641. return false;
  642. }
  643. break;
  644. case ModuleName.LLA:
  645. if (IsLLAVentValveOpen)
  646. {
  647. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Vent Valve not closed");
  648. return false;
  649. }
  650. break;
  651. case ModuleName.LLB:
  652. if (IsLLBVentValveOpen)
  653. {
  654. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Vent Valve not closed");
  655. return false;
  656. }
  657. break;
  658. }
  659. return true;
  660. }
  661. public bool CheckPurgeValveClosed(ModuleName mod)
  662. {
  663. switch (mod)
  664. {
  665. case ModuleName.TM:
  666. if (IsTMPurgeValveOpen)
  667. {
  668. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Purge Valve not closed");
  669. return false;
  670. }
  671. break;
  672. case ModuleName.LLA:
  673. if (IsLLAPurgeValveOpen)
  674. {
  675. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Purge Valve not closed");
  676. return false;
  677. }
  678. break;
  679. case ModuleName.LLB:
  680. if (IsLLBPurgeValveOpen)
  681. {
  682. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Purge Valve not closed");
  683. return false;
  684. }
  685. break;
  686. }
  687. return true;
  688. }
  689. public bool CheckPumpValveClosed(ModuleName mod)
  690. {
  691. switch (mod)
  692. {
  693. case ModuleName.TM:
  694. if (IsTMFastPumpOpen)
  695. {
  696. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Fast Pump Valve not closed");
  697. return false;
  698. }
  699. else if (IsTMSoftPumpOpen)
  700. {
  701. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Soft Pump Valve not closed");
  702. return false;
  703. }
  704. break;
  705. case ModuleName.LLA:
  706. if (IsLLAFastPumpOpen)
  707. {
  708. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Fast Pump Valve not closed");
  709. return false;
  710. }
  711. else if (IsLLASoftPumpOpen)
  712. {
  713. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Soft Pump Valve not closed");
  714. return false;
  715. }
  716. break;
  717. case ModuleName.LLB:
  718. if (IsLLBFastPumpOpen)
  719. {
  720. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Fast Pump Valve not closed");
  721. return false;
  722. }
  723. else if (IsLLBSoftPumpOpen)
  724. {
  725. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Soft Pump Valve not closed");
  726. return false;
  727. }
  728. break;
  729. }
  730. return true;
  731. }
  732. //private bool CheckRobotNotExtendSensor(ModuleName ll, bool open, bool bTMDoor, out string reason)
  733. //{
  734. // string action = open ? "Open" : "Close";
  735. // string doorName = bTMDoor ? "TM" : "EFEM";
  736. // if (ll == ModuleName.LLA)
  737. // {
  738. // if (!_TMRobotNotExtendLLA.Value)
  739. // {
  740. // reason = $"TM Robot Not Extend to {ll} is false, can not {action} {doorName} slit door";
  741. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  742. // return false;
  743. // }
  744. // if (!_EfemRobotNotExtendLLA.Value)
  745. // {
  746. // reason = $"EFEM Robot Not Extend to {ll} is false, can not {action} {doorName} slit door";
  747. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  748. // return false;
  749. // }
  750. // }
  751. // else
  752. // {
  753. // if (!_TMRobotNotExtendLLB.Value)
  754. // {
  755. // reason = $"TM Robot Not Extend to {ll} is false, can not {action} {doorName} slit door";
  756. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  757. // return false;
  758. // }
  759. // if (!_EfemRobotNotExtendLLB.Value)
  760. // {
  761. // reason = $"EFEM Robot Not Extend to {ll} is false, can not {action} {doorName} slit door";
  762. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  763. // return false;
  764. // }
  765. // }
  766. // reason = "";
  767. // return true;
  768. //}
  769. public bool TurnMFSlitDoor(ModuleName moduleName, bool open, out string reason)
  770. {
  771. //if (!CheckRobotNotExtendSensor(loadlock, open, true, out reason))
  772. // return false;
  773. if (open)
  774. {
  775. if (RouteManager.IsATMMode)
  776. {
  777. if (!IsTMATM)
  778. {
  779. reason = $"TM is not ATM, can not open slit door";
  780. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  781. return false;
  782. }
  783. if (!IsModuleATM(moduleName))
  784. {
  785. reason = $"{moduleName} is not ATM, can not open slit door";
  786. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  787. return false;
  788. }
  789. }
  790. else
  791. {
  792. if (!IsModuleVaccum(moduleName))
  793. {
  794. reason = $"{moduleName} is notVacuum, can not open slit door";
  795. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  796. return false;
  797. }
  798. double maxPressureDifference;
  799. switch (moduleName)
  800. {
  801. case ModuleName.LLA:
  802. case ModuleName.LLB:
  803. maxPressureDifference = SC.GetValue<double>("System.TMLLMaxPressureDifference");
  804. break;
  805. case ModuleName.PMA:
  806. case ModuleName.PMB:
  807. case ModuleName.PMC:
  808. case ModuleName.PMD:
  809. maxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
  810. break;
  811. default:
  812. maxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
  813. break;
  814. }
  815. if (Math.Abs(GetModulePressure(moduleName) - GetModulePressure(ModuleName.TM)) > maxPressureDifference)
  816. {
  817. reason = $"{moduleName}:{GetModulePressure(moduleName)} and TM : {GetModulePressure(ModuleName.TM)} pressure difference exceeds the max limit {maxPressureDifference}";
  818. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  819. return false;
  820. }
  821. }
  822. }
  823. switch (moduleName)
  824. {
  825. case ModuleName.LLA:
  826. return _LLATSlitDoor.SetCylinder(open, out reason);
  827. case ModuleName.LLB:
  828. return _LLBTSlitDoor.SetCylinder(open, out reason);
  829. case ModuleName.PMA:
  830. return _PMASlitDoor.SetCylinder(open, out reason);
  831. case ModuleName.PMB:
  832. return _PMBSlitDoor.SetCylinder(open, out reason);
  833. case ModuleName.PMC:
  834. return _PMCSlitDoor.SetCylinder(open, out reason);
  835. case ModuleName.PMD:
  836. return _PMDSlitDoor.SetCylinder(open, out reason);
  837. }
  838. reason = $"Invalid module {moduleName}";
  839. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  840. return false;
  841. }
  842. public bool TurnEFEMSlitDoor(ModuleName loadlock, bool open, out string reason)
  843. {
  844. //if (!CheckRobotNotExtendSensor(loadlock, open, false, out reason))
  845. // return false;
  846. if (open && !IsModuleATM(loadlock))
  847. {
  848. reason = $"{loadlock} is not ATM, can not open EFEM side slit door";
  849. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  850. return false;
  851. }
  852. switch (loadlock)
  853. {
  854. case ModuleName.LLA:
  855. return _LLAESlitDoor.SetCylinder(open, out reason);
  856. case ModuleName.LLB:
  857. return _LLBESlitDoor.SetCylinder(open, out reason);
  858. }
  859. reason = $"Invalid module {loadlock}";
  860. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  861. return false;
  862. }
  863. //public bool ControlTMPump(bool ison)
  864. //{
  865. // _TMPump.SetPumpOnOff(ison);
  866. // return true;
  867. //}
  868. public void SwitchTMPressureMode(bool isPressureMode)
  869. {
  870. if (isPressureMode == true)
  871. {
  872. _TM_PressureMode_Switch.TurnOn();
  873. }
  874. else
  875. {
  876. _TM_PressureMode_Switch.TurnOff();
  877. }
  878. }
  879. public void SwitchLLAPressureMode(bool isPressureMode)
  880. {
  881. if (isPressureMode == true)
  882. {
  883. _LLA_PressureMode_Switch.TurnOn();
  884. }
  885. else
  886. {
  887. _LLA_PressureMode_Switch.TurnOff();
  888. }
  889. }
  890. public void SwitchLLBPressureMode(bool isPressureMode)
  891. {
  892. if (isPressureMode == true)
  893. {
  894. _LLB_PressureMode_Switch.TurnOn();
  895. }
  896. else
  897. {
  898. _LLB_PressureMode_Switch.TurnOff();
  899. }
  900. }
  901. public void SetTMPressure(int pressureValue)
  902. {
  903. _presureCtrl.SetTMPressure(pressureValue);
  904. }
  905. public void SetLLAPressure(int pressureValue)
  906. {
  907. _presureCtrl.SetLLAPressure(pressureValue);
  908. }
  909. public void SetLLBPressure(int pressureValue)
  910. {
  911. _presureCtrl.SetLLBPressure(pressureValue);
  912. }
  913. public void SetTMFlow(int flowValue)
  914. {
  915. SwitchTMPressureMode(false);
  916. _TMMfc.SetPoint = (flowValue);
  917. }
  918. public void SetLLAFlow(double flowValue)
  919. {
  920. SwitchLLAPressureMode(false);
  921. _LLAMfc.SetPoint = (flowValue);
  922. }
  923. public void SetLLBFlow(double flowValue)
  924. {
  925. SwitchLLBPressureMode(false);
  926. _LLBMfc.SetPoint = (flowValue);
  927. }
  928. public bool CloseAllSlitDoor()
  929. {
  930. TurnMFSlitDoor(ModuleName.LLA, false, out _);
  931. TurnMFSlitDoor(ModuleName.LLB, false, out _);
  932. TurnMFSlitDoor(ModuleName.PMA, false, out _);
  933. TurnMFSlitDoor(ModuleName.PMB, false, out _);
  934. TurnMFSlitDoor(ModuleName.PMC, false, out _);
  935. TurnMFSlitDoor(ModuleName.PMD, false, out _);
  936. return true;
  937. }
  938. public bool TurnTMPump(bool ison)
  939. {
  940. _TMPump.SetPumpOnOff(ison);
  941. return true;
  942. }
  943. public bool TryGetLLPump(ModuleName LLname)
  944. {
  945. //Self
  946. if ((LLname == ModuleName.LLA && _llPumpingState == LLPumpState.LLAUsing) || (LLname == ModuleName.LLB && _llPumpingState == LLPumpState.LLBUsing))
  947. return true;
  948. //Idle
  949. if (LLname == ModuleName.LLA && !IsLLBFastPumpOpen && !IsLLBSoftPumpOpen && _llPumpingState == LLPumpState.Idle)
  950. {
  951. _llPumpingState = LLPumpState.LLAUsing;
  952. return true;
  953. }
  954. if (LLname == ModuleName.LLB && !IsLLAFastPumpOpen && !IsLLASoftPumpOpen && _llPumpingState == LLPumpState.Idle)
  955. {
  956. _llPumpingState = LLPumpState.LLBUsing;
  957. return true;
  958. }
  959. //LOG.Write(eEvent.WARN_DEFAULT_WARN, LLname, "无法打开,另一个泵正在用!");
  960. //locked
  961. return false;
  962. }
  963. public void ReleasePump(ModuleName Module)
  964. {
  965. //release pump (must do it by user)
  966. if ((Module == ModuleName.LLA && _llPumpingState == LLPumpState.LLAUsing) || (Module == ModuleName.LLB && _llPumpingState == LLPumpState.LLBUsing))
  967. _llPumpingState = LLPumpState.Idle;
  968. }
  969. public void HomeSlitDoor()
  970. {
  971. if (IsLLASlitDoorClosed == true)
  972. {
  973. _LLATSlitDoor.SetCylinder(false, out _);
  974. }
  975. else if (IsLLASlitDoorOpen == true)
  976. {
  977. _LLATSlitDoor.SetCylinder(true, out _);
  978. }
  979. if (IsLLBSlitDoorClosed == true)
  980. {
  981. _LLBTSlitDoor.SetCylinder(false, out _);
  982. }
  983. else if (IsLLBSlitDoorOpen == true)
  984. {
  985. _LLBTSlitDoor.SetCylinder(true, out _);
  986. }
  987. if (IsLLAESlitDoorClosed == true)
  988. {
  989. _LLAESlitDoor.SetCylinder(false, out _);
  990. }
  991. else if (IsLLAESlitDoorOpen == true)
  992. {
  993. _LLAESlitDoor.SetCylinder(true, out _);
  994. }
  995. if (IsLLBESlitDoorClosed == true)
  996. {
  997. _LLBESlitDoor.SetCylinder(false, out _);
  998. }
  999. else if (IsLLBESlitDoorOpen == true)
  1000. {
  1001. _LLBESlitDoor.SetCylinder(true, out _);
  1002. }
  1003. }
  1004. public bool CheckPumpIsRunning(ModuleName moduleName)
  1005. {
  1006. switch (moduleName)
  1007. {
  1008. case ModuleName.LLA:
  1009. return LLAPumpIsRunning;
  1010. case ModuleName.LLB:
  1011. return LLBPumpIsRunning;
  1012. case ModuleName.TM:
  1013. return TMPumpIsRunning;
  1014. default:
  1015. return false;
  1016. }
  1017. }
  1018. public bool LLDoorAllClosed(ModuleName moduleName)
  1019. {
  1020. if (moduleName == ModuleName.LLA)
  1021. {
  1022. return IsLLASlitDoorClosed && IsLLAESlitDoorClosed;
  1023. }
  1024. else if (moduleName == ModuleName.LLB)
  1025. {
  1026. return IsLLBSlitDoorClosed && IsLLBESlitDoorClosed;
  1027. }
  1028. return false;
  1029. }
  1030. public bool TMRobotNotExtendModule(ModuleName moduleName)
  1031. {
  1032. switch (moduleName)
  1033. {
  1034. case ModuleName.PMA:
  1035. return TMRobotNotExtendToPMA;
  1036. case ModuleName.PMB:
  1037. return TMRobotNotExtendToPMB;
  1038. case ModuleName.PMC:
  1039. return TMRobotNotExtendToPMC;
  1040. case ModuleName.PMD:
  1041. return TMRobotNotExtendToPMD;
  1042. case ModuleName.LLA:
  1043. return TMRobotNotExtendToLLA;
  1044. case ModuleName.LLB:
  1045. return TMRobotNotExtendToLLB;
  1046. default: return false;
  1047. }
  1048. }
  1049. public bool EFEMRobotNotExtendModule(ModuleName moduleName)
  1050. {
  1051. switch (moduleName)
  1052. {
  1053. case ModuleName.LLA:
  1054. return EfemRobotNotExtendToLLA;
  1055. case ModuleName.LLB:
  1056. return EfemRobotNotExtendToLLB;
  1057. default: return false;
  1058. }
  1059. }
  1060. }
  1061. }