using System; using System.Collections.Generic; using System.Linq; using System.Net.Configuration; using System.Text; using System.Threading.Tasks; using System.Xml; using Aitex.Core.Common.DeviceData; using Aitex.Core.RT.DataCenter; using Aitex.Core.RT.Device; using Aitex.Core.RT.Event; using Aitex.Core.RT.IOCore; using Aitex.Core.RT.OperationCenter; using Aitex.Core.RT.SCCore; using Aitex.Core.Util; namespace MECF.Framework.Common.Device.Bases { public abstract class VCEBase : BaseDevice, IDevice { public virtual bool IsIdle { get; set; } public virtual bool IsHomed { get; set; } public virtual bool IsDoorOpened { get; set; } public virtual bool IsDoorClosed { get; set; } public virtual bool IsAlarm { get; set; } public virtual bool IsConnected { get; set; } public virtual bool IsMapped { get; set; } protected VCEBase() : base() { } protected VCEBase(string module, string name) : base(module, name, name, name) { } public virtual bool Initialize() { OP.Subscribe($"{Module}.{Name}.Home", (string cmd, object[] args) => { Home(out _); return true; }); OP.Subscribe($"{Module}.{Name}.Abort", (string cmd, object[] args) => { Abort(); return true; }); OP.Subscribe($"{Module}.{Name}.Reset", (string cmd, object[] args) => { Reset(); return true; }); OP.Subscribe($"{Module}.{Name}.Unload", (string cmd, object[] args) => { Unload(out _); return true; }); OP.Subscribe($"{Module}.{Name}.Load", (string cmd, object[] args) => { Load(out _); return true; }); return true; } public virtual void Terminate() { } public virtual void Monitor() { } public virtual void Reset() { } public virtual bool Home(out string reason) { reason = string.Empty; return true; } public virtual bool Load(out string reason) { reason = string.Empty; return true; } public virtual bool Unload(out string reason) { reason = string.Empty; return true; } public virtual bool OpenDoor(out string reason) { reason = string.Empty; return true; } public virtual bool CloseDoor(out string reason) { reason = string.Empty; return true; } public virtual bool MapCassette(out string reason) { reason = string.Empty; return true; } public virtual void Abort() { return; } } }