JetDualPM.cs 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using Aitex.Core.Common;
  8. using Aitex.Core.Common.DeviceData;
  9. using Aitex.Core.RT.DataCenter;
  10. using Aitex.Core.RT.Device;
  11. using Aitex.Core.RT.Device.Unit;
  12. using Aitex.Core.RT.Event;
  13. using Aitex.Core.RT.OperationCenter;
  14. using Aitex.Core.RT.SCCore;
  15. using Aitex.Core.Util;
  16. using Aitex.Sorter.Common;
  17. using JetVirgoPM.PMs;
  18. using JetVirgoPM.PMs.Routines;
  19. using MECF.Framework.Common.Device.Bases;
  20. using MECF.Framework.Common.Equipment;
  21. using MECF.Framework.Common.Schedulers;
  22. using MECF.Framework.Common.SubstrateTrackings;
  23. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs;
  24. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Pumps.EdwardsPump;
  25. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Pumps.SkyPump;
  26. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.JEL;
  27. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Rorze;
  28. using MECF.Framework.RT.EquipmentLibrary.Unit;
  29. using MECF.Framework.RT.ModuleLibrary.SystemModules;
  30. namespace JetVirgoPM.Devices
  31. {
  32. enum ValveType
  33. {
  34. PROCESS,
  35. N2,
  36. FAST_PUMP,
  37. SOFT_PUMP,
  38. FAST_VENT,
  39. PURGE,
  40. Mfc1,
  41. Mfc2,
  42. Mfc3,
  43. Mfc4,
  44. Mfc5,
  45. Mfc6,
  46. }
  47. class JetDualPM : DualPM
  48. {
  49. // ----------------------------Fields--------------------------
  50. //
  51. private readonly IoLid _Lid;
  52. //private readonly IoCylinder _LidLocker;
  53. private readonly IoMessage _Messager;
  54. private readonly IoSensor _ATM_sw;
  55. private readonly IoSensor _VAC_sw;
  56. //private readonly IoSensor _WLK_sw;
  57. //private readonly IoSensor _CDAPressure;
  58. private readonly IoSensor _CoolantInletTC1;
  59. private readonly IoSensor _CoolantInletTC2;
  60. private readonly IoSensor _CoolantOutletTC1;
  61. private readonly IoSensor _CoolantOutletTC2;
  62. //private readonly IoSensor _ArmNotExtend;
  63. private readonly IoSensor _N2Pressure_sw;
  64. private readonly IoSensor _LEOT1;
  65. private readonly IoSensor _LEOT2;
  66. private readonly IoSensor _GBInterlock;
  67. private readonly IoSensor _TMRobotNotExtendToPM1;
  68. private readonly IoSensor _TMRobotNotExtendToPM2;
  69. //private readonly IoSensor _TMInSafety;
  70. private readonly IoSensor _CHBOTSW;
  71. private readonly IoSensor _SourceFan;
  72. private readonly IoSensor _GeneratorInterlock;
  73. //private readonly IoSensor _RFG_Interlock;
  74. private readonly IoPressureControl _pressureController;
  75. private readonly IoHeater _ChamberHeater1;
  76. private readonly IoHeater _HeaterChamber;
  77. private readonly IoHeater _ForelineHeater;
  78. private readonly IoHeater _LEHeater1;
  79. private readonly IoHeater _LEHeater2;
  80. private readonly IoValve _SoftPumpValve;
  81. private readonly IoValve _FastPumpValve;
  82. private readonly IoValve _ProcessValve;
  83. private readonly IoValve _N2Valve;
  84. private readonly IoValve _PurgeValve;
  85. private readonly IoValve _FastVentValve;
  86. private readonly IoValve _Mfc1Valve;
  87. private readonly IoValve _Mfc2Valve;
  88. private readonly IoValve _Mfc3Valve;
  89. private readonly IoValve _Mfc4Valve;
  90. private readonly IoValve _Mfc5Valve;
  91. private readonly IoValve _Mfc6Valve;
  92. //private readonly IoValve _N2SupplyValve;
  93. //private readonly IoCylinder _slitDoor1;
  94. //private readonly IoCylinder _slitDoor2;
  95. private readonly IoCylinder _LiftPin1;
  96. private readonly IoCylinder _LiftPin2;
  97. private readonly IoCylinder _GuidePin1; // 3'
  98. private readonly IoCylinder _GuidePin2; // 4'
  99. private readonly IoLiftPin _ioLiftPin1;
  100. private readonly IoLiftPin _ioLiftPin2;
  101. private readonly RfPowerBase _Generator1;
  102. private readonly RfPowerBase _Generator2;
  103. private readonly RfPowerBase _GeneratorBias1;
  104. private readonly RfPowerBase _GeneratorBias2;
  105. private readonly RfMatchBase _Match1;
  106. private readonly RfMatchBase _Match2;
  107. private readonly RfMatchBase _BiasMatch1;
  108. private readonly RfMatchBase _BiasMatch2;
  109. private readonly PumpBase _MainPump;
  110. private readonly ChillerBase _Chiller1;
  111. private readonly ChillerBase _Chiller2;
  112. private readonly IoGasStick[] _gasLines;
  113. private readonly R_TRIG _trigBasePressure = new R_TRIG();
  114. private readonly R_TRIG _trigBaseTemperature1 = new R_TRIG();
  115. private readonly R_TRIG _trigBaseTemperature2 = new R_TRIG();
  116. private double BasePressure;
  117. private double BaseTemperature;
  118. private bool EnableBiasRF1 = false;
  119. private bool EnableBiasRF2 = false;
  120. private int _bigWafer = 0;
  121. private int _midWafer = 0;
  122. private int _smallWafer = 0;
  123. private int gasCount = 0;
  124. private bool _IsPlus;
  125. public bool _Chamber1Disabled;
  126. public bool _Chamber2Disabled;
  127. private bool _guidePinInstalled;
  128. public bool GuidePinInstalled
  129. {
  130. get { return _guidePinInstalled; }
  131. }
  132. public bool IsPlus => _IsPlus;
  133. public bool AlarmPro = false;
  134. // --------------------------Properties------------------------
  135. //
  136. public new ModuleName Module { get; }
  137. // 门的状态
  138. public bool IsSlitDoor1Closed => !(bool)DATA.Poll($"TM.Left{Module}SlitDoorOpen");
  139. public bool IsSlitDoor2Closed => !(bool)DATA.Poll($"TM.Right{Module}SlitDoorOpen");
  140. public bool IsTMRobotNotExtendToPM1 => _TMRobotNotExtendToPM1.Value;
  141. public bool IsTMRobotNotExtendToPM2 => _TMRobotNotExtendToPM2.Value;
  142. // 盖子的状态
  143. public bool IsLidClosed => _Lid.OFFFeedback;
  144. // 盖子的锁
  145. //public bool IsLidLocked => !_LidLocker.ONSetPoint && _LidLocker.OFFSetPoint;
  146. public MovementPosition LiftPinPosition
  147. {
  148. get
  149. {
  150. MovementPosition pos = MovementPosition.Unknown;
  151. if (_LiftPin1.ONFeedback && !_LiftPin1.OFFFeedback)
  152. {
  153. pos = MovementPosition.Up;
  154. }
  155. else if (!_LiftPin1.ONFeedback && _LiftPin1.OFFFeedback)
  156. {
  157. pos = MovementPosition.Down;
  158. }
  159. return pos;
  160. }
  161. }
  162. public MovementPosition GuidePin1Position
  163. {
  164. get
  165. {
  166. if (_smallWafer == 0)
  167. return MovementPosition.Down;
  168. MovementPosition res = MovementPosition.Unknown;
  169. if (_GuidePin1.ONFeedback && !_GuidePin1.OFFFeedback)
  170. {
  171. res = MovementPosition.Up;
  172. }
  173. else if (_GuidePin1.OFFFeedback && !_GuidePin1.ONFeedback)
  174. {
  175. res = MovementPosition.Down;
  176. }
  177. return res;
  178. }
  179. }
  180. public MovementPosition GuidePin2Position
  181. {
  182. get
  183. {
  184. if (_midWafer == 0)
  185. return MovementPosition.Down;
  186. MovementPosition res = MovementPosition.Unknown;
  187. if (_GuidePin2.ONFeedback && !_GuidePin2.OFFFeedback)
  188. {
  189. res = MovementPosition.Up;
  190. }
  191. else if (_GuidePin2.OFFFeedback && !_GuidePin2.ONFeedback)
  192. {
  193. res = MovementPosition.Down;
  194. }
  195. return res;
  196. }
  197. }
  198. public bool Chamber1Disable
  199. {
  200. get
  201. {
  202. return SC.GetValue<bool>($"System.SetUp.{Module}Chamber1Disabled.IsInstalled");
  203. }
  204. }
  205. public bool Chamber2Disable
  206. {
  207. get
  208. {
  209. return SC.GetValue<bool>($"System.SetUp.{Module}Chamber2Disabled.IsInstalled");
  210. }
  211. }
  212. public override bool IsError
  213. {
  214. get
  215. {
  216. bool IsGeneratorBias1Error = SC.GetValue<bool>($"{Module}.BiasRf1.EnableBiasRF") && _GeneratorBias1.IsError;
  217. bool IsGeneratorBias2Error = SC.GetValue<bool>($"{Module}.BiasRf2.EnableBiasRF") && _GeneratorBias2.IsError;
  218. return _MainPump.IsError || _Generator1.IsError || _Generator2.IsError || IsGeneratorBias1Error || IsGeneratorBias2Error;
  219. }
  220. }
  221. public override bool IsIdle { get; }
  222. // 腔体压力
  223. public bool IsPressureToleranceEnabled
  224. {
  225. get => _pressureController.EnableTolerance;
  226. set => _pressureController.EnableTolerance = value;
  227. }
  228. public override double ChamberPressure => _pressureController.ProcessGauge.Value;
  229. public override double ChamberPressurePressure => _pressureController.PressureGauge.Value;
  230. public double ForelinePressure => _pressureController.ForelineGauge.Value;
  231. public PressureCtrlMode PressureMode => _pressureController.ThrottleValve.PressureMode;
  232. public double TargetPressure => _pressureController.TargetPressure;
  233. // 压力信号
  234. public bool IsATM => _ATM_sw.Value;
  235. public bool IsVAC => _VAC_sw.Value;
  236. //public bool IsWLK => _WLK_sw.Value;
  237. public bool IsGeneratorInterlockOk => _GeneratorInterlock.Value;
  238. // 温度
  239. public float ChamberTempSP1 => _ChamberHeater1.ControlTcSetPoint;
  240. public float ChamberTempFB1 => _ChamberHeater1.ControlTcFeedback;
  241. public float CoolantInletTempFB1 => _ChamberHeater1.CoolantInletTcFeedback;
  242. public float CoolantOutletTempFB1 => _ChamberHeater1.CoolantOutletTcFeedback;
  243. public float ChamberTempSP2 => _HeaterChamber.ControlTcSetPoint;
  244. public float ChamberTempFB2 => _HeaterChamber.ControlTcFeedback;
  245. public float CoolantInletTempFB2 => _HeaterChamber.CoolantInletTcFeedback;
  246. public float CoolantOutletTempFB2 => _HeaterChamber.CoolantOutletTcFeedback;
  247. // LE温度
  248. public float LETempSP1 => _LEHeater1.ControlTcSetPoint;
  249. public float LETempFB1 => _LEHeater1.ControlTcFeedback;
  250. public string LETempFB1Name => _LEHeater1.Name;
  251. public float LECoolantInletTempFB1 => _LEHeater1.CoolantInletTcFeedback;
  252. public float LECoolantOutletTempFB1 => _LEHeater1.CoolantOutletTcFeedback;
  253. public float LETempSP2 => _LEHeater2.ControlTcSetPoint;
  254. public float LETempFB2 => _LEHeater2.ControlTcFeedback;
  255. public string LETempFB2Name => _LEHeater2.Name;
  256. public float LECoolantInletTempFB2 => _LEHeater2.CoolantInletTcFeedback;
  257. public float LECoolantOutletTempFB2 => _LEHeater2.CoolantOutletTcFeedback;
  258. public bool LETemp1ON => _LEHeater1.IsPowerOnFeedback;
  259. public bool LETemp2ON => _LEHeater2.IsPowerOnFeedback;
  260. // Pump 状态
  261. public bool IsPumpRunning => _MainPump.IsRunning;
  262. public bool IsFastPumpOpened => _FastPumpValve.Status;
  263. public bool IsSoftPumpOpened => _SoftPumpValve.Status;
  264. public bool IsMfc1ValveOpened => _Mfc1Valve.Status;
  265. public bool IsMfc2ValveOpened => _Mfc2Valve.Status;
  266. public bool IsMfc3ValveOpened => _Mfc3Valve.Status;
  267. public bool IsMfc4ValveOpened => _Mfc4Valve.Status;
  268. public bool IsMfc5ValveOpened => _Mfc5Valve.Status;
  269. public bool IsMfc6ValveOpened => _Mfc6Valve.Status;
  270. public bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
  271. //public bool IsCDA_OK => _CDAPressure.Value;
  272. public bool IsCoolantInletTC_OK1 => _CoolantInletTC1.Value;
  273. public bool IsCoolantInletTC_OK2 => _CoolantInletTC2.Value;
  274. public bool IsCoolantOutletTC_OK1 => _CoolantOutletTC1.Value;
  275. public bool IsCoolantOutletTC_OK2 => _CoolantOutletTC2.Value;
  276. // interlock
  277. public bool NotHasInterlock => AlarmPro ? _GBInterlock.Value : _GBInterlock.Value && _GeneratorInterlock.Value;
  278. public bool NotHasInterlockWithOutGeneratorInterlock => _GBInterlock.Value;
  279. // 蝶阀位置
  280. public float TVPosition => _pressureController.ThrottleValve.PositionFeedback;
  281. // 腔体压力.end
  282. // 射频1
  283. public float Generator1ForwardPower => _Generator1.ForwardPower;
  284. public bool IsGenerator1ON => _Generator1.IsPowerOn;
  285. public float Generator1Setpoint => _Generator1.PowerSetPoint;
  286. // 射频 2
  287. public float Generator2ForwardPower => _Generator2.ForwardPower;
  288. public bool IsGenerator2ON => _Generator2.IsPowerOn;
  289. public float Generator2Setpoint => _Generator2.PowerSetPoint;
  290. // Bias射频1
  291. public float ForwardPowerBias1 => _GeneratorBias1.ForwardPower;
  292. public bool IsGeneratorONBias1 => _GeneratorBias1.IsPowerOn;
  293. public float GeneratorSetpointBias1 => _GeneratorBias1.PowerSetPoint;
  294. public float CTune1 => _GeneratorBias1.CTune;
  295. public float CLoad1 => _GeneratorBias1.CLoad;
  296. public int VPP1 => _GeneratorBias1.VPP;
  297. // Bias射频2
  298. public float ForwardPowerBias2 => _GeneratorBias2.ForwardPower;
  299. public bool IsGeneratorONBias2 => _GeneratorBias2.IsPowerOn;
  300. public float GeneratorSetpointBias2 => _GeneratorBias2.PowerSetPoint;
  301. public float CTune2 => _GeneratorBias2.CTune;
  302. public float CLoad2 => _GeneratorBias2.CLoad;
  303. public int VPP2 => _GeneratorBias2.VPP;
  304. // 流气
  305. public double TotalGasSetpoint
  306. {
  307. get
  308. {
  309. double sum = 0;
  310. foreach (var gas in _gasLines)
  311. {
  312. sum += gas.FlowSP;
  313. }
  314. return sum;
  315. }
  316. }
  317. public bool HasGasOutOfRange
  318. {
  319. get
  320. {
  321. foreach (var gas in _gasLines)
  322. {
  323. if (!gas.IsOutOfRange)
  324. return false;
  325. }
  326. return true;
  327. }
  328. }
  329. // --------------------------Constructor-----------------------
  330. //
  331. public JetDualPM(ModuleName mod) : base(mod.ToString())
  332. {
  333. Module = mod;
  334. AlarmPro = SC.GetValue<bool>($"System.SetUp.AlarmPro.IsInstalled");
  335. _Chamber1Disabled = SC.GetValue<bool>($"System.SetUp.{Module}Chamber1Disabled.IsInstalled");
  336. _Chamber2Disabled = SC.GetValue<bool>($"System.SetUp.{Module}Chamber2Disabled.IsInstalled");
  337. _guidePinInstalled = SC.GetValueOrDefault<bool>($"{Module}.GuidePin.IsInstalled");
  338. BasePressure = SC.GetValue<double>($"{mod}.ChamberBasePressureThreshold");
  339. BaseTemperature = SC.GetValue<double>($"{mod}.ChamberBaseTemperatureThreshold");
  340. _smallWafer = SC.GetValue<int>($"System.SmallWafer");
  341. _midWafer = SC.GetValue<int>($"System.MidWafer");
  342. _bigWafer = SC.GetValue<int>($"System.BigWafer");
  343. EnableBiasRF1 = SC.GetValue<bool>($"{Module}.BiasRf1.EnableBiasRF");
  344. EnableBiasRF2 = SC.GetValue<bool>($"{Module}.BiasRf2.EnableBiasRF");
  345. for (int i = 1; i <= 6; i++)
  346. {
  347. if (SC.GetValue<bool>($"{Module}.MfcGas{i}.Enable")) gasCount++;
  348. }
  349. //_gasLines = new IoGasStick[gasCount];
  350. _gasLines = new IoGasStick[6];
  351. //for (int index = 0; index < gasCount; index++)
  352. //{
  353. // _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
  354. //}
  355. for (int index = 0; index < 6; index++)
  356. {
  357. _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
  358. }
  359. //_LidLocker = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.LidLocker}");
  360. //_CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  361. //_ArmNotExtend = DEVICE.GetDevice<IoSensor>($"{Module}.SensorArmNotExtend");
  362. //_RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
  363. #region CHECKDED
  364. _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VirgoDevice.Lid}");
  365. _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
  366. _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
  367. _CoolantInletTC1 = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCoolantInletTCOK1");
  368. _CoolantInletTC2 = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCoolantInletTCOK2");
  369. _CoolantOutletTC1 = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCoolantOutletTCOK1");
  370. _CoolantOutletTC2 = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCoolantOutletTCOK2");
  371. //_WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
  372. _N2Pressure_sw = DEVICE.GetDevice<IoSensor>($"{Module}.N2PressureOk");
  373. _LEOT1 = DEVICE.GetDevice<IoSensor>($"{Module}.LE_OT1");
  374. _LEOT2 = DEVICE.GetDevice<IoSensor>($"{Module}.LE_OT2");
  375. _GBInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.GB_Interlock");
  376. _TMRobotNotExtendToPM1 = DEVICE.GetDevice<IoSensor>($"{Module}.SensorTMRobotNotExtendToPM1");
  377. _TMRobotNotExtendToPM2 = DEVICE.GetDevice<IoSensor>($"{Module}.SensorTMRobotNotExtendToPM2");
  378. //_TMInSafety = DEVICE.GetDevice<IoSensor>($"{Module}.SensorTMInSafety");
  379. _CHBOTSW = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCHBOTSW");
  380. _SourceFan = DEVICE.GetDevice<IoSensor>($"{Module}.SourceFan");
  381. _GeneratorInterlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
  382. _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{VirgoDevice.PressureControl}");
  383. _ChamberHeater1 = DEVICE.GetDevice<IoHeater>($"{Module}.HeaterChamber1");
  384. _HeaterChamber = DEVICE.GetDevice<IoHeater>($"{Module}.HeaterChamber");
  385. _ForelineHeater = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
  386. _LEHeater1 = DEVICE.GetDevice<IoHeater>($"{Module}.LEHeater1");
  387. _LEHeater2 = DEVICE.GetDevice<IoHeater>($"{Module}.LEHeater2");
  388. _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveSoftPumping}");
  389. _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveFastPumping}");
  390. _ProcessValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveProcess}");
  391. _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveN2}");
  392. _FastVentValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveFastVent}");
  393. _PurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveChamberPurge}");
  394. _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc1}");
  395. _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc2}");
  396. _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc3}");
  397. _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc4}");
  398. _Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc5}");
  399. _Mfc6Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VirgoDevice.ValveMfc6}");
  400. //_slitDoor1 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.SlitDoor1}");
  401. //_slitDoor2 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.SlitDoor2}");
  402. _GuidePin1 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.GuidePin1}");
  403. _GuidePin2 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.GuidePin2}");
  404. _IsPlus = SC.GetValue<bool>($"{Module}.IsPlus");
  405. if (_IsPlus)
  406. {
  407. _ioLiftPin1 = DEVICE.GetDevice<IoLiftPin>($"{Module}.{VirgoDevice.LiftPin1}");
  408. _ioLiftPin2 = DEVICE.GetDevice<IoLiftPin>($"{Module}.{VirgoDevice.LiftPin2}");
  409. }
  410. else
  411. {
  412. _LiftPin1 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.LiftPin1}");
  413. _LiftPin2 = DEVICE.GetDevice<IoCylinder>($"{Module}.{VirgoDevice.LiftPin2}");
  414. }
  415. _Messager = DEVICE.GetDevice<IoMessage>($"{Module}.Messager");
  416. _Generator1 = DEVICE.GetDevice<IoRf>($"{Module}.{VirgoDevice.Rf1}");
  417. _Generator2 = DEVICE.GetDevice<IoRf>($"{Module}.{VirgoDevice.Rf2}");
  418. _GeneratorBias1 = DEVICE.GetDevice<IoRf>($"{Module}.{VirgoDevice.BiasRf1}");
  419. _GeneratorBias2 = DEVICE.GetDevice<IoRf>($"{Module}.{VirgoDevice.BiasRf2}");
  420. _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{VirgoDevice.MainPump}");
  421. _Chiller1 = DEVICE.GetDevice<ChillerBase>($"{Module}.{VirgoDevice.Chiller1}");
  422. _Chiller2 = DEVICE.GetDevice<ChillerBase>($"{Module}.{VirgoDevice.Chiller2}");
  423. #endregion
  424. // RS223 AdTec Generator
  425. if (SC.GetValue<int>($"{mod}.Rf1.CommunicationType") == (int)CommunicationType.RS232 &&
  426. SC.GetValue<int>($"{mod}.Rf1.MFG") == (int)GeneratorMFG.AdTec)
  427. {
  428. _Generator1 = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VirgoDevice.Rf1}");
  429. }
  430. // RS223 AdTec Generator
  431. if (SC.GetValue<int>($"{mod}.Rf2.CommunicationType") == (int)CommunicationType.RS232 &&
  432. SC.GetValue<int>($"{mod}.Rf2.MFG") == (int)GeneratorMFG.AdTec)
  433. {
  434. _Generator2 = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VirgoDevice.Rf2}");
  435. }
  436. // RS223 AdTec Generator Bias 1
  437. if (SC.GetValue<bool>($"{mod}.BiasRf1.EnableBiasRF") &&
  438. SC.GetValue<int>($"{mod}.BiasRf1.CommunicationType") == (int)CommunicationType.RS232 &&
  439. SC.GetValue<int>($"{mod}.BiasRf1.MFG") == (int)GeneratorMFG.AdTec)
  440. {
  441. _GeneratorBias1 = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VirgoDevice.BiasRf1}");
  442. }
  443. // RS223 AdTec Generator Bias 2
  444. if (SC.GetValue<bool>($"{mod}.BiasRf2.EnableBiasRF") &&
  445. SC.GetValue<int>($"{mod}.BiasRf2.CommunicationType") == (int)CommunicationType.RS232 &&
  446. SC.GetValue<int>($"{mod}.BiasRf2.MFG") == (int)GeneratorMFG.AdTec)
  447. {
  448. _GeneratorBias2 = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{VirgoDevice.BiasRf2}");
  449. }
  450. // Ethernet Comet Generator Bias 1
  451. if (SC.GetValue<bool>($"{mod}.BiasRf1.EnableBiasRF") &&
  452. SC.GetValue<int>($"{mod}.BiasRf1.CommunicationType") == (int)CommunicationType.Ethernet &&
  453. SC.GetValue<int>($"{mod}.BiasRf1.MFG") == (int)GeneratorMFG.Comet)
  454. {
  455. _GeneratorBias1 = DEVICE.GetDevice<CometRF>($"{Module}.{VirgoDevice.BiasRf1}");
  456. }
  457. // Ethernet Comet Generator Bias 2
  458. if (SC.GetValue<bool>($"{mod}.BiasRf2.EnableBiasRF") &&
  459. SC.GetValue<int>($"{mod}.BiasRf2.CommunicationType") == (int)CommunicationType.Ethernet &&
  460. SC.GetValue<int>($"{mod}.BiasRf2.MFG") == (int)GeneratorMFG.Comet)
  461. {
  462. _GeneratorBias2 = DEVICE.GetDevice<CometRF>($"{Module}.{VirgoDevice.BiasRf2}");
  463. }
  464. //=========================================================================================
  465. //srf1 match revtec
  466. if (SC.GetValue<bool>($"{mod}.match1.EnableMatch") &&
  467. SC.GetValue<int>($"{mod}.match1.CommunicationType") == (int)CommunicationType.Ethernet &&
  468. SC.GetValue<int>($"{mod}.match1.MFG") == (int)MatchMFG.RevTec)
  469. {
  470. _Match1 = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VirgoDevice.Match1}");
  471. }
  472. //srf2 match revtec
  473. if (SC.GetValue<bool>($"{mod}.match2.EnableMatch") &&
  474. SC.GetValue<int>($"{mod}.match2.CommunicationType") == (int)CommunicationType.Ethernet &&
  475. SC.GetValue<int>($"{mod}.match2.MFG") == (int)MatchMFG.RevTec)
  476. {
  477. _Match2 = DEVICE.GetDevice<RevtechMatch>($"{Module}.{VirgoDevice.Match2}");
  478. }
  479. //brf1 match revtec
  480. if (SC.GetValue<bool>($"{mod}.BiasRf1Match.EnableMatch") &&
  481. SC.GetValue<int>($"{mod}.BiasRf1Match.CommunicationType") == (int)CommunicationType.Ethernet &&
  482. SC.GetValue<int>($"{mod}.BiasRf1Match.MFG") == (int)MatchMFG.RevTec)
  483. {
  484. _BiasMatch1 = DEVICE.GetDevice<RevtechMatch>($"{Module}.BiasRf1Match");
  485. }
  486. //brf2 match revtec
  487. if (SC.GetValue<bool>($"{mod}.BiasRf2Match.EnableMatch") &&
  488. SC.GetValue<int>($"{mod}.BiasRf2Match.CommunicationType") == (int)CommunicationType.Ethernet &&
  489. SC.GetValue<int>($"{mod}.BiasRf2Match.MFG") == (int)MatchMFG.RevTec)
  490. {
  491. _BiasMatch2 = DEVICE.GetDevice<RevtechMatch>($"{Module}.BiasRf2Match");
  492. }
  493. //=========================================================================================
  494. // RS232 AdTec match
  495. if (SC.GetValue<int>($"{mod}.match1.CommunicationType") == (int)CommunicationType.RS232 &&
  496. SC.GetValue<int>($"{mod}.match1.MFG") == (int)MatchMFG.AdTec)
  497. {
  498. _Match1 = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VirgoDevice.Match1}");
  499. }
  500. // RS232 AdTec match
  501. if (SC.GetValue<int>($"{mod}.match1.CommunicationType") == (int)CommunicationType.RS232 &&
  502. SC.GetValue<int>($"{mod}.match1.MFG") == (int)MatchMFG.AdTec)
  503. {
  504. _Match2 = DEVICE.GetDevice<AdTecMatch>($"{Module}.{VirgoDevice.Match2}");
  505. }
  506. // RS232 Dry pump, SKY
  507. if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  508. {
  509. if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  510. {
  511. _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{VirgoDevice.MainPump}");
  512. }
  513. else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  514. {
  515. _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{VirgoDevice.MainPump}");
  516. }
  517. }
  518. if (SC.GetValue<bool>($"{mod}.Chiller1.EnableChiller") &&
  519. SC.GetValue<int>($"{mod}.Chiller1.CommunicationType") == (int)CommunicationType.RS232)
  520. {
  521. if (SC.GetValue<int>($"{mod}.Chiller1.MFG") == (int)ChillerMFG.SMC)
  522. {
  523. _Chiller1 = DEVICE.GetDevice<SMCChiller>($"{Module}.{VirgoDevice.Chiller1}");
  524. }
  525. else if (SC.GetValue<int>($"{mod}.Chiller1.MFG") == (int)ChillerMFG.AIRSYS)
  526. {
  527. _Chiller1 = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VirgoDevice.Chiller1}");
  528. }
  529. }
  530. if (SC.GetValue<bool>($"{mod}.Chiller2.EnableChiller") &&
  531. SC.GetValue<int>($"{mod}.Chiller2.CommunicationType") == (int)CommunicationType.RS232)
  532. {
  533. if (SC.GetValue<int>($"System.SetUp.ChillerSetupOp.IsInstalled") == (int)ChillerSetupOp.ShareSingleChiller)
  534. {
  535. _Chiller2 = _Chiller1;
  536. }
  537. else
  538. {
  539. if (SC.GetValue<int>($"{mod}.Chiller2.MFG") == (int)ChillerMFG.SMC)
  540. {
  541. _Chiller2 = DEVICE.GetDevice<SMCChiller>($"{Module}.{VirgoDevice.Chiller2}");
  542. }
  543. else if (SC.GetValue<int>($"{mod}.Chiller1.MFG") == (int)ChillerMFG.AIRSYS)
  544. {
  545. _Chiller2 = DEVICE.GetDevice<AIRSYSChiller>($"{Module}.{VirgoDevice.Chiller2}");
  546. }
  547. }
  548. }
  549. System.Diagnostics.Debug.Assert(null != _Generator1);
  550. System.Diagnostics.Debug.Assert(null != _Generator2);
  551. System.Diagnostics.Debug.Assert(null != _MainPump);
  552. if (SC.GetValue<bool>($"{Module}.BiasRf1.EnableBiasRF"))
  553. {
  554. System.Diagnostics.Debug.Assert(null != _GeneratorBias1);
  555. }
  556. if (SC.GetValue<bool>($"{Module}.BiasRf2.EnableBiasRF"))
  557. {
  558. System.Diagnostics.Debug.Assert(null != _GeneratorBias2);
  559. }
  560. //WaferManager.Instance.SubscribeLocation(Module, 2);
  561. }
  562. public override bool Initialize()
  563. {
  564. DATA.Subscribe($"{Name}.IsAtm", () => { return CheckAtm(); });
  565. DATA.Subscribe($"{Name}.IsVacuum", () => { return CheckVacuum(); });
  566. DATA.Subscribe($"{Name}.IsCDAOK", () => { return CheckCDAOK(); });
  567. DATA.Subscribe($"{Name}.IsCoolantInletTCOK1", () => { return CheckCoolantInletTCOK1(); });
  568. DATA.Subscribe($"{Name}.IsCoolantOutletTCOK1", () => { return CheckCoolantOutletTCOK1(); });
  569. DATA.Subscribe($"{Name}.IsCoolantInletTCOK2", () => { return CheckCoolantInletTCOK2(); });
  570. DATA.Subscribe($"{Name}.IsCoolantOutletTCOK2", () => { return CheckCoolantOutletTCOK2(); });
  571. DATA.Subscribe($"{Name}.IsTMRbotNotExtendToPM1", () => { return CheckTMRobotCanExtendToPM1(); });
  572. DATA.Subscribe($"{Name}.IsTMRbotNotExtendToPM2", () => { return CheckTMRobotCanExtendToPM2(); });
  573. //DATA.Subscribe($"{Name}.IsWaterLeak", () => { return CheckWaterLeak(); });
  574. DATA.Subscribe($"{Name}.ChamberPressure", () => ChamberPressure);
  575. DATA.Subscribe($"{Name}.IoTemperatureCtrl.TemperatureControl.Chamber1Temperature", () => ChamberTempFB1);
  576. DATA.Subscribe($"{Name}.IoTemperatureCtrl.TemperatureControl.Chamber2Temperature", () => ChamberTempFB2);
  577. IsInstalled = SC.GetValue<bool>($"System.SetUp.{Name}.IsInstalled");
  578. return true;
  579. }
  580. // -----------------------------Method-------------------------
  581. //
  582. public override void Home()
  583. {
  584. // 与yp讨论过,PM 初始化不需要
  585. if (!_Chamber1Disabled)
  586. {
  587. SetLiftPin1(MovementPosition.Down, out _);
  588. //if (IsSlitDoor1Closed)
  589. //{
  590. // SetSlitDoor1(false, out _);
  591. //}
  592. //else if (!IsSlitDoor1Closed)
  593. //{
  594. // SetSlitDoor1(false, out _);
  595. //}
  596. //else if (_slitDoor1.State == CylinderState.Error)
  597. //{
  598. // SetSlitDoor1(true, out _);
  599. //}
  600. if (SC.GetValue<bool>($"{Module}.BiasRf1.EnableBiasRF"))
  601. {
  602. _Messager.SetMessager(1); //Virgo B
  603. }
  604. else
  605. {
  606. _Messager.SetMessager(0); //Virgo A
  607. }
  608. }
  609. if (!_Chamber2Disabled)
  610. {
  611. SetLiftPin2(MovementPosition.Down, out _);
  612. //SetSlitDoor(false, out _);
  613. //SetGuidePin1(MovementPosition.Down);
  614. //SetGuidePin2(MovementPosition.Down);
  615. //if (IsSlitDoor2Closed)
  616. //{
  617. // SetSlitDoor2(false, out _);
  618. //}
  619. //else if (!IsSlitDoor2Closed)
  620. //{
  621. // SetSlitDoor2(false, out _);
  622. //}
  623. //else if (_slitDoor2.State == CylinderState.Error)
  624. //{
  625. // SetSlitDoor2(true, out _);
  626. //}
  627. if (SC.GetValue<bool>($"{Module}.BiasRf2.EnableBiasRF"))
  628. {
  629. _Messager.SetMessager(1); //Virgo B
  630. }
  631. else
  632. {
  633. _Messager.SetMessager(0); //Virgo A
  634. }
  635. }
  636. }
  637. public bool SetSlitDoor1(bool open, out string reason)
  638. {
  639. reason = string.Empty;
  640. // [XIAHUAN]: 只在关门的时候检查arm not extend
  641. if (!open && !(IsTMRobotNotExtendToPM1/* || DEVICE.GetDevice<RorzeRobot751>($"TMRobot").LastRecordStation != $"{Module}1"*/))
  642. {
  643. reason = "TMRobot Not Extend To PM1 信号不满足";
  644. EV.PostAlarmLog(Module.ToString(), reason);
  645. return false;
  646. }
  647. OP.DoOperation($"TM.SetSlitDoor", Module, open);
  648. return true;
  649. }
  650. public bool SetSlitDoor2(bool open, out string reason)
  651. {
  652. reason = string.Empty;
  653. // [XIAHUAN]: 只在关门的时候检查arm not extend
  654. if (!open && !(IsTMRobotNotExtendToPM2 /*|| DEVICE.GetDevice<RorzeRobot751>($"TMRobot").LastRecordStation != $"{Module}2"*/))
  655. {
  656. reason = "TMRobot Not Extend To PM2 信号不满足";
  657. EV.PostAlarmLog(Module.ToString(), reason);
  658. return false;
  659. }
  660. OP.DoOperation($"TM.SetSlitDoor", Module, open);
  661. return true;
  662. }
  663. //public override bool CheckWaterLeak()
  664. //{
  665. // return _WLK_sw.Value;
  666. //}
  667. //public override bool CheckCDAOK()
  668. //{
  669. // return _CDAPressure.Value;
  670. //}
  671. public override bool CheckCoolantInletTCOK1()
  672. {
  673. return _CoolantInletTC1.Value;
  674. }
  675. public override bool CheckCoolantInletTCOK2()
  676. {
  677. return _CoolantInletTC2.Value;
  678. }
  679. public override bool CheckCoolantOutletTCOK1()
  680. {
  681. return _CoolantOutletTC1.Value;
  682. }
  683. public override bool CheckCoolantOutletTCOK2()
  684. {
  685. return _CoolantOutletTC2.Value;
  686. }
  687. public override bool CheckTMRobotCanExtendToPM1()
  688. {
  689. return _TMRobotNotExtendToPM1.Value;
  690. }
  691. public override bool CheckTMRobotCanExtendToPM2()
  692. {
  693. return _TMRobotNotExtendToPM2.Value;
  694. }
  695. public override bool CheckAtm()
  696. {
  697. //2024-03-14 15:26:34 TPS dkj lx 删除
  698. //return _ATM_sw.Value && ChamberPressurePressure > 700000;
  699. return _ATM_sw.Value;
  700. }
  701. public override bool CheckVacuum()
  702. {
  703. //2024-03-14 15:26:34 TPS dkj lx修改小于5000
  704. //return _VAC_sw.Value && ChamberPressure < 100;
  705. return _VAC_sw.Value && ChamberPressure < 5000;
  706. }
  707. public bool CheckSlitDoor1Open()
  708. {
  709. return !IsSlitDoor1Closed;
  710. }
  711. public bool CheckSlitDoor1Close()
  712. {
  713. return IsSlitDoor1Closed;
  714. }
  715. public bool CheckSlitDoor2Open()
  716. {
  717. return !IsSlitDoor2Closed;
  718. }
  719. public bool CheckSlitDoor2Close()
  720. {
  721. return IsSlitDoor2Closed;
  722. }
  723. public bool CheckLift1Up()
  724. {
  725. if (_IsPlus)
  726. return _ioLiftPin1.PinPosition == PositionType.Position4;
  727. else
  728. return _LiftPin1.State == CylinderState.Open;
  729. }
  730. public bool CheckLift1Down()
  731. {
  732. if (_IsPlus)
  733. return _ioLiftPin1.PinPosition == PositionType.Position1;
  734. else
  735. return _LiftPin1.State == CylinderState.Close;
  736. }
  737. public bool CheckLift2Up()
  738. {
  739. if (_IsPlus)
  740. return _ioLiftPin2.PinPosition == PositionType.Position4;
  741. else
  742. return _LiftPin2.State == CylinderState.Open;
  743. }
  744. public bool CheckLift2Down()
  745. {
  746. if (_IsPlus)
  747. return _ioLiftPin2.PinPosition == PositionType.Position1;
  748. else
  749. return _LiftPin2.State == CylinderState.Close;
  750. }
  751. public void SetGas2(double sp)
  752. {
  753. OP.DoOperation($"{Module}.MfcGas2",out string reason,0,sp);
  754. }
  755. public void StartPump(bool on)
  756. {
  757. //_pressureController.StartPump(on);
  758. _MainPump?.SetPumpOnOff(on);
  759. }
  760. public void OpenValve(ValveType vlvType, bool on)
  761. {
  762. switch (vlvType)
  763. {
  764. case ValveType.PROCESS:
  765. _ProcessValve.TurnValve(on, out _);
  766. break;
  767. case ValveType.N2:
  768. _N2Valve.TurnValve(on, out _);
  769. break;
  770. case ValveType.FAST_PUMP:
  771. _FastPumpValve.TurnValve(on, out _);
  772. if (on)
  773. _SoftPumpValve.TurnValve(false, out _);
  774. break;
  775. case ValveType.SOFT_PUMP:
  776. _SoftPumpValve.TurnValve(on, out _);
  777. if(on)
  778. _FastPumpValve.TurnValve(false, out _);
  779. break;
  780. case ValveType.FAST_VENT:
  781. _FastVentValve.TurnValve(on, out _);
  782. break;
  783. case ValveType.PURGE:
  784. _PurgeValve.TurnValve(on, out _);
  785. break;
  786. case ValveType.Mfc1:
  787. _Mfc1Valve.TurnValve(on, out _);
  788. break;
  789. case ValveType.Mfc2:
  790. _Mfc2Valve.TurnValve(on, out _);
  791. break;
  792. case ValveType.Mfc3:
  793. _Mfc3Valve.TurnValve(on, out _);
  794. break;
  795. case ValveType.Mfc4:
  796. _Mfc4Valve.TurnValve(on, out _);
  797. break;
  798. case ValveType.Mfc5:
  799. _Mfc5Valve.TurnValve(on, out _);
  800. break;
  801. case ValveType.Mfc6:
  802. _Mfc6Valve.TurnValve(on, out _);
  803. break;
  804. default:
  805. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  806. }
  807. }
  808. public bool CheckValveSwitchStatus(ValveType vlvType, bool on)
  809. {
  810. switch (vlvType)
  811. {
  812. case ValveType.PROCESS:
  813. return _ProcessValve.Status == on;
  814. case ValveType.N2:
  815. return _N2Valve.Status == on;
  816. case ValveType.FAST_PUMP:
  817. return _FastPumpValve.Status == on;
  818. case ValveType.SOFT_PUMP:
  819. return _SoftPumpValve.Status == on;
  820. case ValveType.FAST_VENT:
  821. return _FastVentValve.Status == on;
  822. case ValveType.PURGE:
  823. return _PurgeValve.Status == on;
  824. case ValveType.Mfc1:
  825. return _Mfc1Valve.Status == on;
  826. case ValveType.Mfc2:
  827. return _Mfc2Valve.Status == on;
  828. case ValveType.Mfc3:
  829. return _Mfc3Valve.Status == on;
  830. case ValveType.Mfc4:
  831. return _Mfc4Valve.Status == on;
  832. case ValveType.Mfc5:
  833. return _Mfc5Valve.Status == on;
  834. case ValveType.Mfc6:
  835. return _Mfc6Valve.Status == on;
  836. default:
  837. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  838. }
  839. }
  840. public void CheckPressureStability()
  841. {
  842. IsPressureToleranceEnabled = true;
  843. }
  844. public void CheckPressureDisable()
  845. {
  846. IsPressureToleranceEnabled = false;
  847. }
  848. public override void Monitor()
  849. {
  850. foreach (var gas in _gasLines)
  851. {
  852. gas.Monitor();
  853. }
  854. _trigBasePressure.CLK = ChamberPressurePressure >= BasePressure;
  855. if (SC.GetValue<bool>($"{Module}.Chiller1.EnableChiller"))
  856. {
  857. _trigBaseTemperature1.CLK = CoolantOutletTempFB1 >= BaseTemperature;
  858. }
  859. else
  860. {
  861. _trigBaseTemperature1.CLK = LETempFB1 >= BaseTemperature;
  862. }
  863. if (SC.GetValue<bool>($"{Module}.Chiller2.EnableChiller"))
  864. {
  865. _trigBaseTemperature2.CLK = CoolantOutletTempFB2 >= BaseTemperature;
  866. }
  867. else
  868. {
  869. _trigBaseTemperature2.CLK = LETempFB2 >= BaseTemperature;
  870. }
  871. if (_trigBasePressure.Q) EV.PostMessage(Module.ToString(), EventEnum.DefaultAlarm, $"{Module} pressure out of tolerance");
  872. if (_trigBaseTemperature1.Q) EV.PostMessage(Module.ToString(), EventEnum.DefaultAlarm, $"{Module} 1 temperature out of tolerance");
  873. if (_trigBaseTemperature2.Q) EV.PostMessage(Module.ToString(), EventEnum.DefaultAlarm, $"{Module} 2 temperature out of tolerance");
  874. }
  875. public void CloseValves()
  876. {
  877. _N2Valve.TurnValve(false, out _);
  878. _SoftPumpValve.TurnValve(false, out _);
  879. _FastPumpValve.TurnValve(false, out _);
  880. _ProcessValve.TurnValve(false, out _);
  881. _PurgeValve.TurnValve(false, out _);
  882. _FastVentValve.TurnValve(false, out _);
  883. _PurgeValve.TurnValve(false, out _);
  884. _Mfc1Valve.TurnValve(false, out _);
  885. _Mfc2Valve.TurnValve(false, out _);
  886. _Mfc3Valve.TurnValve(false, out _);
  887. _Mfc4Valve.TurnValve(false, out _);
  888. _Mfc5Valve.TurnValve(false, out _);
  889. _Mfc6Valve.TurnValve(false, out _);
  890. foreach (var stick in _gasLines)
  891. {
  892. stick.Stop();
  893. }
  894. }
  895. public bool FlowGas(int gasNum, double val)
  896. {
  897. if (_gasLines.Length <= gasNum)
  898. return false;
  899. _gasLines[gasNum].Flow(val);
  900. return true;
  901. }
  902. public void StopAllGases()
  903. {
  904. foreach (var line in _gasLines)
  905. {
  906. line.Stop();
  907. }
  908. }
  909. public bool ResetPin()
  910. {
  911. if (_IsPlus)
  912. {
  913. _ioLiftPin1.Reset();
  914. _ioLiftPin2.Reset();
  915. }
  916. return true;
  917. }
  918. public bool CancelPin()
  919. {
  920. if (_IsPlus)
  921. {
  922. _ioLiftPin1.Cancelset();
  923. _ioLiftPin2.Cancelset();
  924. }
  925. return true;
  926. }
  927. public bool SearchPinOrigin()
  928. {
  929. if(_IsPlus)
  930. return _ioLiftPin1.GoPosition(PositionType.Origin) && _ioLiftPin2.GoPosition(PositionType.Origin);
  931. return true;
  932. }
  933. public bool HasPinOrigin()
  934. {
  935. if (_IsPlus)
  936. return _ioLiftPin1.HasOrigin && _ioLiftPin2.HasOrigin;
  937. return true;
  938. }
  939. public bool SetLiftPin1(MovementPosition dirt, out string reason)
  940. {
  941. reason = string.Empty;
  942. switch (dirt)
  943. {
  944. case MovementPosition.Down:
  945. if (_IsPlus)
  946. return _ioLiftPin1.GoPosition(PositionType.Position1);
  947. else
  948. return _LiftPin1.SetCylinder(false, out reason);
  949. case MovementPosition.Up:
  950. if (_IsPlus)
  951. return _ioLiftPin1.GoPosition(PositionType.Position4);
  952. else
  953. return _LiftPin1.SetCylinder(true, out reason);
  954. case MovementPosition.Left:
  955. case MovementPosition.Right:
  956. case MovementPosition.Middle:
  957. throw new ArgumentException("Movement argument error");
  958. }
  959. return true;
  960. }
  961. public bool SetLiftPin2(MovementPosition dirt, out string reason)
  962. {
  963. reason = string.Empty;
  964. switch (dirt)
  965. {
  966. case MovementPosition.Down:
  967. if (_IsPlus)
  968. return _ioLiftPin2.GoPosition(PositionType.Position1);
  969. else
  970. return _LiftPin2.SetCylinder(false, out reason);
  971. case MovementPosition.Up:
  972. if (_IsPlus)
  973. return _ioLiftPin2.GoPosition(PositionType.Position4);
  974. else
  975. return _LiftPin2.SetCylinder(true, out reason);
  976. case MovementPosition.Left:
  977. case MovementPosition.Right:
  978. case MovementPosition.Middle:
  979. throw new ArgumentException("Movement argument error");
  980. }
  981. return true;
  982. }
  983. public void SetGuidePin(WaferSize ws, MovementPosition dirt)
  984. {
  985. //if (ws == WaferSize.WS3)
  986. // SetGuidePinSmall(dirt);
  987. //else if (ws == WaferSize.WS4)
  988. // SetGuidePinMedium(dirt);
  989. }
  990. public void PrepareGuidePinForPlace(WaferSize ws)
  991. {
  992. //if (ws == WaferSize.WS3)
  993. //{
  994. // SetGuidePinSmall(MovementPosition.Up);
  995. // SetGuidePinMedium(MovementPosition.Down);
  996. //}
  997. //else if (ws == WaferSize.WS4)
  998. //{
  999. // SetGuidePinSmall(MovementPosition.Down);
  1000. // SetGuidePinMedium(MovementPosition.Up);
  1001. //}
  1002. //else if (ws == WaferSize.WS6)
  1003. //{
  1004. // SetGuidePinSmall(MovementPosition.Down);
  1005. // SetGuidePinMedium(MovementPosition.Down);
  1006. //}
  1007. }
  1008. public void PrepareGuidePinForPlaceLeft(WaferSize ws)
  1009. {
  1010. //if (ws == WaferSize.WS3)
  1011. //{
  1012. // SetGuidePinSmall(MovementPosition.Up);
  1013. // SetGuidePinMedium(MovementPosition.Down);
  1014. //}
  1015. //else if (ws == WaferSize.WS4)
  1016. //{
  1017. // SetGuidePinSmall(MovementPosition.Down);
  1018. // SetGuidePinMedium(MovementPosition.Up);
  1019. //}
  1020. //else if (ws == WaferSize.WS6)
  1021. //{
  1022. // SetGuidePinSmall(MovementPosition.Down);
  1023. // SetGuidePinMedium(MovementPosition.Down);
  1024. //}
  1025. string reason = string.Empty;
  1026. if (ws == WaferSize.WS4)
  1027. {
  1028. _GuidePin1.SetCylinder(true, out reason);
  1029. }
  1030. else
  1031. {
  1032. _GuidePin1.SetCylinder(false, out reason);
  1033. }
  1034. }
  1035. public void PrepareGuidePinForPlaceRight(WaferSize ws)
  1036. {
  1037. //if (ws == WaferSize.WS3)
  1038. //{
  1039. // SetGuidePinSmall(MovementPosition.Up);
  1040. // SetGuidePinMedium(MovementPosition.Down);
  1041. //}
  1042. //else if (ws == WaferSize.WS4)
  1043. //{
  1044. // SetGuidePinSmall(MovementPosition.Down);
  1045. // SetGuidePinMedium(MovementPosition.Up);
  1046. //}
  1047. //else if (ws == WaferSize.WS6)
  1048. //{
  1049. // SetGuidePinSmall(MovementPosition.Down);
  1050. // SetGuidePinMedium(MovementPosition.Down);
  1051. //}
  1052. string reason = string.Empty;
  1053. if (ws == WaferSize.WS4)
  1054. {
  1055. _GuidePin2.SetCylinder(true, out reason);
  1056. }
  1057. else
  1058. {
  1059. _GuidePin2.SetCylinder(false, out reason);
  1060. }
  1061. }
  1062. public bool CheckGuidePinIsReadyForTransfer(EnumDualPM pos, WaferSize ws)
  1063. {
  1064. if (!GuidePinInstalled)
  1065. {
  1066. return true;
  1067. }
  1068. if (pos == EnumDualPM.Left)
  1069. {
  1070. return CheckGuidePinIsReadyForTransferLeft(ws);
  1071. }
  1072. else if (pos == EnumDualPM.Right)
  1073. {
  1074. return CheckGuidePinIsReadyForTransferRight(ws);
  1075. }
  1076. return false;
  1077. }
  1078. public bool CheckGuidePinIsReadyForTransferLeft(WaferSize ws)
  1079. {
  1080. if (ws == WaferSize.WS4)
  1081. {
  1082. return GuidePin1Position == MovementPosition.Up;
  1083. }
  1084. else if (ws == WaferSize.WS6 || ws == WaferSize.WS8 || ws == WaferSize.WS12)
  1085. {
  1086. return GuidePin1Position == MovementPosition.Down;
  1087. }
  1088. else
  1089. return false;
  1090. }
  1091. public bool CheckGuidePinIsReadyForTransferRight(WaferSize ws)
  1092. {
  1093. if (ws == WaferSize.WS4)
  1094. {
  1095. return GuidePin2Position == MovementPosition.Up;
  1096. }
  1097. else if (ws == WaferSize.WS6 || ws == WaferSize.WS8 || ws == WaferSize.WS12)
  1098. {
  1099. return GuidePin2Position == MovementPosition.Down;
  1100. }
  1101. else
  1102. return false;
  1103. }
  1104. private void SetGuidePin1(MovementPosition dirt)
  1105. {
  1106. EV.PostInfoLog(Module.ToString(), $"set small pin {dirt}, smallWafer={_smallWafer}");
  1107. switch (dirt)
  1108. {
  1109. case MovementPosition.Down:
  1110. if (_smallWafer != 0)
  1111. _GuidePin1?.SetCylinder(false, out _);
  1112. break;
  1113. case MovementPosition.Up:
  1114. if (_smallWafer != 0)
  1115. _GuidePin1?.SetCylinder(true, out _);
  1116. break;
  1117. default:
  1118. throw new ArgumentException("Movement argument error");
  1119. }
  1120. }
  1121. private void SetGuidePin2(MovementPosition dirt)
  1122. {
  1123. EV.PostInfoLog(Module.ToString(), $"set medium pin {dirt}, midWafer={_midWafer}");
  1124. switch (dirt)
  1125. {
  1126. case MovementPosition.Down:
  1127. if (_midWafer != 0)
  1128. _GuidePin2?.SetCylinder(false, out _);
  1129. break;
  1130. case MovementPosition.Up:
  1131. if (_midWafer != 0)
  1132. _GuidePin2?.SetCylinder(true, out _);
  1133. break;
  1134. default:
  1135. throw new ArgumentException("Movement argument error");
  1136. }
  1137. }
  1138. public void SetGenerator1CommunicationMode(int mode)
  1139. {
  1140. _Generator1?.SetCommunicationMode(mode);
  1141. }
  1142. public void SetGenerator2CommunicationMode(int mode)
  1143. {
  1144. _Generator2?.SetCommunicationMode(mode);
  1145. }
  1146. public bool Generator1PowerOn(bool on)
  1147. {
  1148. if (_Generator1 == null) return false;
  1149. if (on && !NotHasInterlock)
  1150. {
  1151. EV.PostAlarmLog(Module.ToString(), "射频电源 Interlock条件不满足");
  1152. return false;
  1153. }
  1154. return _Generator1.SetPowerOnOff(on, out _);
  1155. }
  1156. public bool Generator2PowerOn(bool on)
  1157. {
  1158. if (_Generator2 == null) return false;
  1159. if (on && !NotHasInterlock)
  1160. {
  1161. EV.PostAlarmLog(Module.ToString(), "射频电源 Interlock条件不满足");
  1162. return false;
  1163. }
  1164. return _Generator2.SetPowerOnOff(on, out _);
  1165. }
  1166. public bool Generator1Setpower(float val)
  1167. {
  1168. if (_Generator1 == null) return false;
  1169. if (Math.Abs(val) > 0.01)
  1170. _Generator1.SetPower((ushort)val);
  1171. return true;
  1172. }
  1173. public bool Generator2Setpower(float val)
  1174. {
  1175. if (_Generator2 == null) return false;
  1176. if (Math.Abs(val) > 0.01)
  1177. _Generator2.SetPower((ushort)val);
  1178. return true;
  1179. }
  1180. public bool GeneratorBias1PowerOn(bool on)
  1181. {
  1182. if (_GeneratorBias1 == null) return false;
  1183. if (on && !NotHasInterlock)
  1184. {
  1185. EV.PostAlarmLog(Module.ToString(), "Bias射频电源 Interlock条件不满足");
  1186. return false;
  1187. }
  1188. return _GeneratorBias1.SetPowerOnOff(on, out _);
  1189. }
  1190. public bool GeneratorBias2PowerOn(bool on)
  1191. {
  1192. if (_GeneratorBias2 == null) return false;
  1193. if (on && !NotHasInterlock)
  1194. {
  1195. EV.PostAlarmLog(Module.ToString(), "Bias射频电源 Interlock条件不满足");
  1196. return false;
  1197. }
  1198. return _GeneratorBias2.SetPowerOnOff(on, out _);
  1199. }
  1200. public bool GeneratorBias1Setpower(float val)
  1201. {
  1202. if (_GeneratorBias1 == null) return false;
  1203. if (Math.Abs(val) > 0.01)
  1204. _GeneratorBias1.SetPower((ushort)val);
  1205. return true;
  1206. }
  1207. public bool GeneratorBias2Setpower(float val)
  1208. {
  1209. if (_GeneratorBias2 == null) return false;
  1210. if (Math.Abs(val) > 0.01)
  1211. _GeneratorBias2.SetPower((ushort)val);
  1212. return true;
  1213. }
  1214. public bool GeneratorBias1SetMatchMode(bool val)
  1215. {
  1216. if (_BiasMatch1 != null)
  1217. {
  1218. _BiasMatch1.SetMatchMode(true ? EnumRfMatchTuneMode.Auto.ToString() : EnumRfMatchTuneMode.Manual.ToString(), out _);
  1219. return true;
  1220. }
  1221. if (_GeneratorBias1 == null) return false;
  1222. string reason = string.Empty;
  1223. _GeneratorBias1.SetMatchingAutoMode(val, out reason);
  1224. return true;
  1225. }
  1226. public bool GeneratorBias2SetMatchMode(bool val)
  1227. {
  1228. if (_BiasMatch2 != null)
  1229. {
  1230. _BiasMatch2.SetMatchMode(true ? EnumRfMatchTuneMode.Auto.ToString(): EnumRfMatchTuneMode.Manual.ToString(), out _);
  1231. return true;
  1232. }
  1233. if (_GeneratorBias2 == null) return false;
  1234. string reason = string.Empty;
  1235. _GeneratorBias2.SetMatchingAutoMode(val, out reason);
  1236. return true;
  1237. }
  1238. public bool SetMatch1Position(float c1, float c2)
  1239. {
  1240. if (_Match1 == null) return false;
  1241. string reason = string.Empty;
  1242. _Match1.SetMatchPosition(c1, c2, out reason);
  1243. return true;
  1244. }
  1245. public bool SetMatch2Position(float c1, float c2)
  1246. {
  1247. if (_Match2 == null) return false;
  1248. string reason = string.Empty;
  1249. _Match2.SetMatchPosition(c1, c2, out reason);
  1250. return true;
  1251. }
  1252. public bool SetBias1MatchPosition(float c1, float c2)
  1253. {
  1254. if (_BiasMatch1 != null)
  1255. {
  1256. _BiasMatch1.SetMatchPosition(c1,c2,out _);
  1257. return true;
  1258. }
  1259. if (_GeneratorBias1 == null) return false;
  1260. string reason = string.Empty;
  1261. _GeneratorBias1.SetMatchPosition(c1, c2, out reason);
  1262. return true;
  1263. }
  1264. public bool SetBias2MatchPosition(float c1, float c2)
  1265. {
  1266. if (_BiasMatch2 != null)
  1267. {
  1268. _BiasMatch2.SetMatchPosition(c1, c2, out _);
  1269. return true;
  1270. }
  1271. if (_GeneratorBias2 == null) return false;
  1272. string reason = string.Empty;
  1273. _GeneratorBias2.SetMatchPosition(c1, c2, out reason);
  1274. return true;
  1275. }
  1276. public void FullOpenTV()
  1277. {
  1278. _pressureController.FullOpenThrottleValve();
  1279. }
  1280. public void PressureControl(int pressure)
  1281. {
  1282. _pressureController.setTVPressure(pressure);
  1283. //_pressureController._setChamberPressure();
  1284. }
  1285. public void HeatChamber1(double val)
  1286. {
  1287. _ChamberHeater1?.RampTemp((float)val);
  1288. _ChamberHeater1?.TurnOnOff(true);
  1289. }
  1290. public void HeatChamber2(double val)
  1291. {
  1292. _HeaterChamber?.RampTemp((float)val);
  1293. _HeaterChamber?.TurnOnOff(true);
  1294. }
  1295. public void HeatChiller1(double value, double offset)
  1296. {
  1297. _Chiller1?.SetChillerTemp((float)value, (float)offset);
  1298. _Chiller1?.SetChillerOnOff(true);
  1299. }
  1300. public void HeatChiller2(double value, double offset)
  1301. {
  1302. _Chiller2?.SetChillerTemp((float)value, (float)offset);
  1303. _Chiller2?.SetChillerOnOff(true);
  1304. }
  1305. public void HeatForeline(double val)
  1306. {
  1307. _ForelineHeater?.RampTemp((float)val);
  1308. }
  1309. public void HeatLE1(double val)
  1310. {
  1311. _LEHeater1?.RampTemp((float)val);
  1312. _LEHeater1?.TurnOnOff(true);
  1313. }
  1314. public void HeatLE2(double val)
  1315. {
  1316. _LEHeater2?.RampTemp((float)val);
  1317. _LEHeater2?.TurnOnOff(true);
  1318. }
  1319. public override bool CheckEnableTransfer(EnumTransferType type, EnumDualPM pos)
  1320. {
  1321. if (type == EnumTransferType.Pick)
  1322. {
  1323. if (pos == EnumDualPM.Left)
  1324. {
  1325. if (_IsPlus)
  1326. return !IsSlitDoor1Closed && _ioLiftPin1.PinPosition == PositionType.Position4;
  1327. else
  1328. return !IsSlitDoor1Closed && _LiftPin1.State == CylinderState.Open;
  1329. }
  1330. else if (pos == EnumDualPM.Right)
  1331. {
  1332. if (_IsPlus)
  1333. return !IsSlitDoor2Closed && _ioLiftPin2.PinPosition == PositionType.Position4;
  1334. else
  1335. return !IsSlitDoor2Closed && _LiftPin2.State == CylinderState.Open;
  1336. }
  1337. }
  1338. if (type == EnumTransferType.Place)
  1339. {
  1340. if (pos == EnumDualPM.Left)
  1341. {
  1342. if (_IsPlus)
  1343. return !IsSlitDoor1Closed && _ioLiftPin1.PinPosition == PositionType.Position1;
  1344. else
  1345. return !IsSlitDoor1Closed && _LiftPin1.State == CylinderState.Close;
  1346. }
  1347. else if (pos == EnumDualPM.Right)
  1348. {
  1349. if (_IsPlus)
  1350. return !IsSlitDoor2Closed && _ioLiftPin2.PinPosition == PositionType.Position1;
  1351. else
  1352. return !IsSlitDoor2Closed && _LiftPin2.State == CylinderState.Close;
  1353. }
  1354. }
  1355. return false;
  1356. }
  1357. public bool CheckEnableTransfer(EnumTransferType type, EnumDualPM pos, WaferSize waferSize)
  1358. {
  1359. if (type == EnumTransferType.Pick)
  1360. {
  1361. if (_IsPlus)
  1362. return ((pos != EnumDualPM.Left && pos != EnumDualPM.Both) || (!IsSlitDoor1Closed && _ioLiftPin1.PinPosition == PositionType.Position4 && CheckGuidePinIsReadyForTransfer(pos, waferSize))) &&
  1363. ((pos != EnumDualPM.Right && pos != EnumDualPM.Both) || (!IsSlitDoor2Closed && _ioLiftPin2.PinPosition == PositionType.Position4 && CheckGuidePinIsReadyForTransfer(pos, waferSize)));
  1364. else
  1365. return ((pos != EnumDualPM.Left && pos != EnumDualPM.Both) || (!IsSlitDoor1Closed && _LiftPin1.State == CylinderState.Open && CheckGuidePinIsReadyForTransfer(pos, waferSize))) &&
  1366. ((pos != EnumDualPM.Right && pos != EnumDualPM.Both) || (!IsSlitDoor2Closed && _LiftPin2.State == CylinderState.Open && CheckGuidePinIsReadyForTransfer(pos, waferSize)));
  1367. }
  1368. if (type == EnumTransferType.Place)
  1369. {
  1370. if (_IsPlus)
  1371. return ((pos != EnumDualPM.Left && pos != EnumDualPM.Both) || (!IsSlitDoor1Closed && _ioLiftPin1.PinPosition == PositionType.Position1 && CheckGuidePinIsReadyForTransfer(pos, waferSize))) &&
  1372. ((pos != EnumDualPM.Right && pos != EnumDualPM.Both) || (!IsSlitDoor2Closed && _ioLiftPin2.PinPosition == PositionType.Position1 && CheckGuidePinIsReadyForTransfer(pos, waferSize)));
  1373. else
  1374. return ((pos != EnumDualPM.Left && pos != EnumDualPM.Both) || (!IsSlitDoor1Closed && _LiftPin1.State == CylinderState.Close && CheckGuidePinIsReadyForTransfer(pos, waferSize))) &&
  1375. ((pos != EnumDualPM.Right && pos != EnumDualPM.Both) || (!IsSlitDoor2Closed && _LiftPin2.State == CylinderState.Close && CheckGuidePinIsReadyForTransfer(pos, waferSize)));
  1376. }
  1377. return false;
  1378. }
  1379. public override void TransferHandoff(EnumTransferType type, EnumDualPM pos)
  1380. {
  1381. switch (type)
  1382. {
  1383. case EnumTransferType.Pick:
  1384. if (pos == EnumDualPM.Left)
  1385. {
  1386. SetLiftPin1(MovementPosition.Up, out _);
  1387. }
  1388. else if (pos == EnumDualPM.Right)
  1389. {
  1390. SetLiftPin2(MovementPosition.Up, out _);
  1391. }
  1392. break;
  1393. case EnumTransferType.Place:
  1394. SetLiftPin1(MovementPosition.Down, out _);
  1395. break;
  1396. case EnumTransferType.Extend:
  1397. break;
  1398. case EnumTransferType.Retract:
  1399. break;
  1400. default:
  1401. break;
  1402. }
  1403. }
  1404. public override void Reset()
  1405. {
  1406. _trigBasePressure.RST = true;
  1407. _trigBaseTemperature1.RST = true;
  1408. }
  1409. }
  1410. /// <summary>
  1411. /// PM Action
  1412. /// </summary>
  1413. abstract class PmActionBase : ActionBase
  1414. {
  1415. protected internal JetDualPM _chamber;
  1416. protected PmActionBase(ModuleName mod, JetDualPM dualPm) : base(mod)
  1417. {
  1418. _chamber = dualPm;
  1419. }
  1420. }
  1421. class PinAction : PmActionBase
  1422. {
  1423. public MovementPosition Pos { get; }
  1424. public bool IsWaferTransfered { get; }
  1425. public PMModule PmModule { get; set; }
  1426. private Hand _blade;
  1427. public PinAction(ModuleName mod, JetDualPM dualPm, MovementPosition pos, bool isTransferWafer, Hand blade) : base(mod, dualPm)
  1428. {
  1429. this.Pos = pos;
  1430. IsWaferTransfered = isTransferWafer;
  1431. _blade = blade;
  1432. }
  1433. public override void Execute()
  1434. {
  1435. if (Module == ModuleName.PMA)
  1436. PmModule = (PMModule)EquipmentManager.Modules[ModuleName.PMA];
  1437. else if (Module == ModuleName.PMB)
  1438. PmModule = (PMModule)EquipmentManager.Modules[ModuleName.PMB];
  1439. else if (Module == ModuleName.PMC)
  1440. PmModule = (PMModule)EquipmentManager.Modules[ModuleName.PMC];
  1441. if (PmModule != null)
  1442. {
  1443. PmModule.PostMsg(PMModule.MSG.MoveLiftPin1, Pos, ID);
  1444. }
  1445. }
  1446. public override void OnPostWork(string data = null)
  1447. {
  1448. if (IsWaferTransfered)
  1449. {
  1450. if (Pos == MovementPosition.Up)
  1451. {
  1452. WaferManager.Instance.WaferMoved(ModuleName.EfemRobot, _blade == Hand.Blade1 ? 0 : 1, Module, 0);
  1453. }
  1454. else
  1455. {
  1456. WaferManager.Instance.WaferMoved(Module, 0, ModuleName.EfemRobot, _blade == Hand.Blade1 ? 0 : 1);
  1457. }
  1458. }
  1459. }
  1460. }
  1461. abstract class ActionBase
  1462. {
  1463. private static ushort _id = 100;
  1464. //---------------------------------Properties------------------------------------
  1465. //
  1466. public ushort ID { get; }
  1467. public ModuleName Module { get; protected set; }
  1468. public virtual ActionStatus Status { get; set; }
  1469. public virtual bool IsReady { get; set; }
  1470. public bool IsBackground { get; set; }
  1471. //--------------------------------Constructor------------------------------------
  1472. //
  1473. protected ActionBase(ModuleName mod)
  1474. {
  1475. this.ID = _id++;
  1476. this.Module = mod;
  1477. this.Status = ActionStatus.Pending;
  1478. }
  1479. public virtual void Execute()
  1480. {
  1481. this.Status = ActionStatus.SendCmd;
  1482. }
  1483. protected virtual void OnPreWork() { }
  1484. public virtual void OnPostWork(string data = null) { }
  1485. }
  1486. }