| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 | using Aitex.Core.RT.Routine;using Aitex.Core.RT.SCCore;using Venus_RT.Devices;using MECF.Framework.Common.Equipment;using MECF.Framework.Common.SubstrateTrackings;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<int>($"{Module}.PrepareTransferTimeout");            _transferWaferTimeout = SC.GetValue<int>($"{Module}.TransferWaferTimeout");            _isATMMode = SC.GetValue<bool>("System.IsATMMode");            if (WaferManager.Instance.CheckHasWafer(ModuleName.PMA, 0))            {                Stop("腔体里面有 Wafer,不能执行放片动作");                return RState.Failed;            }            if (WaferManager.Instance.CheckNoWafer(ModuleName.LLA, 0))            {                Stop("Loadlock 里面没有 Wafer,不能执行放片动作");                return RState.Failed;            }            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()        {            WaferManager.Instance.WaferMoved(ModuleName.LLA, 0, ModuleName.PMA, 0);            _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()        {        }    }}
 |