1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using Aitex.Core.RT.Routine;
- using Aitex.Sorter.Common;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.Schedulers;
- using System.Collections.Generic;
- using Venus_Core;
- using Venus_RT.Devices;
- namespace Venus_RT.Modules.TM
- {
- internal class MFRotationRoutine : ModuleRoutineBase, IRoutine
- {
- private enum RotationStep
- {
- Rotation,
- End
- }
- private readonly JetTM _JetTM;
- private readonly ITransferRobot _robot;
- private ModuleName _targetModule;
- public MFRotationRoutine(JetTM tm, ITransferRobot robot) : base(ModuleName.TMRobot)
- {
- _JetTM = tm;
- _robot = robot;
- }
- public RState Start(params object[] objs)
- {
- var rotationItem = (Queue<MoveItem>)objs[0];
- _targetModule = rotationItem.Peek().DestinationModule;
- return Runner.Start(Module, $"Rotation to {_targetModule}");
- }
- public RState Monitor()
- {
- Runner.Run(RotationStep.Rotation, Rotation , WaitRotationDone, _timeout_20s)
- .End(RotationStep.End, NullFun, _delay_50ms);
- return Runner.Status;
- }
- private bool Rotation()
- {
- return _robot.Goto(_targetModule, 0, Hand.Both);
- }
- private bool WaitRotationDone()
- {
- return _robot.Status == RState.End;
- }
- public void Abort()
- {
-
- }
- }
- }
|