JetTM.cs 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083
  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 MECF.Framework.RT.EquipmentLibrary.HardwareUnits.TMs;
  17. using IoMfc = Venus_RT.Devices.IODevices.IoMfc;
  18. using MECF.Framework.RT.Core.Equipments;
  19. using System.Windows.Media;
  20. namespace Venus_RT.Devices
  21. {
  22. class JetTM : TM
  23. {
  24. private readonly IoLid _TMLid;
  25. private readonly IoLid _LLALid;
  26. private readonly IoLid _LLBLid;
  27. private readonly IoLid _PMALid;
  28. private readonly IoLid _PMBLid;
  29. private readonly IoLid _PMCLid;
  30. private readonly IoLid _PMDLid;
  31. private readonly IoCylinder _LLATSlitDoor;
  32. private readonly IoCylinder _LLBTSlitDoor;
  33. private readonly IoCylinder _PMASlitDoor;
  34. private readonly IoCylinder _PMBSlitDoor;
  35. private readonly IoCylinder _PMCSlitDoor;
  36. private readonly IoCylinder _PMDSlitDoor;
  37. private readonly IoCylinder _LLAESlitDoor;
  38. private readonly IoCylinder _LLBESlitDoor;
  39. private readonly IoValve _TMN2Valve;
  40. private readonly IoValve _TMSoftPumpValve;
  41. private readonly IoValve _TMFastPumpValve;
  42. private readonly IoValve _TMPurgeValve;
  43. private readonly IoValve _TMVentValve;
  44. //private readonly IoValve _TMSoftVentValve;
  45. //private readonly IoValve _TMFastVentValve;
  46. private readonly IoValve _LLASoftPumpValve;
  47. private readonly IoValve _LLAFastPumpValve;
  48. private readonly IoValve _LLAPurgeValve;
  49. private readonly IoValve _LLAVentValve;
  50. private readonly IoValve _LLASoftVentValve;
  51. private readonly IoValve _LLAFastVentValve;
  52. private readonly IoValve _LLBSoftVentValve;
  53. private readonly IoValve _LLBFastVentValve;
  54. private readonly IoValve _LLBSoftPumpValve;
  55. private readonly IoValve _LLBFastPumpValve;
  56. private readonly IoValve _LLBPurgeValve;
  57. private readonly IoValve _LLBVentValve;
  58. private readonly IoValve _WaferRelayValve;
  59. private readonly IoValve _TMVacAtmMode;
  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 LLAForelinePressure => _presureCtrl.LLAForelineGauge.Value;
  151. public bool? TMPumpIsRunning => _TMPump?.IsRunning;
  152. public bool? LLAPumpIsRunning => _LLAPump?.IsRunning;
  153. public bool? LLBPumpIsRunning => _LLBPump?.IsRunning;
  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.OFFFeedback;
  171. public bool PMASlitDoorOpened => _PMASlitDoor.ONFeedback;
  172. public bool PMBSlitDoorClosed => _PMBSlitDoor.OFFFeedback;
  173. public bool PMBSlitDoorOpened => _PMBSlitDoor.ONFeedback;
  174. public bool PMCSlitDoorClosed => _PMCSlitDoor.OFFFeedback;
  175. public bool PMCSlitDoorOpened => _PMCSlitDoor.ONFeedback;
  176. public bool PMDSlitDoorClosed => _PMDSlitDoor.OFFFeedback;
  177. public bool PMDSlitDoorOpened => _PMDSlitDoor.ONFeedback;
  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. _LLBSoftPumpValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBSoftPumpValve}");
  227. _LLBFastPumpValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBFastPumpValve}");
  228. _LLBPurgeValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBPurgeValve}");
  229. _LLBVentValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.LLBVentValve}");
  230. _WaferRelayValve = DEVICE.GetDevice<IoValve>($"TM.{VenusDevice.ValveWaterRelay}");
  231. _TMPowerOn = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMPowerOn}");
  232. _TMInSafty = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMInSafty}");
  233. _WaferLeakSensor = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.WaferLeakSensor}");
  234. _EFEMSideDoorClosed = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.EFEMSideDoorClosed}");
  235. _TMPCWFlowSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMPCWFlowSwitch}");
  236. _LLAPCWFlowSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLAPCWFlowSwitch}");
  237. _LLBPCWFlowSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLBPCWFlowSwitch}");
  238. _TMLidClosed = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMLidClosed}");
  239. _CDAPressureSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.CDAPressureSwitch}");
  240. _VaccumPressureSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.VaccumPressureSwitch}");
  241. _N2PressureSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.N2PressureSwitch}");
  242. _TMRobotNotExtendPMA = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendPMA}");
  243. _TMRobotNotExtendPMB = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendPMB}");
  244. _TMRobotNotExtendPMC = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendPMC}");
  245. _TMRobotNotExtendPMD = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendPMD}");
  246. _TMRobotNotExtendLLA = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendLLA}");
  247. _TMRobotNotExtendLLB = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMRobotNotExtendLLB}");
  248. _EfemRobotNotExtendLLA = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.EfemRobotNotExtendLLA}");
  249. _EfemRobotNotExtendLLB = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.EfemRobotNotExtendLLB}");
  250. _TMVacSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMVacSwitch}");
  251. _LLAVacSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLAVacSwitch}");
  252. _LLBVacSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLBVacSwitch}");
  253. _TMATMSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.TMATMSwitch}");
  254. _LLAATMSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLAATMSwitch}");
  255. _LLBATMSwitch = DEVICE.GetDevice<IoSensor>($"TM.{VenusDevice.LLBATMSwitch}");
  256. _LLAWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.LLAWaferSizeCheckSwitch}");
  257. _LLBWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.LLBWaferSizeCheckSwitch}");
  258. _PMAWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.PMAWaferSizeCheckSwitch}");
  259. _PMBWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.PMBWaferSizeCheckSwitch}");
  260. _PMCWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.PMCWaferSizeCheckSwitch}");
  261. _PMDWaferSizeCheck = DEVICE.GetDevice<IoSwitch>($"TM.{VenusDevice.PMDWaferSizeCheckSwitch}");
  262. _TM_PressureMode_Switch = DEVICE.GetDevice<IoSwitch>("TM.TMPressureModeSwitch");
  263. _LLA_PressureMode_Switch = DEVICE.GetDevice<IoSwitch>("TM.LLAPressureModeSwitch");
  264. _LLB_PressureMode_Switch = DEVICE.GetDevice<IoSwitch>("TM.LLBPressureModeSwitch");
  265. _TMMfc = DEVICE.GetDevice<IoMfc>($"{Module}.TM_MFC1");
  266. _LLAMfc = DEVICE.GetDevice<IoMfc>($"{Module}.LLA_MFC1");
  267. _LLBMfc = DEVICE.GetDevice<IoMfc>($"{Module}.LLB_MFC1");
  268. _presureCtrl = DEVICE.GetDevice<IoTMPressureCtrl>($"TM.{VenusDevice.TMPressureCtrl}");
  269. if (SC.GetValue<int>($"TM.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  270. {
  271. if (SC.GetValue<int>($"TM.DryPump.MFG") == (int)DryPumpMFG.SKY)
  272. {
  273. _TMPump = DEVICE.GetDevice<SkyPump>($"TM.{VenusDevice.MainPump}");
  274. }
  275. else if (SC.GetValue<int>($"TM.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  276. {
  277. _TMPump = DEVICE.GetDevice<EdwardsPump>($"TM.{VenusDevice.MainPump}");
  278. }
  279. }
  280. if (SC.GetValue<int>($"LLA.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  281. {
  282. if (SC.GetValue<int>($"LLA.DryPump.MFG") == (int)DryPumpMFG.SKY)
  283. {
  284. _LLAPump = DEVICE.GetDevice<SkyPump>($"LLA.{VenusDevice.MainPump}");
  285. }
  286. else if (SC.GetValue<int>($"LLA.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  287. {
  288. _LLAPump = DEVICE.GetDevice<EdwardsPump>($"LLA.{VenusDevice.MainPump}");
  289. }
  290. }
  291. if (SC.GetValue<int>($"LLB.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  292. {
  293. if (SC.GetValue<int>($"LLB.DryPump.MFG") == (int)DryPumpMFG.SKY)
  294. {
  295. _LLBPump = DEVICE.GetDevice<SkyPump>($"LLB.{VenusDevice.MainPump}");
  296. }
  297. else if (SC.GetValue<int>($"LLB.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  298. {
  299. _LLBPump = DEVICE.GetDevice<EdwardsPump>($"LLB.{VenusDevice.MainPump}");
  300. }
  301. }
  302. PreRotateModules = new Dictionary<ModuleName, ModuleName>();
  303. foreach (var mod in new List<ModuleName> { ModuleName.LLA, ModuleName.LLB, ModuleName.PMA, ModuleName.PMB, ModuleName.PMC, ModuleName.PMD })
  304. {
  305. string rotateModule = SC.GetStringValue($"TM.PreRotation.{mod}");
  306. if (rotateModule.Length == 3)
  307. {
  308. ModuleName rotModule = ModuleHelper.Converter(rotateModule);
  309. if (ModuleHelper.IsPm(rotModule) || ModuleHelper.IsLoadLock(rotModule))
  310. {
  311. PreRotateModules.Add(mod, rotModule);
  312. }
  313. }
  314. }
  315. DATA.Subscribe("TM.PumpIsRunning", () => TMPumpIsRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  316. DATA.Subscribe("TM.TMLidClosed", () => TMLidClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  317. DATA.Subscribe("TM.LLALidClosed", () => LLALidClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  318. DATA.Subscribe("TM.LLBLidClosed", () => LLBLidClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  319. DATA.Subscribe("LLA.PumpIsRunning", () => LLAPumpIsRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  320. DATA.Subscribe("LLB.PumpIsRunning", () => LLBPumpIsRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
  321. DATA.Subscribe($"{Name}.LLAPressure", () => LLAPressure);
  322. DATA.Subscribe($"{Name}.LLBPressure", () => LLBPressure);
  323. OP.Subscribe("TM.ControlPump", (cmd, args) =>
  324. {
  325. _TMPump.SetPumpOnOff((bool)args[0]);
  326. return true;
  327. });
  328. OP.Subscribe("LLA.ControlPump", (cmd, args) =>
  329. {
  330. _LLAPump.SetPumpOnOff((bool)args[0]);
  331. return true;
  332. });
  333. OP.Subscribe("LLB.ControlPump", (cmd, args) =>
  334. {
  335. _LLBPump.SetPumpOnOff((bool)args[0]);
  336. return true;
  337. });
  338. OP.Subscribe("TM.SetChamberPressure", (cmd, args) =>
  339. {
  340. _presureCtrl.SetTMPressure((int)(args[0]));
  341. return true;
  342. });
  343. OP.Subscribe("TM.SetChamberFlow", (cmd, args) =>
  344. {
  345. _TMMfc.SetPoint = (int)(args[0]);
  346. return true;
  347. });
  348. OP.Subscribe($"TM.SetMFSlitDoor", (cmd, args) =>
  349. {
  350. var module = (ModuleName)Enum.Parse(typeof(ModuleName), args[0].ToString());
  351. TurnMFSlitDoor(module, (bool)args[1], out _);
  352. return true;
  353. });
  354. OP.Subscribe($"TM.SetEFEMSlitDoor", (cmd, args) =>
  355. {
  356. var module = (ModuleName)Enum.Parse(typeof(ModuleName), args[0].ToString());
  357. TurnEFEMSlitDoor(module, (bool)args[1], out _);
  358. return true;
  359. });
  360. _TMVacAtmMode.TurnValve(RouteManager.IsATMMode, out string _);
  361. }
  362. public override void Monitor()
  363. {
  364. if (_WaferLeakSensor.Value && _WaferRelayValve.Status == false)
  365. {
  366. _WaferRelayValve.TurnValve(true, out string _);
  367. }
  368. else if (_WaferLeakSensor.Value == false && _WaferRelayValve.Status == true)
  369. {
  370. _WaferRelayValve.TurnValve(false, out string _);
  371. }
  372. }
  373. public void TurnSoftPumpValve(ModuleName mod, bool bOn)
  374. {
  375. switch(mod)
  376. {
  377. case ModuleName.TM:
  378. _TMSoftPumpValve.TurnValve(bOn, out string _);
  379. break;
  380. case ModuleName.LLA:
  381. _LLASoftPumpValve.TurnValve(bOn, out string _);
  382. break;
  383. case ModuleName.LLB:
  384. _LLBSoftPumpValve.TurnValve(bOn, out string _);
  385. break;
  386. }
  387. }
  388. public void TurnFastPumpValve(ModuleName mod, bool bOn)
  389. {
  390. switch(mod)
  391. {
  392. case ModuleName.TM:
  393. _TMFastPumpValve.TurnValve(bOn, out string _);
  394. break;
  395. case ModuleName.LLA:
  396. _LLAFastPumpValve.TurnValve(bOn, out string _);
  397. break;
  398. case ModuleName.LLB:
  399. _LLBFastPumpValve.TurnValve(bOn, out string _);
  400. break;
  401. }
  402. }
  403. public void TurnVentValve(ModuleName mod, bool bOn)
  404. {
  405. switch (mod)
  406. {
  407. case ModuleName.TM:
  408. _TMVentValve.TurnValve(bOn, out string _);
  409. break;
  410. case ModuleName.LLA:
  411. _LLAVentValve.TurnValve(bOn, out string _);
  412. break;
  413. case ModuleName.LLB:
  414. _LLBVentValve.TurnValve(bOn, out string _);
  415. break;
  416. }
  417. }
  418. public void TurnPurgeValve(ModuleName mod, bool bOn)
  419. {
  420. switch(mod)
  421. {
  422. case ModuleName.TM:
  423. _TMPurgeValve.TurnValve(bOn, out string _);
  424. break;
  425. case ModuleName.LLA:
  426. _LLAPurgeValve.TurnValve(bOn, out string _);
  427. break;
  428. case ModuleName.LLB:
  429. _LLBPurgeValve.TurnValve(bOn, out string _);
  430. break;
  431. }
  432. }
  433. public void TurnN2Valve(bool bOn)
  434. {
  435. _TMN2Valve.TurnValve(bOn, out string _);
  436. }
  437. public void CloseModuleAllValves(ModuleName mod)
  438. {
  439. TurnFastPumpValve(mod, false);
  440. TurnSoftPumpValve(mod, false);
  441. TurnVentValve(mod, false);
  442. TurnPurgeValve(mod, false);
  443. if (mod == ModuleName.TM)
  444. TurnN2Valve(false);
  445. }
  446. public double GetModulePressure(ModuleName mod)
  447. {
  448. switch (mod)
  449. {
  450. case ModuleName.TM:
  451. return ChamberPressure;
  452. case ModuleName.LLA:
  453. return LLAPressure;
  454. case ModuleName.LLB:
  455. return LLBPressure;
  456. case ModuleName.PMA:
  457. return PMAPressure;
  458. case ModuleName.PMB:
  459. return PMBPressure;
  460. case ModuleName.PMC:
  461. return PMCPressure;
  462. case ModuleName.PMD:
  463. return PMDPressure;
  464. }
  465. return 0;
  466. }
  467. public bool IsModuleATM(ModuleName mod)
  468. {
  469. switch (mod)
  470. {
  471. case ModuleName.TM:
  472. return IsTMATM;
  473. case ModuleName.LLA:
  474. return IsLLAATM;
  475. case ModuleName.LLB:
  476. return IsLLBATM;
  477. case ModuleName.PMA:
  478. return Singleton<RouteManager>.Instance.PMA.IsAtm;
  479. case ModuleName.PMB:
  480. return Singleton<RouteManager>.Instance.PMB.IsAtm;
  481. case ModuleName.PMC:
  482. return Singleton<RouteManager>.Instance.PMC.IsAtm;
  483. case ModuleName.PMD:
  484. return Singleton<RouteManager>.Instance.PMD.IsAtm;
  485. }
  486. return false;
  487. }
  488. public bool IsModuleVaccum(ModuleName mod)
  489. {
  490. switch (mod)
  491. {
  492. case ModuleName.TM:
  493. return IsTMVac;
  494. case ModuleName.LLA:
  495. return IsLLAVac;
  496. case ModuleName.LLB:
  497. return IsLLBVac;
  498. case ModuleName.PMA:
  499. return Singleton<RouteManager>.Instance.PMA.IsVac;
  500. case ModuleName.PMB:
  501. return Singleton<RouteManager>.Instance.PMB.IsVac;
  502. case ModuleName.PMC:
  503. return Singleton<RouteManager>.Instance.PMC.IsVac;
  504. case ModuleName.PMD:
  505. return Singleton<RouteManager>.Instance.PMD.IsVac;
  506. }
  507. return false;
  508. }
  509. public bool IsPMSlitdoorOpened(ModuleName mod)
  510. {
  511. switch (mod)
  512. {
  513. case ModuleName.PMA:
  514. return PMASlitDoorOpened;
  515. case ModuleName.PMB:
  516. return PMBSlitDoorOpened;
  517. case ModuleName.PMC:
  518. return PMCSlitDoorOpened;
  519. case ModuleName.PMD:
  520. return PMDSlitDoorOpened;
  521. }
  522. return false;
  523. }
  524. public bool IsPMSlitdoorClosed(ModuleName mod)
  525. {
  526. switch (mod)
  527. {
  528. case ModuleName.PMA:
  529. return PMASlitDoorClosed;
  530. case ModuleName.PMB:
  531. return PMBSlitDoorClosed;
  532. case ModuleName.PMC:
  533. return PMCSlitDoorClosed;
  534. case ModuleName.PMD:
  535. return PMDSlitDoorClosed;
  536. }
  537. return false;
  538. }
  539. public bool CheckLidClosed(ModuleName mod)
  540. {
  541. switch (mod)
  542. {
  543. case ModuleName.TM:
  544. if(!TMLidClosed)
  545. {
  546. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Lid not closed");
  547. return false;
  548. }
  549. break;
  550. case ModuleName.LLA:
  551. if(!LLALidClosed)
  552. {
  553. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Lid not closed");
  554. return false;
  555. }
  556. break;
  557. case ModuleName.LLB:
  558. if (!LLBLidClosed)
  559. {
  560. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Lid not closed");
  561. return false;
  562. }
  563. break;
  564. case ModuleName.PMA:
  565. if (!PMALidClosed)
  566. {
  567. LOG.Write(eEvent.ERR_TM, ModuleName.PMA, "PMA Lid not closed");
  568. return false;
  569. }
  570. break;
  571. case ModuleName.PMB:
  572. if (!PMBLidClosed)
  573. {
  574. LOG.Write(eEvent.ERR_TM, ModuleName.PMB, "PMB Lid not closed");
  575. return false;
  576. }
  577. break;
  578. case ModuleName.PMC:
  579. if (!PMCLidClosed)
  580. {
  581. LOG.Write(eEvent.ERR_TM, ModuleName.PMC, "PMC Lid not closed");
  582. return false;
  583. }
  584. break;
  585. case ModuleName.PMD:
  586. if (!PMDLidClosed)
  587. {
  588. LOG.Write(eEvent.ERR_TM, ModuleName.PMD, "PMD Lid not closed");
  589. return false;
  590. }
  591. break;
  592. }
  593. return true;
  594. }
  595. public bool CheckVentValveClosed(ModuleName mod)
  596. {
  597. switch (mod)
  598. {
  599. case ModuleName.TM:
  600. if (IsTMVentValveOpen)
  601. {
  602. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Vent Valve not closed");
  603. return false;
  604. }
  605. break;
  606. case ModuleName.LLA:
  607. if (IsLLAVentValveOpen)
  608. {
  609. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Vent Valve not closed");
  610. return false;
  611. }
  612. break;
  613. case ModuleName.LLB:
  614. if (IsLLBVentValveOpen)
  615. {
  616. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Vent Valve not closed");
  617. return false;
  618. }
  619. break;
  620. }
  621. return true;
  622. }
  623. public bool CheckPurgeValveClosed(ModuleName mod)
  624. {
  625. switch (mod)
  626. {
  627. case ModuleName.TM:
  628. if (IsTMPurgeValveOpen)
  629. {
  630. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Purge Valve not closed");
  631. return false;
  632. }
  633. break;
  634. case ModuleName.LLA:
  635. if (IsLLAPurgeValveOpen)
  636. {
  637. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Purge Valve not closed");
  638. return false;
  639. }
  640. break;
  641. case ModuleName.LLB:
  642. if (IsLLBPurgeValveOpen)
  643. {
  644. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Purge Valve not closed");
  645. return false;
  646. }
  647. break;
  648. }
  649. return true;
  650. }
  651. public bool CheckPumpValveClosed(ModuleName mod)
  652. {
  653. switch (mod)
  654. {
  655. case ModuleName.TM:
  656. if (IsTMFastPumpOpen)
  657. {
  658. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Fast Pump Valve not closed");
  659. return false;
  660. }
  661. else if(IsTMSoftPumpOpen)
  662. {
  663. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Soft Pump Valve not closed");
  664. return false;
  665. }
  666. break;
  667. case ModuleName.LLA:
  668. if (IsLLAFastPumpOpen)
  669. {
  670. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Fast Pump Valve not closed");
  671. return false;
  672. }
  673. else if(IsLLASoftPumpOpen)
  674. {
  675. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Soft Pump Valve not closed");
  676. return false;
  677. }
  678. break;
  679. case ModuleName.LLB:
  680. if (IsLLBFastPumpOpen)
  681. {
  682. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Fast Pump Valve not closed");
  683. return false;
  684. }
  685. else if(IsLLBSoftPumpOpen)
  686. {
  687. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Soft Pump Valve not closed");
  688. return false;
  689. }
  690. break;
  691. }
  692. return true;
  693. }
  694. //private bool CheckRobotNotExtendSensor(ModuleName ll, bool open, bool bTMDoor, out string reason)
  695. //{
  696. // string action = open ? "Open" : "Close";
  697. // string doorName = bTMDoor ? "TM" : "EFEM";
  698. // if (ll == ModuleName.LLA)
  699. // {
  700. // if (!_TMRobotNotExtendLLA.Value)
  701. // {
  702. // reason = $"TM Robot Not Extend to {ll} is false, can not {action} {doorName} slit door";
  703. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  704. // return false;
  705. // }
  706. // if (!_EfemRobotNotExtendLLA.Value)
  707. // {
  708. // reason = $"EFEM Robot Not Extend to {ll} is false, can not {action} {doorName} slit door";
  709. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  710. // return false;
  711. // }
  712. // }
  713. // else
  714. // {
  715. // if (!_TMRobotNotExtendLLB.Value)
  716. // {
  717. // reason = $"TM Robot Not Extend to {ll} is false, can not {action} {doorName} slit door";
  718. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  719. // return false;
  720. // }
  721. // if (!_EfemRobotNotExtendLLB.Value)
  722. // {
  723. // reason = $"EFEM Robot Not Extend to {ll} is false, can not {action} {doorName} slit door";
  724. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  725. // return false;
  726. // }
  727. // }
  728. // reason = "";
  729. // return true;
  730. //}
  731. public bool TurnMFSlitDoor(ModuleName moduleName, bool open, out string reason)
  732. {
  733. //if (!CheckRobotNotExtendSensor(loadlock, open, true, out reason))
  734. // return false;
  735. if (open)
  736. {
  737. if (RouteManager.IsATMMode)
  738. {
  739. if (!IsTMATM)
  740. {
  741. reason = $"TM is not ATM, can not open slit door";
  742. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  743. return false;
  744. }
  745. if (!IsModuleATM(moduleName))
  746. {
  747. reason = $"{moduleName} is not ATM, can not open slit door";
  748. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  749. return false;
  750. }
  751. }
  752. else
  753. {
  754. if(!IsModuleVaccum(moduleName))
  755. {
  756. reason = $"{moduleName} is notVacuum, can not open slit door";
  757. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  758. return false;
  759. }
  760. double maxPressureDifference = SC.GetValue<double>("System.TMLLMaxPressureDifference");
  761. if (Math.Abs(GetModulePressure(moduleName) - GetModulePressure(ModuleName.TM)) > maxPressureDifference)
  762. {
  763. reason = $"{moduleName}:{GetModulePressure(moduleName)} and TM : {GetModulePressure(ModuleName.TM)} pressure difference exceeds the max limit {maxPressureDifference}";
  764. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  765. return false;
  766. }
  767. }
  768. }
  769. switch(moduleName)
  770. {
  771. case ModuleName.LLA:
  772. return _LLATSlitDoor.SetCylinder(open, out reason);
  773. case ModuleName.LLB:
  774. return _LLBTSlitDoor.SetCylinder(open, out reason);
  775. case ModuleName.PMA:
  776. return _PMASlitDoor.SetCylinder(open, out reason);
  777. case ModuleName.PMB:
  778. return _PMBSlitDoor.SetCylinder(open, out reason);
  779. case ModuleName.PMC:
  780. return _PMCSlitDoor.SetCylinder(open, out reason);
  781. case ModuleName.PMD:
  782. return _PMDSlitDoor.SetCylinder(open, out reason);
  783. }
  784. reason = $"Invalid module {moduleName}";
  785. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  786. return false;
  787. }
  788. public bool TurnEFEMSlitDoor(ModuleName loadlock, bool open, out string reason)
  789. {
  790. //if (!CheckRobotNotExtendSensor(loadlock, open, false, out reason))
  791. // return false;
  792. if (open && !IsModuleATM(loadlock))
  793. {
  794. reason = $"{loadlock} is not ATM, can not open EFEM side slit door";
  795. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  796. return false;
  797. }
  798. switch (loadlock)
  799. {
  800. case ModuleName.LLA:
  801. return _LLAESlitDoor.SetCylinder(open, out reason);
  802. case ModuleName.LLB:
  803. return _LLBESlitDoor.SetCylinder(open, out reason);
  804. }
  805. reason = $"Invalid module {loadlock}";
  806. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  807. return false;
  808. }
  809. //public bool ControlTMPump(bool ison)
  810. //{
  811. // _TMPump.SetPumpOnOff(ison);
  812. // return true;
  813. //}
  814. public void SwitchTMPressureMode(bool isPressureMode)
  815. {
  816. if (isPressureMode==true)
  817. {
  818. _TM_PressureMode_Switch.TurnOn();
  819. }
  820. else
  821. {
  822. _TM_PressureMode_Switch.TurnOff();
  823. }
  824. }
  825. public void SwitchLLAPressureMode(bool isPressureMode)
  826. {
  827. if (isPressureMode == true)
  828. {
  829. _LLA_PressureMode_Switch.TurnOn();
  830. }
  831. else
  832. {
  833. _LLA_PressureMode_Switch.TurnOff();
  834. }
  835. }
  836. public void SwitchLLBPressureMode(bool isPressureMode)
  837. {
  838. if (isPressureMode == true)
  839. {
  840. _LLB_PressureMode_Switch.TurnOn();
  841. }
  842. else
  843. {
  844. _LLB_PressureMode_Switch.TurnOff();
  845. }
  846. }
  847. public void SetTMPressure(int pressureValue)
  848. {
  849. _presureCtrl.SetTMPressure(pressureValue);
  850. }
  851. public void SetLLAPressure(int pressureValue)
  852. {
  853. _presureCtrl.SetLLAPressure(pressureValue);
  854. }
  855. public void SetLLBPressure(int pressureValue)
  856. {
  857. _presureCtrl.SetLLBPressure(pressureValue);
  858. }
  859. public void SetTMFlow(int flowValue)
  860. {
  861. _TMMfc.SetPoint = (flowValue);
  862. }
  863. public void SetLLAFlow(int flowValue)
  864. {
  865. _LLAMfc.SetPoint = (flowValue);
  866. }
  867. public void SetLLBFlow(int flowValue)
  868. {
  869. _LLBMfc.SetPoint = (flowValue);
  870. }
  871. public bool CloseAllSlitDoor()
  872. {
  873. TurnMFSlitDoor(ModuleName.LLA, false, out _);
  874. TurnMFSlitDoor(ModuleName.LLB, false, out _);
  875. TurnMFSlitDoor(ModuleName.PMA, false, out _);
  876. TurnMFSlitDoor(ModuleName.PMB, false, out _);
  877. TurnMFSlitDoor(ModuleName.PMC, false, out _);
  878. TurnMFSlitDoor(ModuleName.PMD, false, out _);
  879. return true;
  880. }
  881. public bool TurnTMPump(bool ison)
  882. {
  883. _TMPump.SetPumpOnOff(ison);
  884. return true;
  885. }
  886. public bool TryGetLLPump(ModuleName LLname)
  887. {
  888. //Self
  889. if ((LLname == ModuleName.LLA && _llPumpingState == LLPumpState.LLAUsing) || (LLname == ModuleName.LLB && _llPumpingState == LLPumpState.LLBUsing))
  890. return true;
  891. //Idle
  892. if (LLname == ModuleName.LLA && !IsLLBFastPumpOpen && !IsLLBSoftPumpOpen && _llPumpingState == LLPumpState.Idle)
  893. {
  894. _llPumpingState = LLPumpState.LLAUsing;
  895. return true;
  896. }
  897. if (LLname == ModuleName.LLB && !IsLLAFastPumpOpen && !IsLLASoftPumpOpen && _llPumpingState == LLPumpState.Idle)
  898. {
  899. _llPumpingState = LLPumpState.LLBUsing;
  900. return true;
  901. }
  902. //LOG.Write(eEvent.WARN_DEFAULT_WARN, LLname, "无法打开,另一个泵正在用!");
  903. //locked
  904. return false;
  905. }
  906. public void ReleasePump(ModuleName Module)
  907. {
  908. //release pump (must do it by user)
  909. if ((Module == ModuleName.LLA && _llPumpingState == LLPumpState.LLAUsing) || (Module == ModuleName.LLB && _llPumpingState == LLPumpState.LLBUsing))
  910. _llPumpingState = LLPumpState.Idle;
  911. }
  912. public void HomeSlitDoor()
  913. {
  914. if (IsLLASlitDoorClosed == true)
  915. {
  916. _LLATSlitDoor.SetCylinder(false, out _);
  917. }
  918. else if(IsLLASlitDoorOpen == true)
  919. {
  920. _LLATSlitDoor.SetCylinder(true, out _);
  921. }
  922. if (IsLLBSlitDoorClosed == true)
  923. {
  924. _LLBTSlitDoor.SetCylinder(false, out _);
  925. }
  926. else if (IsLLBSlitDoorOpen == true)
  927. {
  928. _LLBTSlitDoor.SetCylinder(true, out _);
  929. }
  930. if (IsLLAESlitDoorClosed == true)
  931. {
  932. _LLAESlitDoor.SetCylinder(false, out _);
  933. }
  934. else if (IsLLAESlitDoorOpen == true)
  935. {
  936. _LLAESlitDoor.SetCylinder(true, out _);
  937. }
  938. if (IsLLBESlitDoorClosed == true)
  939. {
  940. _LLBESlitDoor.SetCylinder(false, out _);
  941. }
  942. else if (IsLLBESlitDoorOpen == true)
  943. {
  944. _LLBESlitDoor.SetCylinder(true, out _);
  945. }
  946. }
  947. }
  948. }