123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- 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<DeviceDefineManager>.Instance.GetValue<bool>("DOLEDLight").GetValueOrDefault();
- private readonly bool _noMaintenanceSignal = Singleton<DeviceDefineManager>.Instance.GetValue<bool>("NoMaintenanceSignal").GetValueOrDefault();
- private readonly bool _noNoDoorOpenSignal = Singleton<DeviceDefineManager>.Instance.GetValue<bool>("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<EventEnum>("System", EventEnum.DefaultAlarm, (object)"Flow Warning");
- if (this._leakWarningTrig.R)
- EV.PostMessage<EventEnum>("System", EventEnum.DefaultAlarm, (object)"Leak Warning");
- if (this._airForRobotTrig.R)
- EV.PostMessage<EventEnum>("System", EventEnum.DefaultAlarm, (object)"Air supply for Robot pressure error");
- if (this._airForLoadPortTrig.R)
- EV.PostMessage<EventEnum>("System", EventEnum.DefaultAlarm, (object)"Air supply for Load Port pressure error");
- if (this._vacuumErrorTrig.R)
- EV.PostMessage<EventEnum>("System", EventEnum.DefaultAlarm, (object)"Vacuum supply for system pressure error");
- if (this._airForRobotTrig.R || this._airForLoadPortTrig.R || this._vacuumErrorTrig.R)
- //Singleton<RouteManager>.Instance.PostMsg<RouteManager.MSG>(RouteManager.MSG.ERROR);
- Trace.WriteLine("RT Error");
- if (this._trigMaintenance.R)
- Singleton<RouteManager1>.Instance.PostMsg(RouteManager1.MSG.SetMaintenanceMode);
- Trace.WriteLine("RT SetMaintenanceMode");
- if (this._trigMaintenance.T)
- Singleton<RouteManager1>.Instance.PostMsg(RouteManager1.MSG.SetManualMode);
- Trace.WriteLine("RT SetManualMode");
- //this._fFUSettingKnob = SC.ContainsItem("System.FFUSpeedSet") ? SC.GetValue<int>("System.FFUSpeedSet") : 3;
- //if (Singleton<EfemEntity>.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<EfemEntity>.Instance.SendSigStatEvent(ModuleName.System);
- //if (!this.signalTowerTrig.Q)
- // return;
- //this.data2 = Singleton<EfemEntity>.Instance.GetSigStatData2(ModuleName.System);
- //this.signalTowerTrig.RST = true;
- //if (Singleton<EfemEntity>.Instance.IsOnlineMode)
- // Singleton<EfemEntity>.Instance.SendSigStatEvent(ModuleName.System);
- }
- public void Terminate()
- {
- }
- public void Reset()
- {
- }
- private void Subscriptions()
- {
- }
- }
- }
|