JetTM.cs 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122
  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.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. _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))
  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. OP.Subscribe("TM.ControlPump", (cmd, args) =>
  327. {
  328. _TMPump.SetPumpOnOff((bool)args[0]);
  329. return true;
  330. });
  331. OP.Subscribe("LLA.ControlPump", (cmd, args) =>
  332. {
  333. _LLAPump.SetPumpOnOff((bool)args[0]);
  334. return true;
  335. });
  336. OP.Subscribe("LLB.ControlPump", (cmd, args) =>
  337. {
  338. _LLBPump.SetPumpOnOff((bool)args[0]);
  339. return true;
  340. });
  341. OP.Subscribe("TM.SetChamberPressure", (cmd, args) =>
  342. {
  343. _presureCtrl.SetTMPressure((int)(args[0]));
  344. return true;
  345. });
  346. OP.Subscribe("TM.SetChamberFlow", (cmd, args) =>
  347. {
  348. _TMMfc.SetPoint = (int)(args[0]);
  349. return true;
  350. });
  351. OP.Subscribe($"TM.SetMFSlitDoor", (cmd, args) =>
  352. {
  353. var module = (ModuleName)Enum.Parse(typeof(ModuleName), args[0].ToString());
  354. TurnMFSlitDoor(module, (bool)args[1], out _);
  355. return true;
  356. });
  357. OP.Subscribe($"TM.SetEFEMSlitDoor", (cmd, args) =>
  358. {
  359. var module = (ModuleName)Enum.Parse(typeof(ModuleName), args[0].ToString());
  360. TurnEFEMSlitDoor(module, (bool)args[1], out _);
  361. return true;
  362. });
  363. _TMVacAtmMode.TurnValve(RouteManager.IsATMMode, out string _);
  364. }
  365. public override void Monitor()
  366. {
  367. if (_WaferLeakSensor.Value && _WaferRelayValve.Status == false)
  368. {
  369. _WaferRelayValve.TurnValve(true, out string _);
  370. }
  371. else if (_WaferLeakSensor.Value == false && _WaferRelayValve.Status == true)
  372. {
  373. _WaferRelayValve.TurnValve(false, out string _);
  374. }
  375. }
  376. public void TurnSoftPumpValve(ModuleName mod, bool bOn)
  377. {
  378. switch(mod)
  379. {
  380. case ModuleName.TM:
  381. _TMSoftPumpValve.TurnValve(bOn, out string _);
  382. break;
  383. case ModuleName.LLA:
  384. _LLASoftPumpValve.TurnValve(bOn, out string _);
  385. break;
  386. case ModuleName.LLB:
  387. _LLBSoftPumpValve.TurnValve(bOn, out string _);
  388. break;
  389. }
  390. }
  391. public void TurnFastPumpValve(ModuleName mod, bool bOn)
  392. {
  393. switch(mod)
  394. {
  395. case ModuleName.TM:
  396. _TMFastPumpValve.TurnValve(bOn, out string _);
  397. break;
  398. case ModuleName.LLA:
  399. _LLAFastPumpValve.TurnValve(bOn, out string _);
  400. break;
  401. case ModuleName.LLB:
  402. _LLBFastPumpValve.TurnValve(bOn, out string _);
  403. break;
  404. }
  405. }
  406. public void TurnVentValve(ModuleName mod, bool bOn)
  407. {
  408. switch (mod)
  409. {
  410. case ModuleName.TM:
  411. _TMVentValve.TurnValve(bOn, out string _);
  412. break;
  413. case ModuleName.LLA:
  414. _LLAVentValve.TurnValve(bOn, out string _);
  415. break;
  416. case ModuleName.LLB:
  417. _LLBVentValve.TurnValve(bOn, out string _);
  418. break;
  419. }
  420. }
  421. public void TurnPurgeValve(ModuleName mod, bool bOn)
  422. {
  423. switch(mod)
  424. {
  425. case ModuleName.TM:
  426. _TMPurgeValve.TurnValve(bOn, out string _);
  427. break;
  428. case ModuleName.LLA:
  429. _LLAPurgeValve.TurnValve(bOn, out string _);
  430. break;
  431. case ModuleName.LLB:
  432. _LLBPurgeValve.TurnValve(bOn, out string _);
  433. break;
  434. }
  435. }
  436. public void TurnN2Valve(bool bOn)
  437. {
  438. _TMN2Valve.TurnValve(bOn, out string _);
  439. }
  440. public void CloseModuleAllValves(ModuleName mod)
  441. {
  442. TurnFastPumpValve(mod, false);
  443. TurnSoftPumpValve(mod, false);
  444. TurnVentValve(mod, false);
  445. TurnPurgeValve(mod, false);
  446. if (mod == ModuleName.TM)
  447. TurnN2Valve(false);
  448. }
  449. public double GetModulePressure(ModuleName mod)
  450. {
  451. switch (mod)
  452. {
  453. case ModuleName.TM:
  454. return ChamberPressure;
  455. case ModuleName.LLA:
  456. return LLAPressure;
  457. case ModuleName.LLB:
  458. return LLBPressure;
  459. case ModuleName.PMA:
  460. return PMAPressure;
  461. case ModuleName.PMB:
  462. return PMBPressure;
  463. case ModuleName.PMC:
  464. return PMCPressure;
  465. case ModuleName.PMD:
  466. return PMDPressure;
  467. }
  468. return 0;
  469. }
  470. public double GetModuleForelinePressure(ModuleName mod)
  471. {
  472. switch (mod)
  473. {
  474. case ModuleName.TM:
  475. return ForelinePressure;
  476. case ModuleName.LLA:
  477. return LLAForelinePressure;
  478. case ModuleName.LLB:
  479. return LLBForelinePressure;
  480. }
  481. return 0;
  482. }
  483. public bool IsModuleATM(ModuleName mod)
  484. {
  485. switch (mod)
  486. {
  487. case ModuleName.TM:
  488. return IsTMATM;
  489. case ModuleName.LLA:
  490. return IsLLAATM;
  491. case ModuleName.LLB:
  492. return IsLLBATM;
  493. case ModuleName.PMA:
  494. return Singleton<RouteManager>.Instance.PMA.IsAtm;
  495. case ModuleName.PMB:
  496. return Singleton<RouteManager>.Instance.PMB.IsAtm;
  497. case ModuleName.PMC:
  498. return Singleton<RouteManager>.Instance.PMC.IsAtm;
  499. case ModuleName.PMD:
  500. return Singleton<RouteManager>.Instance.PMD.IsAtm;
  501. }
  502. return false;
  503. }
  504. public bool IsModuleVaccum(ModuleName mod)
  505. {
  506. switch (mod)
  507. {
  508. case ModuleName.TM:
  509. return IsTMVac;
  510. case ModuleName.LLA:
  511. return IsLLAVac;
  512. case ModuleName.LLB:
  513. return IsLLBVac;
  514. case ModuleName.PMA:
  515. return Singleton<RouteManager>.Instance.PMA.IsVac;
  516. case ModuleName.PMB:
  517. return Singleton<RouteManager>.Instance.PMB.IsVac;
  518. case ModuleName.PMC:
  519. return Singleton<RouteManager>.Instance.PMC.IsVac;
  520. case ModuleName.PMD:
  521. return Singleton<RouteManager>.Instance.PMD.IsVac;
  522. }
  523. return false;
  524. }
  525. public bool IsPMSlitdoorOpened(ModuleName mod)
  526. {
  527. switch (mod)
  528. {
  529. case ModuleName.PMA:
  530. return PMASlitDoorOpened;
  531. case ModuleName.PMB:
  532. return PMBSlitDoorOpened;
  533. case ModuleName.PMC:
  534. return PMCSlitDoorOpened;
  535. case ModuleName.PMD:
  536. return PMDSlitDoorOpened;
  537. }
  538. return false;
  539. }
  540. public bool IsPMSlitdoorClosed(ModuleName mod)
  541. {
  542. switch (mod)
  543. {
  544. case ModuleName.PMA:
  545. return PMASlitDoorClosed;
  546. case ModuleName.PMB:
  547. return PMBSlitDoorClosed;
  548. case ModuleName.PMC:
  549. return PMCSlitDoorClosed;
  550. case ModuleName.PMD:
  551. return PMDSlitDoorClosed;
  552. }
  553. return false;
  554. }
  555. public bool CheckLidClosed(ModuleName mod)
  556. {
  557. switch (mod)
  558. {
  559. case ModuleName.TM:
  560. if(!TMLidClosed)
  561. {
  562. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Lid not closed");
  563. return false;
  564. }
  565. break;
  566. case ModuleName.LLA:
  567. if(!LLALidClosed)
  568. {
  569. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Lid not closed");
  570. return false;
  571. }
  572. break;
  573. case ModuleName.LLB:
  574. if (!LLBLidClosed)
  575. {
  576. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Lid not closed");
  577. return false;
  578. }
  579. break;
  580. case ModuleName.PMA:
  581. if (!PMALidClosed)
  582. {
  583. LOG.Write(eEvent.ERR_TM, ModuleName.PMA, "PMA Lid not closed");
  584. return false;
  585. }
  586. break;
  587. case ModuleName.PMB:
  588. if (!PMBLidClosed)
  589. {
  590. LOG.Write(eEvent.ERR_TM, ModuleName.PMB, "PMB Lid not closed");
  591. return false;
  592. }
  593. break;
  594. case ModuleName.PMC:
  595. if (!PMCLidClosed)
  596. {
  597. LOG.Write(eEvent.ERR_TM, ModuleName.PMC, "PMC Lid not closed");
  598. return false;
  599. }
  600. break;
  601. case ModuleName.PMD:
  602. if (!PMDLidClosed)
  603. {
  604. LOG.Write(eEvent.ERR_TM, ModuleName.PMD, "PMD Lid not closed");
  605. return false;
  606. }
  607. break;
  608. }
  609. return true;
  610. }
  611. public bool CheckVentValveClosed(ModuleName mod)
  612. {
  613. switch (mod)
  614. {
  615. case ModuleName.TM:
  616. if (IsTMVentValveOpen)
  617. {
  618. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Vent Valve not closed");
  619. return false;
  620. }
  621. break;
  622. case ModuleName.LLA:
  623. if (IsLLAVentValveOpen)
  624. {
  625. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Vent Valve not closed");
  626. return false;
  627. }
  628. break;
  629. case ModuleName.LLB:
  630. if (IsLLBVentValveOpen)
  631. {
  632. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Vent Valve not closed");
  633. return false;
  634. }
  635. break;
  636. }
  637. return true;
  638. }
  639. public bool CheckPurgeValveClosed(ModuleName mod)
  640. {
  641. switch (mod)
  642. {
  643. case ModuleName.TM:
  644. if (IsTMPurgeValveOpen)
  645. {
  646. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Purge Valve not closed");
  647. return false;
  648. }
  649. break;
  650. case ModuleName.LLA:
  651. if (IsLLAPurgeValveOpen)
  652. {
  653. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Purge Valve not closed");
  654. return false;
  655. }
  656. break;
  657. case ModuleName.LLB:
  658. if (IsLLBPurgeValveOpen)
  659. {
  660. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Purge Valve not closed");
  661. return false;
  662. }
  663. break;
  664. }
  665. return true;
  666. }
  667. public bool CheckPumpValveClosed(ModuleName mod)
  668. {
  669. switch (mod)
  670. {
  671. case ModuleName.TM:
  672. if (IsTMFastPumpOpen)
  673. {
  674. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Fast Pump Valve not closed");
  675. return false;
  676. }
  677. else if(IsTMSoftPumpOpen)
  678. {
  679. LOG.Write(eEvent.ERR_TM, ModuleName.TM, "TM Soft Pump Valve not closed");
  680. return false;
  681. }
  682. break;
  683. case ModuleName.LLA:
  684. if (IsLLAFastPumpOpen)
  685. {
  686. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Fast Pump Valve not closed");
  687. return false;
  688. }
  689. else if(IsLLASoftPumpOpen)
  690. {
  691. LOG.Write(eEvent.ERR_TM, ModuleName.LLA, "LLA Soft Pump Valve not closed");
  692. return false;
  693. }
  694. break;
  695. case ModuleName.LLB:
  696. if (IsLLBFastPumpOpen)
  697. {
  698. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Fast Pump Valve not closed");
  699. return false;
  700. }
  701. else if(IsLLBSoftPumpOpen)
  702. {
  703. LOG.Write(eEvent.ERR_TM, ModuleName.LLB, "LLB Soft Pump Valve not closed");
  704. return false;
  705. }
  706. break;
  707. }
  708. return true;
  709. }
  710. //private bool CheckRobotNotExtendSensor(ModuleName ll, bool open, bool bTMDoor, out string reason)
  711. //{
  712. // string action = open ? "Open" : "Close";
  713. // string doorName = bTMDoor ? "TM" : "EFEM";
  714. // if (ll == ModuleName.LLA)
  715. // {
  716. // if (!_TMRobotNotExtendLLA.Value)
  717. // {
  718. // reason = $"TM Robot Not Extend to {ll} is false, can not {action} {doorName} slit door";
  719. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  720. // return false;
  721. // }
  722. // if (!_EfemRobotNotExtendLLA.Value)
  723. // {
  724. // reason = $"EFEM Robot Not Extend to {ll} is false, can not {action} {doorName} slit door";
  725. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  726. // return false;
  727. // }
  728. // }
  729. // else
  730. // {
  731. // if (!_TMRobotNotExtendLLB.Value)
  732. // {
  733. // reason = $"TM Robot Not Extend to {ll} is false, can not {action} {doorName} slit door";
  734. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  735. // return false;
  736. // }
  737. // if (!_EfemRobotNotExtendLLB.Value)
  738. // {
  739. // reason = $"EFEM Robot Not Extend to {ll} is false, can not {action} {doorName} slit door";
  740. // LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  741. // return false;
  742. // }
  743. // }
  744. // reason = "";
  745. // return true;
  746. //}
  747. public bool TurnMFSlitDoor(ModuleName moduleName, bool open, out string reason)
  748. {
  749. //if (!CheckRobotNotExtendSensor(loadlock, open, true, out reason))
  750. // return false;
  751. if (open)
  752. {
  753. if (RouteManager.IsATMMode)
  754. {
  755. if (!IsTMATM)
  756. {
  757. reason = $"TM is not ATM, can not open slit door";
  758. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  759. return false;
  760. }
  761. if (!IsModuleATM(moduleName))
  762. {
  763. reason = $"{moduleName} is not ATM, can not open slit door";
  764. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  765. return false;
  766. }
  767. }
  768. else
  769. {
  770. if(!IsModuleVaccum(moduleName))
  771. {
  772. reason = $"{moduleName} is notVacuum, can not open slit door";
  773. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  774. return false;
  775. }
  776. double maxPressureDifference = SC.GetValue<double>("System.TMLLMaxPressureDifference");
  777. if (Math.Abs(GetModulePressure(moduleName) - GetModulePressure(ModuleName.TM)) > maxPressureDifference)
  778. {
  779. reason = $"{moduleName}:{GetModulePressure(moduleName)} and TM : {GetModulePressure(ModuleName.TM)} pressure difference exceeds the max limit {maxPressureDifference}";
  780. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  781. return false;
  782. }
  783. }
  784. }
  785. switch(moduleName)
  786. {
  787. case ModuleName.LLA:
  788. return _LLATSlitDoor.SetCylinder(open, out reason);
  789. case ModuleName.LLB:
  790. return _LLBTSlitDoor.SetCylinder(open, out reason);
  791. case ModuleName.PMA:
  792. return _PMASlitDoor.SetCylinder(open, out reason);
  793. case ModuleName.PMB:
  794. return _PMBSlitDoor.SetCylinder(open, out reason);
  795. case ModuleName.PMC:
  796. return _PMCSlitDoor.SetCylinder(open, out reason);
  797. case ModuleName.PMD:
  798. return _PMDSlitDoor.SetCylinder(open, out reason);
  799. }
  800. reason = $"Invalid module {moduleName}";
  801. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  802. return false;
  803. }
  804. public bool TurnEFEMSlitDoor(ModuleName loadlock, bool open, out string reason)
  805. {
  806. //if (!CheckRobotNotExtendSensor(loadlock, open, false, out reason))
  807. // return false;
  808. if (open && !IsModuleATM(loadlock))
  809. {
  810. reason = $"{loadlock} is not ATM, can not open EFEM side slit door";
  811. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  812. return false;
  813. }
  814. switch (loadlock)
  815. {
  816. case ModuleName.LLA:
  817. return _LLAESlitDoor.SetCylinder(open, out reason);
  818. case ModuleName.LLB:
  819. return _LLBESlitDoor.SetCylinder(open, out reason);
  820. }
  821. reason = $"Invalid module {loadlock}";
  822. LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
  823. return false;
  824. }
  825. //public bool ControlTMPump(bool ison)
  826. //{
  827. // _TMPump.SetPumpOnOff(ison);
  828. // return true;
  829. //}
  830. public void SwitchTMPressureMode(bool isPressureMode)
  831. {
  832. if (isPressureMode==true)
  833. {
  834. _TM_PressureMode_Switch.TurnOn();
  835. }
  836. else
  837. {
  838. _TM_PressureMode_Switch.TurnOff();
  839. }
  840. }
  841. public void SwitchLLAPressureMode(bool isPressureMode)
  842. {
  843. if (isPressureMode == true)
  844. {
  845. _LLA_PressureMode_Switch.TurnOn();
  846. }
  847. else
  848. {
  849. _LLA_PressureMode_Switch.TurnOff();
  850. }
  851. }
  852. public void SwitchLLBPressureMode(bool isPressureMode)
  853. {
  854. if (isPressureMode == true)
  855. {
  856. _LLB_PressureMode_Switch.TurnOn();
  857. }
  858. else
  859. {
  860. _LLB_PressureMode_Switch.TurnOff();
  861. }
  862. }
  863. public void SetTMPressure(int pressureValue)
  864. {
  865. _presureCtrl.SetTMPressure(pressureValue);
  866. }
  867. public void SetLLAPressure(int pressureValue)
  868. {
  869. _presureCtrl.SetLLAPressure(pressureValue);
  870. }
  871. public void SetLLBPressure(int pressureValue)
  872. {
  873. _presureCtrl.SetLLBPressure(pressureValue);
  874. }
  875. public void SetTMFlow(int flowValue)
  876. {
  877. _TMMfc.SetPoint = (flowValue);
  878. }
  879. public void SetLLAFlow(int flowValue)
  880. {
  881. _LLAMfc.SetPoint = (flowValue);
  882. }
  883. public void SetLLBFlow(int flowValue)
  884. {
  885. _LLBMfc.SetPoint = (flowValue);
  886. }
  887. public bool CloseAllSlitDoor()
  888. {
  889. TurnMFSlitDoor(ModuleName.LLA, false, out _);
  890. TurnMFSlitDoor(ModuleName.LLB, false, out _);
  891. TurnMFSlitDoor(ModuleName.PMA, false, out _);
  892. TurnMFSlitDoor(ModuleName.PMB, false, out _);
  893. TurnMFSlitDoor(ModuleName.PMC, false, out _);
  894. TurnMFSlitDoor(ModuleName.PMD, false, out _);
  895. return true;
  896. }
  897. public bool TurnTMPump(bool ison)
  898. {
  899. _TMPump.SetPumpOnOff(ison);
  900. return true;
  901. }
  902. public bool TryGetLLPump(ModuleName LLname)
  903. {
  904. //Self
  905. if ((LLname == ModuleName.LLA && _llPumpingState == LLPumpState.LLAUsing) || (LLname == ModuleName.LLB && _llPumpingState == LLPumpState.LLBUsing))
  906. return true;
  907. //Idle
  908. if (LLname == ModuleName.LLA && !IsLLBFastPumpOpen && !IsLLBSoftPumpOpen && _llPumpingState == LLPumpState.Idle)
  909. {
  910. _llPumpingState = LLPumpState.LLAUsing;
  911. return true;
  912. }
  913. if (LLname == ModuleName.LLB && !IsLLAFastPumpOpen && !IsLLASoftPumpOpen && _llPumpingState == LLPumpState.Idle)
  914. {
  915. _llPumpingState = LLPumpState.LLBUsing;
  916. return true;
  917. }
  918. //LOG.Write(eEvent.WARN_DEFAULT_WARN, LLname, "无法打开,另一个泵正在用!");
  919. //locked
  920. return false;
  921. }
  922. public void ReleasePump(ModuleName Module)
  923. {
  924. //release pump (must do it by user)
  925. if ((Module == ModuleName.LLA && _llPumpingState == LLPumpState.LLAUsing) || (Module == ModuleName.LLB && _llPumpingState == LLPumpState.LLBUsing))
  926. _llPumpingState = LLPumpState.Idle;
  927. }
  928. public void HomeSlitDoor()
  929. {
  930. if (IsLLASlitDoorClosed == true)
  931. {
  932. _LLATSlitDoor.SetCylinder(false, out _);
  933. }
  934. else if(IsLLASlitDoorOpen == true)
  935. {
  936. _LLATSlitDoor.SetCylinder(true, out _);
  937. }
  938. if (IsLLBSlitDoorClosed == true)
  939. {
  940. _LLBTSlitDoor.SetCylinder(false, out _);
  941. }
  942. else if (IsLLBSlitDoorOpen == true)
  943. {
  944. _LLBTSlitDoor.SetCylinder(true, out _);
  945. }
  946. if (IsLLAESlitDoorClosed == true)
  947. {
  948. _LLAESlitDoor.SetCylinder(false, out _);
  949. }
  950. else if (IsLLAESlitDoorOpen == true)
  951. {
  952. _LLAESlitDoor.SetCylinder(true, out _);
  953. }
  954. if (IsLLBESlitDoorClosed == true)
  955. {
  956. _LLBESlitDoor.SetCylinder(false, out _);
  957. }
  958. else if (IsLLBESlitDoorOpen == true)
  959. {
  960. _LLBESlitDoor.SetCylinder(true, out _);
  961. }
  962. }
  963. public bool CheckPumpIsRunning(ModuleName moduleName)
  964. {
  965. switch (moduleName)
  966. {
  967. case ModuleName.LLA:
  968. return LLAPumpIsRunning;
  969. case ModuleName.LLB:
  970. return LLBPumpIsRunning;
  971. case ModuleName.TM:
  972. return TMPumpIsRunning;
  973. default:
  974. return false;
  975. }
  976. }
  977. }
  978. }