JetTM.cs 43 KB

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