using Aitex.Core.RT.Device; using Aitex.Core.RT.Event; using Aitex.Core.RT.SCCore; using Aitex.Core.Util; using athosRT.Modules; using athosRT.Modules.EFEMs; using athosRT.tool; using MECF.Framework.Common.Equipment; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; using EV = athosRT.tool.EV; namespace athosRT.Devices { public class EquipmentMonitor : BaseDevice, IDevice { private readonly RD_TRIG _trigMaintenance = new RD_TRIG(); private readonly RD_TRIG _airForRobotTrig = new RD_TRIG(); private readonly RD_TRIG _airForLoadPortTrig = new RD_TRIG(); private readonly RD_TRIG _vacuumErrorTrig = new RD_TRIG(); private readonly RD_TRIG _ffu1ErrorTrig = new RD_TRIG(); private readonly RD_TRIG _ffu2ErrorTrig = new RD_TRIG(); private readonly RD_TRIG _ionizorErrorTrig = new RD_TRIG(); private readonly RD_TRIG _flowWarningTrig = new RD_TRIG(); private readonly RD_TRIG _leakWarningTrig = new RD_TRIG(); private readonly R_TRIG signalTowerTrig = new R_TRIG(); private readonly RD_TRIG _cassetleChangeLP1Trig = new RD_TRIG(); private readonly RD_TRIG _cassetleChangeLP2Trig = new RD_TRIG(); private readonly RD_TRIG _trigCassetteDoor = new RD_TRIG(); private readonly RD_TRIG _trigRobotWafer = new RD_TRIG(); private readonly bool _dOLEDLight = Singleton.Instance.GetValue("DOLEDLight").GetValueOrDefault(); private readonly bool _noMaintenanceSignal = Singleton.Instance.GetValue("NoMaintenanceSignal").GetValueOrDefault(); private readonly bool _noNoDoorOpenSignal = Singleton.Instance.GetValue("NoDoorOpenSignal").GetValueOrDefault(); private uint data2; private int _fFUSettingKnob; private readonly int[] _speedTable = new int[11] { 0, 200, 300, 400, 500, 550, 600, 650, 700, 750, 800 }; public RD_TRIG TrigMaintenance => this._trigMaintenance; public RD_TRIG AirForRobotTrig => this._airForRobotTrig; public RD_TRIG AirForLoadPortTrig => this._airForLoadPortTrig; public RD_TRIG VacuumErrorTrig => this._vacuumErrorTrig; public RD_TRIG FfuErrorTrig => this._ffu1ErrorTrig.R || this._ffu1ErrorTrig.T ? this._ffu1ErrorTrig : this._ffu2ErrorTrig; public RD_TRIG IonizorErrorTrig => this._ionizorErrorTrig; public RD_TRIG SensorFlowWarning => this._flowWarningTrig; public RD_TRIG LeakWarningTrig => this._leakWarningTrig; public R_TRIG SignalTowerTrig => this.signalTowerTrig; public EquipmentMonitor() : base("System", nameof(EquipmentMonitor), nameof(EquipmentMonitor), nameof(EquipmentMonitor)) { } public bool Initialize() { this.Subscriptions(); return true; } public void Monitor() { //这里是一些信号的获取 对实际内容的影响不大 if (!this._noMaintenanceSignal && !this._noNoDoorOpenSignal) { this._trigMaintenance.CLK = !DeviceModel.SensorMaintenanceMode.Value || DeviceModel.SensorEFEMSideDoorClosed.Value; // LogObject.Info("System", "SensorMaintenanceMode"+ DeviceModel.SensorMaintenanceMode.Value+ " SensorEFEMSideDoorClosed:"+DeviceModel.SensorEFEMSideDoorClosed.Value); } if (this._flowWarningTrig.T) EV.PostMessage("System", EventEnum.DefaultAlarm, (object)"Flow Warning"); if (this._leakWarningTrig.R) EV.PostMessage("System", EventEnum.DefaultAlarm, (object)"Leak Warning"); if (this._airForRobotTrig.R) EV.PostMessage("System", EventEnum.DefaultAlarm, (object)"Air supply for Robot pressure error"); if (this._airForLoadPortTrig.R) EV.PostMessage("System", EventEnum.DefaultAlarm, (object)"Air supply for Load Port pressure error"); if (this._vacuumErrorTrig.R) EV.PostMessage("System", EventEnum.DefaultAlarm, (object)"Vacuum supply for system pressure error"); if (this._airForRobotTrig.R || this._airForLoadPortTrig.R || this._vacuumErrorTrig.R) //Singleton.Instance.PostMsg(RouteManager.MSG.ERROR); Trace.WriteLine("RT Error"); if (this._trigMaintenance.R) Singleton.Instance.PostMsg(RouteManager1.MSG.SetMaintenanceMode); Trace.WriteLine("RT SetMaintenanceMode"); if (this._trigMaintenance.T) Singleton.Instance.PostMsg(RouteManager1.MSG.SetManualMode); Trace.WriteLine("RT SetManualMode"); //this._fFUSettingKnob = SC.ContainsItem("System.FFUSpeedSet") ? SC.GetValue("System.FFUSpeedSet") : 3; //if (Singleton.Instance.IsOnlineMode && (this._trigMaintenance.R || this._trigMaintenance.T || this._airForLoadPortTrig.R || this._airForLoadPortTrig.T || this._airForRobotTrig.R || this._airForRobotTrig.T || this._vacuumErrorTrig.R || this._vacuumErrorTrig.T || this._ffu1ErrorTrig.R || this._ffu1ErrorTrig.T || this._ffu2ErrorTrig.R || this._ffu2ErrorTrig.T || this._ionizorErrorTrig.R || this._ionizorErrorTrig.T || this._flowWarningTrig.T || this._leakWarningTrig.R || this._trigCassetteDoor.T || this._trigRobotWafer.R || this._trigRobotWafer.T)) // Singleton.Instance.SendSigStatEvent(ModuleName.System); //if (!this.signalTowerTrig.Q) // return; //this.data2 = Singleton.Instance.GetSigStatData2(ModuleName.System); //this.signalTowerTrig.RST = true; //if (Singleton.Instance.IsOnlineMode) // Singleton.Instance.SendSigStatEvent(ModuleName.System); } public void Terminate() { } public void Reset() { } private void Subscriptions() { } } }