using Aitex.Core.RT.Routine; using Aitex.Core.RT.SCCore; using Venus_RT.Devices; using MECF.Framework.Common.Routine; using System.Diagnostics; using System.Collections.Generic; using Venus_Core; namespace Venus_RT.Modules.PMs { class LLPlaceRoutine : PMRoutineBase, IRoutine { private enum LLPlaceStep { kPrepareTransfer, kExtend, kPinUp, kRetract, kPostTransfer, kOpenFastPump, } private int _prepareTransferTimeout = 120; private int _transferWaferTimeout = 120; private bool _isATMMode = false; public LLPlaceRoutine(JetPM chamber) : base(chamber) { Name = "PlaceWafer"; } public RState Start(params object[] objs) { _prepareTransferTimeout = SC.GetValue($"{Module}.PrepareTransferTimeout"); _transferWaferTimeout = SC.GetValue($"{Module}.TransferWaferTimeout"); _isATMMode = SC.GetValue("System.IsATMMode"); if(_isATMMode) { if(!_chamber.IsATM || !_chamber.IsATMLoadlock) { Stop("腔体非大气状态,请先执行充气动作"); return RState.Failed; } } else { if(!_chamber.IsVAC || !_chamber.IsVACLoadLock) { Stop("腔体非真空状态,请先执行抽真空动作"); return RState.Failed; } } _chamber.OpenValve(ValveType.FastPump, false); _chamber.OpenValve(ValveType.LoadlockPumping, false); Reset(); return Runner.Start(Module, Name); } public RState Monitor() { Runner.Run((int)LLPlaceStep.kPrepareTransfer, PrepareTransfer, IsPrepareReady, _prepareTransferTimeout * 1000) .Run((int)LLPlaceStep.kExtend, _chamber.ExtendWafer, () => { return _chamber.IsLoadlockArmExtend; }, _transferWaferTimeout * 1000) .Run((int)LLPlaceStep.kPinUp, SetLiftPinUp, () => { return _chamber.CheckLiftUp(); }) .Run((int)LLPlaceStep.kRetract, _chamber.RetractWafer, () => { return _chamber.IsLoadlockArmRetract; }, _transferWaferTimeout * 1000) .Run((int)LLPlaceStep.kPostTransfer, PostTransfer, IsPostTransferReady, _prepareTransferTimeout * 1000) .End((int)LLPlaceStep.kOpenFastPump, OpenFastPump, _delay_50ms); return Runner.Status; } private bool PrepareTransfer() { _chamber.SetLiftPin(MovementPosition.Down, out _); _chamber.SetSlitDoor(true, out _); return true; } private bool IsPrepareReady() { return _chamber.CheckLiftDown() && _chamber.CheckSlitDoorOpen(); } private bool PostTransfer() { _chamber.SetLiftPin(MovementPosition.Down, out _); _chamber.SetSlitDoor(false, out _); return true; } private bool IsPostTransferReady() { return _chamber.CheckLiftDown() && _chamber.CheckSlitDoorClose(); } private bool SetLiftPinUp() { return _chamber.SetLiftPin(MovementPosition.Up, out _); } private bool OpenFastPump() { if (!_isATMMode) _chamber.OpenValve(ValveType.FastPump, true); return true; } public void Abort() { } } }