JetPM.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  1. using System;
  2. using Aitex.Core.Common.DeviceData;
  3. using Aitex.Core.RT.DataCenter;
  4. using Aitex.Core.RT.Device;
  5. using Aitex.Core.RT.Device.Unit;
  6. using Aitex.Core.RT.Event;
  7. using Aitex.Core.RT.OperationCenter;
  8. using Aitex.Core.RT.SCCore;
  9. using Aitex.Core.Util;
  10. using MECF.Framework.Common.Device.Bases;
  11. using MECF.Framework.Common.Equipment;
  12. using MECF.Framework.Common.Schedulers;
  13. using MECF.Framework.Common.SubstrateTrackings;
  14. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs;
  15. using Virgo_DCommon;
  16. using Virgo_DRT.Devices.IODevices;
  17. using Virgo_DRT.Module;
  18. using Virgo_DRT.Modules;
  19. namespace Virgo_DRT.Devices
  20. {
  21. enum ValveType
  22. {
  23. PROCESS,
  24. FAST_PUMP,
  25. SOFT_PUMP,
  26. FAST_VENT,
  27. PURGE,
  28. Mfc1,
  29. Mfc2,
  30. Mfc3,
  31. Mfc4,
  32. Mfc5
  33. }
  34. class JetPM : PM
  35. {
  36. // ----------------------------Fields--------------------------
  37. //
  38. private readonly IoLid _Lid;
  39. //private readonly IoCylinder _LidLocker;
  40. private readonly IoSensor _ATM_sw;
  41. private readonly IoSensor _VAC_sw;
  42. private readonly IoSensor _WLK_sw;
  43. private readonly IoSensor _CDAPressure;
  44. //private readonly IoSensor _ArmNotExtend;
  45. private readonly IoSensor _RFG_Interlock;
  46. private readonly IoSensor _FactoryScrubberSensor;
  47. private readonly IoPressureControl _pressureController;
  48. private readonly IoHeater _SubstrateTC;
  49. private readonly IoHeater _ForelineTC;
  50. private readonly IoValve _SoftPumpValve;
  51. private readonly IoValve _FastPumpValve;
  52. private readonly IoValve _ProcessValve;
  53. private readonly IoValve _PurgeValve;
  54. private readonly IoValve _FastVentValve;
  55. private readonly IoValve _Mfc1Valve;
  56. private readonly IoValve _Mfc2Valve;
  57. private readonly IoValve _Mfc3Valve;
  58. private readonly IoValve _Mfc4Valve;
  59. private readonly IoValve _Mfc5Valve;
  60. private readonly IoValve _WaterValve;
  61. //private readonly IoValve _N2SupplyValve;
  62. //private readonly IoCylinder _slitDoor;
  63. private readonly IoCylinder _LiftPin;
  64. private readonly IoCylinder _PinInch3; // 3'
  65. private readonly IoCylinder _PinInch4; // 4'
  66. private readonly RfPowerBase _Generator;
  67. private readonly RfMatchBase _Match;
  68. private readonly PumpBase _MainPump;
  69. private readonly IoGasStick[] _gasLines;
  70. private readonly IoSignalTower _SignalTower;
  71. private readonly IoPlcDateTime _plcDateTime;
  72. private bool _isFactoryScrubberSysInstalled;
  73. private readonly R_TRIG _trigScrubberSysAlarm = new R_TRIG();
  74. // --------------------------Properties------------------------
  75. //
  76. public new ModuleName Module { get; }
  77. // 门的状态
  78. public bool IsSlitDoorClosed => true;
  79. //public bool IsSlitDoorClosed => !_slitDoor.ONFeedback && _slitDoor.OFFFeedback;
  80. //public bool IsArmNotExtend => _ArmNotExtend.Value;
  81. // 盖子的状态
  82. public bool IsLidClosed => _Lid.OFFFeedback;
  83. // 盖子的锁
  84. //public bool IsLidLocked => !_LidLocker.ONSetPoint && _LidLocker.OFFSetPoint;
  85. public MovementPosition LiftPinPosition
  86. {
  87. get
  88. {
  89. MovementPosition pos = MovementPosition.Unknown;
  90. if (_LiftPin.ONFeedback && !_LiftPin.OFFFeedback)
  91. {
  92. pos = MovementPosition.Up;
  93. }
  94. else if (!_LiftPin.ONFeedback && _LiftPin.OFFFeedback)
  95. {
  96. pos = MovementPosition.Down;
  97. }
  98. return pos;
  99. }
  100. }
  101. public MovementPosition Inch3Position
  102. {
  103. get
  104. {
  105. MovementPosition res = MovementPosition.Unknown;
  106. if (_PinInch3.ONFeedback && !_PinInch3.OFFFeedback)
  107. {
  108. res = MovementPosition.Up;
  109. }
  110. else if (_PinInch3.OFFFeedback && !_PinInch3.ONFeedback)
  111. {
  112. res = MovementPosition.Down;
  113. }
  114. return res;
  115. }
  116. }
  117. public MovementPosition Inch4Position
  118. {
  119. get
  120. {
  121. MovementPosition res = MovementPosition.Unknown;
  122. if (_PinInch4.ONFeedback && !_PinInch4.OFFFeedback)
  123. {
  124. res = MovementPosition.Up;
  125. }
  126. else if (_PinInch4.OFFFeedback && !_PinInch4.ONFeedback)
  127. {
  128. res = MovementPosition.Down;
  129. }
  130. return res;
  131. }
  132. }
  133. public DateTime PlcDateTime
  134. {
  135. get { return _plcDateTime.CurrentDateTime; }
  136. }
  137. public override bool IsError
  138. {
  139. get { return _MainPump.IsError || _Generator.IsError; }
  140. }
  141. public override bool IsIdle { get; }
  142. // 腔体压力
  143. public bool IsPressureToleranceEnabled
  144. {
  145. get => _pressureController.EnableTolerance;
  146. set => _pressureController.EnableTolerance = value;
  147. }
  148. public override double ChamberPressure => _pressureController.ProcessGauge.Value;
  149. public override double ChamberPressurePressure => _pressureController.PressureGauge.Value;
  150. public double ForelinePressure => _pressureController.ForelineGauge.Value;
  151. public PressureCtrlMode PressureMode => _pressureController.ThrottleValve.PressureMode;
  152. public double TargetPressure => _pressureController.TargetPressure;
  153. // 压力信号
  154. public bool IsATM => _ATM_sw.Value;
  155. public bool IsVAC => _VAC_sw.Value;
  156. public bool IsWLK => _WLK_sw.Value;
  157. public bool IsRFGInterlockOn => _RFG_Interlock.Value;
  158. // 温度
  159. public float SubstrateTempSP => _SubstrateTC.ControlTcSetPoint;
  160. public float SubstrateTempFB => _SubstrateTC.ControlTcFeedback;
  161. // Pump 状态
  162. public bool IsPumpRunning => _MainPump.IsRunning;
  163. public bool IsFastPumpOpened => _FastPumpValve.Status;
  164. public bool IsSoftPumpOpened => _SoftPumpValve.Status;
  165. public bool IsMfc1ValveOpened => _Mfc1Valve.Status;
  166. public bool IsMfc2ValveOpened => _Mfc2Valve.Status;
  167. public bool IsMfc3ValveOpened => _Mfc3Valve.Status;
  168. public bool IsMfc4ValveOpened => _Mfc4Valve.Status;
  169. public bool IsMfc5ValveOpened => _Mfc5Valve.Status;
  170. public bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
  171. public bool IsCDA_OK => _CDAPressure.Value;
  172. // 蝶阀位置
  173. public float TVPosition => _pressureController.ThrottleValve.PositionFeedback;
  174. // 腔体压力.end
  175. // 射频
  176. public float ForwardPower => _Generator.ForwardPower;
  177. public bool IsGeneratorON => _Generator.IsPowerOn;
  178. public float GeneratorSetpoint => _Generator.PowerSetPoint;
  179. // 流气
  180. public double TotalGasSetpoint
  181. {
  182. get
  183. {
  184. double sum = 0;
  185. foreach (var gas in _gasLines)
  186. {
  187. sum += gas.FlowSP;
  188. }
  189. return sum;
  190. }
  191. }
  192. public bool HasGasOutOfRange
  193. {
  194. get
  195. {
  196. foreach (var gas in _gasLines)
  197. {
  198. if (!gas.IsOutOfRange)
  199. return false;
  200. }
  201. return true;
  202. }
  203. }
  204. public bool CheckFactoryScrubberSysAlarm => _isFactoryScrubberSysInstalled && _FactoryScrubberSensor != null && _FactoryScrubberSensor.Value;
  205. // --------------------------Constructor-----------------------
  206. //
  207. public JetPM(ModuleName mod) : base(mod.ToString())
  208. {
  209. Module = mod;
  210. var gasCount = SC.GetValue<int>($"{mod}.GasCount");
  211. _gasLines = new IoGasStick[gasCount];
  212. _isFactoryScrubberSysInstalled = SC.ContainsItem($"{Module}.ScrubberIsInstalled") ? SC.GetValue<bool>($"{Module}.ScrubberIsInstalled") : false;
  213. for (int index = 0; index < gasCount; index++)
  214. {
  215. _gasLines[index] = DEVICE.GetDevice<IoGasStick>($"{Module}.GasStick{index + 1}");
  216. }
  217. _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{Virgo_DDevice.Lid}");
  218. //_LidLocker = DEVICE.GetDevice<IoCylinder>($"{Module}.{Virgo_DDevice.LidLocker}");
  219. _ATM_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorATMSwitch");
  220. _VAC_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorVacSwitch");
  221. _WLK_sw = DEVICE.GetDevice<IoSensor>($"{Module}.SensorWaterLeakOk");
  222. _CDAPressure = DEVICE.GetDevice<IoSensor>($"{Module}.SensorCDAPressureOk");
  223. _SignalTower = DEVICE.GetDevice<IoSignalTower>($"{Module}.SignalTower");
  224. //_ArmNotExtend = DEVICE.GetDevice<IoSensor>($"{Module}.SensorArmNotExtend");
  225. _RFG_Interlock = DEVICE.GetDevice<IoSensor>($"{Module}.GeneratorInterlock");
  226. _pressureController = DEVICE.GetDevice<IoPressureControl>($"{Module}.{Virgo_DDevice.PressureControl}");
  227. _SubstrateTC = DEVICE.GetDevice<IoHeater>($"{Module}.HeaterChamber");
  228. _ForelineTC = DEVICE.GetDevice<IoHeater>($"{Module}.ForelineHeater");
  229. _SoftPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveSoftPumping}");
  230. _FastPumpValve = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveFastPumping}");
  231. _ProcessValve = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveProcess}");
  232. _FastVentValve = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveFastVent}");
  233. _PurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveChamberPurge}");
  234. _PurgeValve = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveChamberPurge}");
  235. _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveMfc1}");
  236. _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveMfc2}");
  237. _Mfc3Valve = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveMfc3}");
  238. _Mfc4Valve = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveMfc4}");
  239. //_Mfc5Valve = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveMfc5}");
  240. //_slitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{Virgo_DDevice.SlitDoor}");
  241. _LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{Virgo_DDevice.LiftPin}");
  242. _PinInch3 = DEVICE.GetDevice<IoCylinder>($"{Module}.{Virgo_DDevice.Inch3Pin}");
  243. _PinInch4 = DEVICE.GetDevice<IoCylinder>($"{Module}.{Virgo_DDevice.Inch4Pin}");
  244. _Generator = DEVICE.GetDevice<IoRf>($"{Module}.{Virgo_DDevice.Rf}");
  245. _MainPump = DEVICE.GetDevice<PumpBase>($"{Module}.{Virgo_DDevice.MainPump}");
  246. _plcDateTime = DEVICE.GetDevice<IoPlcDateTime>($"{Module}.{Virgo_DDevice.PlcDateTime}");
  247. _FactoryScrubberSensor = DEVICE.GetDevice<IoSensor>($"{Module}.FactoryScrubberSysNormal");
  248. // RS223 AdTec Generator
  249. if (SC.GetValue<int>($"{mod}.Rf.CommunicationType") == (int)CommunicationType.RS232 &&
  250. SC.GetValue<int>($"{mod}.Rf.MFG") == (int)GeneratorMFG.AdTec)
  251. {
  252. _Generator = DEVICE.GetDevice<AdTecGenerator>($"{Module}.{Virgo_DDevice.Rf}");
  253. }
  254. // RS232 AdTec match
  255. if (SC.GetValue<int>($"{mod}.match.CommunicationType") == (int)CommunicationType.RS232 &&
  256. SC.GetValue<int>($"{mod}.match.MFG") == (int)MatchMFG.AdTec)
  257. {
  258. _Match = DEVICE.GetDevice<AdTecMatch>($"{Module}.{Virgo_DDevice.Match}");
  259. }
  260. // RS232 Dry pump, SKY
  261. if (SC.GetValue<int>($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232)
  262. {
  263. if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY)
  264. {
  265. _MainPump = DEVICE.GetDevice<SkyPump>($"{Module}.{Virgo_DDevice.MainPump}");
  266. }
  267. else if (SC.GetValue<int>($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards)
  268. {
  269. _MainPump = DEVICE.GetDevice<EdwardsPump>($"{Module}.{Virgo_DDevice.MainPump}");
  270. }
  271. }
  272. System.Diagnostics.Debug.Assert(null != _Generator);
  273. System.Diagnostics.Debug.Assert(null != _MainPump);
  274. WaferManager.Instance.SubscribeLocation(Module, 1);
  275. }
  276. public override bool Initialize()
  277. {
  278. base.Initialize();
  279. DATA.Subscribe($"{Name}.IoTemperatureCtrl.TemperatureControl.SubstrateTemperature", () => SubstrateTempFB);
  280. DATA.Subscribe($"{Module}.WaferSize", () => WaferManager.Instance.GetWafer(Module, 0).Size.ToString());
  281. return true;
  282. }
  283. // -----------------------------Method-------------------------
  284. //
  285. public override void Home()
  286. {
  287. // 与yp讨论过,PM 初始化不需要
  288. SetLiftPin(MovementPosition.Down, out _);
  289. //SetSlitDoor(false, out _);
  290. //SetGuidePin3Inch(MovementPosition.Down);
  291. //SetGuidePin4Inch(MovementPosition.Down);
  292. TryClosePumpAndPostAlarm();
  293. }
  294. private void TryClosePumpAndPostAlarm()
  295. {
  296. if (CheckFactoryScrubberSysAlarm)
  297. {
  298. if (IsFastPumpOpened) OpenValve(ValveType.FAST_PUMP, false);
  299. if (IsSoftPumpOpened) OpenValve(ValveType.SOFT_PUMP, false);
  300. EV.PostAlarmLog(Module.ToString(), $"{Module} {Name} Factory Scrubber System is alarm ");
  301. }
  302. }
  303. public void SetSlitDoor(bool open, out string reason)
  304. {
  305. reason = string.Empty;
  306. //// [XIAHUAN]: 只在关门的时候检查arm not extend
  307. //if (!open && !IsArmNotExtend)
  308. //{
  309. // EV.PostAlarmLog(Module.ToString(), "Arm Not Extend 信号不满足");
  310. // return;
  311. //}
  312. //_slitDoor.SetCylinder(open, out reason);
  313. }
  314. public void BuzzerBlinking(double time)
  315. {
  316. if (_SignalTower == null) return;
  317. _SignalTower.BuzzerBlinking(time);
  318. }
  319. public void SwitchOnBuzzerAndRed()
  320. {
  321. _SignalTower.SwitchOnBuzzerAndRed("", null);
  322. }
  323. public override bool CheckWaterLeak()
  324. {
  325. return _WLK_sw.Value;
  326. }
  327. public override bool CheckAtm()
  328. {
  329. return _ATM_sw.Value && ChamberPressure > 700000;
  330. }
  331. public override bool CheckVacuum()
  332. {
  333. return _VAC_sw.Value && ChamberPressure < 100;
  334. }
  335. public bool CheckSlitDoorOpen()
  336. {
  337. return true;
  338. //return _slitDoor.State == CylinderState.Open;
  339. }
  340. public bool CheckSlitDoorClose()
  341. {
  342. return true;
  343. //return _slitDoor.State == CylinderState.Close;
  344. }
  345. public bool CheckLiftUp()
  346. {
  347. return _LiftPin.State == CylinderState.Open;
  348. }
  349. public bool CheckLiftDown()
  350. {
  351. return _LiftPin.State == CylinderState.Close;
  352. }
  353. public void StartPump(bool on)
  354. {
  355. //_pressureController.StartPump(on);
  356. _MainPump?.SetPumpOnOff(on);
  357. }
  358. public void OpenValve(ValveType vlvType, bool on)
  359. {
  360. switch (vlvType)
  361. {
  362. case ValveType.PROCESS:
  363. _ProcessValve.TurnValve(on, out _);
  364. break;
  365. case ValveType.FAST_PUMP:
  366. _FastPumpValve.TurnValve(on, out _);
  367. break;
  368. case ValveType.SOFT_PUMP:
  369. _SoftPumpValve.TurnValve(on, out _);
  370. break;
  371. case ValveType.FAST_VENT:
  372. _FastVentValve.TurnValve(on, out _);
  373. break;
  374. case ValveType.PURGE:
  375. _PurgeValve.TurnValve(on, out _);
  376. break;
  377. case ValveType.Mfc1:
  378. _Mfc1Valve.TurnValve(on, out _);
  379. break;
  380. case ValveType.Mfc2:
  381. _Mfc2Valve.TurnValve(on, out _);
  382. break;
  383. case ValveType.Mfc3:
  384. _Mfc3Valve.TurnValve(on, out _);
  385. break;
  386. case ValveType.Mfc4:
  387. _Mfc4Valve.TurnValve(on, out _);
  388. break;
  389. //case ValveType.Mfc5:
  390. // _Mfc5Valve.TurnValve(on, out _);
  391. // break;
  392. default:
  393. throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
  394. }
  395. }
  396. public void CheckPressureStability() { }
  397. public override void Monitor()
  398. {
  399. foreach (var gas in _gasLines)
  400. {
  401. gas.Monitor();
  402. }
  403. _trigScrubberSysAlarm.CLK = CheckFactoryScrubberSysAlarm;
  404. if (_trigScrubberSysAlarm.Q)
  405. {
  406. TryClosePumpAndPostAlarm();
  407. }
  408. }
  409. public void CloseValves()
  410. {
  411. _SoftPumpValve.TurnValve(false, out _);
  412. _FastPumpValve.TurnValve(false, out _);
  413. _ProcessValve.TurnValve(false, out _);
  414. _PurgeValve.TurnValve(false, out _);
  415. _FastVentValve.TurnValve(false, out _);
  416. _PurgeValve.TurnValve(false, out _);
  417. _Mfc1Valve.TurnValve(false, out _);
  418. _Mfc2Valve.TurnValve(false, out _);
  419. _Mfc3Valve.TurnValve(false, out _);
  420. _Mfc4Valve.TurnValve(false, out _);
  421. //_Mfc5Valve.TurnValve(false, out _);
  422. foreach (var stick in _gasLines)
  423. {
  424. stick.Stop();
  425. }
  426. }
  427. public bool FlowGas(int gasNum, double val)
  428. {
  429. if (_gasLines.Length <= gasNum)
  430. return false;
  431. _gasLines[gasNum].Flow(val);
  432. return true;
  433. }
  434. public void StopAllGases()
  435. {
  436. foreach (var line in _gasLines)
  437. {
  438. line.Stop();
  439. }
  440. }
  441. public bool SetLiftPin(MovementPosition dirt, out string reason)
  442. {
  443. reason = string.Empty;
  444. switch (dirt)
  445. {
  446. case MovementPosition.Down:
  447. return _LiftPin.SetCylinder(false, out reason);
  448. case MovementPosition.Up:
  449. return _LiftPin.SetCylinder(true, out reason);
  450. case MovementPosition.Left:
  451. case MovementPosition.Right:
  452. case MovementPosition.Middle:
  453. throw new ArgumentException("Movement argument error");
  454. }
  455. return true;
  456. }
  457. public void SetGuidePin3Inch(MovementPosition dirt)
  458. {
  459. switch (dirt)
  460. {
  461. case MovementPosition.Down:
  462. _PinInch3.SetCylinder(false, out _);
  463. break;
  464. case MovementPosition.Up:
  465. _PinInch3.SetCylinder(true, out _);
  466. break;
  467. default:
  468. throw new ArgumentException("Movement argument error");
  469. }
  470. }
  471. public void SetGuidePin4Inch(MovementPosition dirt)
  472. {
  473. switch (dirt)
  474. {
  475. case MovementPosition.Down:
  476. _PinInch4.SetCylinder(false, out _);
  477. break;
  478. case MovementPosition.Up:
  479. _PinInch4.SetCylinder(true, out _);
  480. break;
  481. default:
  482. throw new ArgumentException("Movement argument error");
  483. }
  484. }
  485. public void SetGeneratorCommunicationMode(int mode)
  486. {
  487. _Generator?.SetCommunicationMode(mode);
  488. }
  489. public bool GeneratorPowerOn(bool on)
  490. {
  491. if (_Generator == null) return false;
  492. if (on && !IsRFGInterlockOn)
  493. {
  494. EV.PostAlarmLog(Module.ToString(), "射频电源 Interlock条件不满足");
  495. return false;
  496. }
  497. return _Generator.SetPowerOnOff(on, out _);
  498. }
  499. public bool GeneratorSetpower(float val)
  500. {
  501. if (_Generator == null) return false;
  502. _Generator.SetPower((ushort)val);
  503. return true;
  504. }
  505. public bool SetMatchPosition(float c1, float c2)
  506. {
  507. if (_Match == null) return false;
  508. string reason = string.Empty;
  509. _Match.SetMatchPosition(c1, c2, out reason);
  510. return true;
  511. }
  512. public void FullOpenTV()
  513. {
  514. _pressureController.FullOpenThrottleValve();
  515. }
  516. public void HeatSubstrate(double val)
  517. {
  518. _SubstrateTC?.RampTemp((float)val);
  519. _SubstrateTC?.TurnOnOff(true);
  520. }
  521. public void HeatForeline(double val)
  522. {
  523. _ForelineTC?.RampTemp((float)val);
  524. }
  525. public override bool CheckEnableTransfer(EnumTransferType type)
  526. {
  527. if (type == EnumTransferType.Pick)
  528. {
  529. //return _slitDoor.State == CylinderState.Open && _LiftPin.State == CylinderState.Open;
  530. }
  531. if (type == EnumTransferType.Place)
  532. {
  533. //return _slitDoor.State == CylinderState.Open && _LiftPin.State == CylinderState.Close;
  534. }
  535. return false;
  536. }
  537. public override void TransferHandoff(EnumTransferType type)
  538. {
  539. switch (type)
  540. {
  541. case EnumTransferType.Pick:
  542. SetLiftPin(MovementPosition.Up, out _);
  543. break;
  544. case EnumTransferType.Place:
  545. SetLiftPin(MovementPosition.Down, out _);
  546. break;
  547. case EnumTransferType.Extend:
  548. break;
  549. case EnumTransferType.Retract:
  550. break;
  551. default:
  552. break;
  553. }
  554. }
  555. public override void Reset()
  556. {
  557. }
  558. }
  559. /// <summary>
  560. /// PM Action
  561. /// </summary>
  562. abstract class PmActionBase : ActionBase
  563. {
  564. protected internal JetPM _chamber;
  565. protected PmActionBase(ModuleName mod, JetPM pm) : base(mod)
  566. {
  567. _chamber = pm;
  568. }
  569. }
  570. class PinAction : PmActionBase
  571. {
  572. public MovementPosition Pos { get; }
  573. public bool IsWaferTransfered { get; }
  574. public PMEntity PmEntity { get; set; }
  575. public PinAction(ModuleName mod, JetPM pm, MovementPosition pos, bool isTransferWafer) : base(mod, pm)
  576. {
  577. this.Pos = pos;
  578. IsWaferTransfered = isTransferWafer;
  579. }
  580. public override void Execute()
  581. {
  582. if (Module == ModuleName.PMA)
  583. PmEntity = Singleton<RouteManager>.Instance.PMA;
  584. else if (Module == ModuleName.PMB)
  585. PmEntity = Singleton<RouteManager>.Instance.PMB;
  586. if (PmEntity != null)
  587. {
  588. PmEntity.PostMsg(PMEntity.MSG.MoveLiftPin, Pos, ID);
  589. }
  590. }
  591. public override void OnPostWork(string data = null)
  592. {
  593. if (IsWaferTransfered)
  594. {
  595. if (Pos == MovementPosition.Up)
  596. {
  597. WaferManager.Instance.WaferMoved(ModuleName.EfemRobot, 0, Module, 0);
  598. }
  599. else
  600. {
  601. WaferManager.Instance.WaferMoved(Module, 0, ModuleName.EfemRobot, 0);
  602. }
  603. }
  604. }
  605. }
  606. }