using Aitex.Core.RT.Device; using Aitex.Core.RT.Log; using Aitex.Sorter.Common; using MECF.Framework.Common.Equipment; using MECF.Framework.Common.Schedulers; using MECF.Framework.Common.SubstrateTrackings; using MECF.Framework.RT.EquipmentLibrary.LogicUnits; using MECF.Framework.RT.ModuleLibrary.Commons; using CyberX8_Core; namespace MECF.Framework.RT.ModuleLibrary.VceModules { public abstract class VceModuleBase : ModuleFsmDevice, ITransferTarget, IModuleDevice { private int _slot = 25; private ModuleName _moduleName; //private bool isJobDone; public virtual RState Status { get; } public VceModuleBase(int slot, ModuleName moduleName) { _slot = slot; _moduleName = moduleName; } public override bool Initialize() { WaferManager.Instance.SubscribeLocation(ModuleHelper.Converter(Module), _slot); CarrierManager.Instance.SubscribeLocation(Module); return base.Initialize(); } public virtual void NoteJobStart() { //isJobDone = false; } public virtual void NoteJobComplete() { //isJobDone = true; } public virtual bool OutDoorIsOpen { get; set; } //IModuleDevice public abstract bool IsConnected { get; } public abstract bool IsReady { get; } public abstract bool IsError { get; } public abstract bool IsInit { get; } //Home public abstract bool Home(string axis); public abstract bool HomeALL(); //此处的Door 都是Outer Door public abstract bool OpenDoor(); public abstract bool CloseDoor(); //Load public abstract bool Load(); public abstract bool UnLoad(); //Goto public abstract bool Goto(int Targetslot); //Map public abstract bool Map(); //Read public abstract bool ReadMap(); public abstract bool GotoLP(); //Halt //public abstract bool Halt(); protected bool CheckVceStatus() { if (Status == RState.Init) { LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE is not homed, please home first."); return false; } else if (Status == RState.Running) { LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE is busy, please wait a minute"); return false; } else if (Status == RState.Failed || Status == RState.Timeout) { LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE has a error, please check and fix the hardware issue and home it"); return false; } return true; } //transfer public bool PrepareTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason) { reason = ""; return false; } public bool TransferHandoff(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason) { reason = ""; return false; } public bool PostTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason) { reason = ""; return false; } public bool CheckReadyForTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason) { reason = ""; return false; } public void NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType) { return; } public void NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType) { return; } public bool Home(out string reason) { reason = ""; return false; } } }