JetTM.cs 47 KB

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