123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- using Aitex.Core.Util;
- using athosRT.Modules;
- using athosRT.Modules.EFEMs;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- using RouteManager = athosRT.Modules.RouteManager1;
- namespace athosRT.Devices.EFEM
- {
- public class SystemServerModule : IServerModule, IData, IFunction
- {
- private Dictionary<EfemEventType, EfemEventValue> _dicEventStatus = new Dictionary<EfemEventType, EfemEventValue>();
- public string Name { get; set; }
- public bool Busy => Singleton<RouteManager>.Instance.IsRunning;
- public bool Moving { get; set; }
- public bool Error => Singleton<RouteManager>.Instance.IsError;
- public bool IsLinkOk => Singleton<EfemEntity>.Instance.IsCommunicationOk;
- public bool Disabled { get; set; }
- public bool Initialized { get; set; }
- public bool OriginSearched { get; set; }
- public bool InUsed { get; set; }
- public SystemServerModule(string name)
- {
- this.Name = name;
- foreach (EfemEventType key in Enum.GetValues(typeof(EfemEventType)))
- this._dicEventStatus[key] = EfemEventValue.ON;
- }
- public bool Init(out string reason)
- {
- reason = string.Empty;
- if (!Singleton<RouteManager>.Instance.CheckToPostMsg(RouteManager.MSG.HOME))
- {
- reason = "BUSY";
- return false;
- }
- Thread.Sleep(100);//原来就有
- this.Initialized = true;
- return true;
- }
- public bool Home(out string reason)
- {
- reason = string.Empty;
- if (!Singleton<RouteManager>.Instance.CheckToPostMsg(RouteManager.MSG.HOME))
- {
- reason = "BUSY";
- return false;
- }
- this.Initialized = true;
- return true;
- }
- public bool MapWafer(string device, out string reason)
- {
- reason = string.Empty;
- if (Singleton<RouteManager>.Instance.CheckToPostMsg(RouteManager.MSG.MapWafer, (object)device))
- return true;
- reason = "BUSY";
- return false;
- }
- public bool SetEvent(EfemEventType type, EfemEventValue value)
- {
- this._dicEventStatus[type] = value;
- return true;
- }
- public bool IsEventEnabled(EfemEventType type) => this._dicEventStatus[type] == EfemEventValue.ON;
- public bool Hold() => true;
- public bool Resume() => true;
- public bool Abort() => true;
- public bool Stop() => true;
- public bool ClearError()
- {
- if (Singleton<RouteManager>.Instance.IsError)
- Singleton<RouteManager>.Instance.Invoke("Reset");
- return true;
- }
- public string GetLastError() => string.Empty;
- }
- }
|