using Aitex.Core.RT.Fsm; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; using Venus_Core; using Venus_RT.Devices; namespace Venus_RT.Modules.TM.VenusEntity { public class SETMEntity : Entity, IModuleEntity { public enum STATE { Unknown, Init, Initializing, InitializingRB, Idle, Error, Pumping, Venting, Purging, Leakchecking, Picking, Placing, Swaping, PMPicking, PMPlacing, PMSwaping, Aligning, Mapping, Extending, Retracting, Swapping, Gotoing, ControllingPressure } public enum MSG { Home, RobotHome, Online, Offline, Pump, Vent, Purge, CyclePurge, LeakCheck, Pick, Place, Swap, DoublePick, DoublePlace, DoubleSwap, PMPick, PMPlace, PMSwap, Extend, Retract, TMCycle, ControlPressure, Error, Abort, AbortControlPressure } public bool IsIdle { get { return fsm.State == (int)STATE.Idle; } } public bool IsError { get { return fsm.State == (int)STATE.Error; } } public bool IsInit { get { return fsm.State == (int)STATE.Unknown || fsm.State == (int)STATE.Init; } } public bool IsBusy { get { return !IsInit && !IsError && !IsIdle; } } public RState RobotStatus { get { if (_robot.Status != RState.Running) { if (_robotWatch.ElapsedMilliseconds < 100) return RState.Running; else return _robot.Status; } else return RState.Running; } } private readonly ITransferRobot _robot; private readonly Stopwatch _robotWatch; public SETMEntity() { } public bool Check(int msg, out string reason, params object[] args) { throw new NotImplementedException(); } public bool CheckAcked(int msg) { throw new NotImplementedException(); } public int Invoke(string function, params object[] args) { throw new NotImplementedException(); } } }