123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using System;
- using Aitex.Core.RT.DataCenter;
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using JetVirgoPM.Devices;
- using MECF.Framework.Common.Routine;
- using MECF.Framework.Common.Schedulers;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs;
- using MECF.Framework.RT.ModuleLibrary.SystemModules;
- namespace JetVirgoPM.PMs.Routines
- {
- class PMPostTransferRoutine : PMRoutineBase, IStepRoutine
- {
- enum RoutineStep
- {
- PumpDown,
- SetLiftPin,
- WaitNotExtendToPMON,
- SetSlitDoor,
- SlitDoorDelay,
- kEnd
- }
- private int _timeout;
- private EnumDualPM _pos;
- public PMPostTransferRoutine(JetDualPM chamber) : base(chamber)
- {
- Name = "PostTransfer";
- }
- public RState Init(EnumTransferType type, int[] slot)
- {
-
- _pos = (slot.Length > 1) ? EnumDualPM.Both : (slot[0] == 0) ? EnumDualPM.Left : EnumDualPM.Right;
- if (SC.IsDoubleFork) _pos = EnumDualPM.Both;
- return RState.End;
- }
- public RState Start(params object[] objs)
- {
- Reset();
- _timeout = SC.GetValue<int>($"{Module}.PrepareTransferTimeout");
- return Runner.Start(_chamber.Module.ToString(), Name);
- }
- public RState Monitor()
- {
- //只在TMCycle中降pin,其余在Recipe中控制
- if (DATA.Poll("Rt", "Status").ToString() == RtState.TMCycling.ToString())
- {
- Runner.Run(RoutineStep.SetLiftPin, HOFs.Apply(SetLiftPinUpDown, _pos, false), HOFs.Apply(ChecktLiftPinUpDown, _pos, false))
- .Run(RoutineStep.WaitNotExtendToPMON, WaitNotExtendToPMON, CheckWaitNotExtendToPMON, _timeout * 1000)
- .Run(RoutineStep.SetSlitDoor, HOFs.Apply(SetSlitDoor, _pos, false), HOFs.Apply(CheckSlitDoor, _pos, false), _timeout * 1000)
- .End(RoutineStep.kEnd, EndFunc, _delay_0s);
- }
- else
- {
- Runner.Run(RoutineStep.WaitNotExtendToPMON, WaitNotExtendToPMON, CheckWaitNotExtendToPMON, _timeout * 1000)
- .Run(RoutineStep.SetSlitDoor, HOFs.Apply(SetSlitDoor, _pos, false), HOFs.Apply(CheckSlitDoor, _pos, false), _timeout * 1000)
- .End(RoutineStep.kEnd, EndFunc, _delay_0s);
- }
- return Runner.Status;
- }
- public override void Abort() { }
- bool WaitNotExtendToPMON()
- {
- Func<bool> notifyFunc = () => { Notify($"等待 Not Extend To PM 信号ON"); return true; };
- return ((_pos != EnumDualPM.Left || _chamber.IsTMRobotNotExtendToPM1) || notifyFunc()) &&
- ((_pos != EnumDualPM.Right || _chamber.IsTMRobotNotExtendToPM2) || notifyFunc());
- }
- private bool CheckWaitNotExtendToPMON()
- {
- return ((_pos != EnumDualPM.Left) || _chamber.IsTMRobotNotExtendToPM1) && ((_pos != EnumDualPM.Right) || _chamber.IsTMRobotNotExtendToPM2);
- }
- }
- }
|