EquipmentMonitor.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.RT.Event;
  3. using Aitex.Core.RT.SCCore;
  4. using Aitex.Core.Util;
  5. using athosRT.Modules;
  6. using athosRT.Modules.EFEMs;
  7. using athosRT.tool;
  8. using MECF.Framework.Common.Equipment;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Diagnostics;
  12. using System.Linq;
  13. using System.Text;
  14. using System.Threading.Tasks;
  15. using EV = athosRT.tool.EV;
  16. namespace athosRT.Devices
  17. {
  18. public class EquipmentMonitor : BaseDevice, IDevice
  19. {
  20. private readonly RD_TRIG _trigMaintenance = new RD_TRIG();
  21. private readonly RD_TRIG _airForRobotTrig = new RD_TRIG();
  22. private readonly RD_TRIG _airForLoadPortTrig = new RD_TRIG();
  23. private readonly RD_TRIG _vacuumErrorTrig = new RD_TRIG();
  24. private readonly RD_TRIG _ffu1ErrorTrig = new RD_TRIG();
  25. private readonly RD_TRIG _ffu2ErrorTrig = new RD_TRIG();
  26. private readonly RD_TRIG _ionizorErrorTrig = new RD_TRIG();
  27. private readonly RD_TRIG _flowWarningTrig = new RD_TRIG();
  28. private readonly RD_TRIG _leakWarningTrig = new RD_TRIG();
  29. private readonly R_TRIG signalTowerTrig = new R_TRIG();
  30. private readonly RD_TRIG _cassetleChangeLP1Trig = new RD_TRIG();
  31. private readonly RD_TRIG _cassetleChangeLP2Trig = new RD_TRIG();
  32. private readonly RD_TRIG _trigCassetteDoor = new RD_TRIG();
  33. private readonly RD_TRIG _trigRobotWafer = new RD_TRIG();
  34. private readonly bool _dOLEDLight = Singleton<DeviceDefineManager>.Instance.GetValue<bool>("DOLEDLight").GetValueOrDefault();
  35. private readonly bool _noMaintenanceSignal = Singleton<DeviceDefineManager>.Instance.GetValue<bool>("NoMaintenanceSignal").GetValueOrDefault();
  36. private readonly bool _noNoDoorOpenSignal = Singleton<DeviceDefineManager>.Instance.GetValue<bool>("NoDoorOpenSignal").GetValueOrDefault();
  37. private uint data2;
  38. private int _fFUSettingKnob;
  39. private readonly int[] _speedTable = new int[11]
  40. {
  41. 0,
  42. 200,
  43. 300,
  44. 400,
  45. 500,
  46. 550,
  47. 600,
  48. 650,
  49. 700,
  50. 750,
  51. 800
  52. };
  53. public RD_TRIG TrigMaintenance => this._trigMaintenance;
  54. public RD_TRIG AirForRobotTrig => this._airForRobotTrig;
  55. public RD_TRIG AirForLoadPortTrig => this._airForLoadPortTrig;
  56. public RD_TRIG VacuumErrorTrig => this._vacuumErrorTrig;
  57. public RD_TRIG FfuErrorTrig => this._ffu1ErrorTrig.R || this._ffu1ErrorTrig.T ? this._ffu1ErrorTrig : this._ffu2ErrorTrig;
  58. public RD_TRIG IonizorErrorTrig => this._ionizorErrorTrig;
  59. public RD_TRIG SensorFlowWarning => this._flowWarningTrig;
  60. public RD_TRIG LeakWarningTrig => this._leakWarningTrig;
  61. public R_TRIG SignalTowerTrig => this.signalTowerTrig;
  62. public EquipmentMonitor()
  63. : base("System", nameof(EquipmentMonitor), nameof(EquipmentMonitor), nameof(EquipmentMonitor))
  64. {
  65. }
  66. public bool Initialize()
  67. {
  68. this.Subscriptions();
  69. return true;
  70. }
  71. public void Monitor()
  72. {
  73. //这里是一些信号的获取 对实际内容的影响不大
  74. if (!this._noMaintenanceSignal && !this._noNoDoorOpenSignal)
  75. {
  76. this._trigMaintenance.CLK = !DeviceModel.SensorMaintenanceMode.Value || DeviceModel.SensorEFEMSideDoorClosed.Value;
  77. // LogObject.Info("System", "SensorMaintenanceMode"+ DeviceModel.SensorMaintenanceMode.Value+ " SensorEFEMSideDoorClosed:"+DeviceModel.SensorEFEMSideDoorClosed.Value);
  78. }
  79. if (this._flowWarningTrig.T)
  80. EV.PostMessage<EventEnum>("System", EventEnum.DefaultAlarm, (object)"Flow Warning");
  81. if (this._leakWarningTrig.R)
  82. EV.PostMessage<EventEnum>("System", EventEnum.DefaultAlarm, (object)"Leak Warning");
  83. if (this._airForRobotTrig.R)
  84. EV.PostMessage<EventEnum>("System", EventEnum.DefaultAlarm, (object)"Air supply for Robot pressure error");
  85. if (this._airForLoadPortTrig.R)
  86. EV.PostMessage<EventEnum>("System", EventEnum.DefaultAlarm, (object)"Air supply for Load Port pressure error");
  87. if (this._vacuumErrorTrig.R)
  88. EV.PostMessage<EventEnum>("System", EventEnum.DefaultAlarm, (object)"Vacuum supply for system pressure error");
  89. if (this._airForRobotTrig.R || this._airForLoadPortTrig.R || this._vacuumErrorTrig.R)
  90. //Singleton<RouteManager>.Instance.PostMsg<RouteManager.MSG>(RouteManager.MSG.ERROR);
  91. Trace.WriteLine("RT Error");
  92. if (this._trigMaintenance.R)
  93. Singleton<RouteManager1>.Instance.PostMsg(RouteManager1.MSG.SetMaintenanceMode);
  94. Trace.WriteLine("RT SetMaintenanceMode");
  95. if (this._trigMaintenance.T)
  96. Singleton<RouteManager1>.Instance.PostMsg(RouteManager1.MSG.SetManualMode);
  97. Trace.WriteLine("RT SetManualMode");
  98. //this._fFUSettingKnob = SC.ContainsItem("System.FFUSpeedSet") ? SC.GetValue<int>("System.FFUSpeedSet") : 3;
  99. //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))
  100. // Singleton<EfemEntity>.Instance.SendSigStatEvent(ModuleName.System);
  101. //if (!this.signalTowerTrig.Q)
  102. // return;
  103. //this.data2 = Singleton<EfemEntity>.Instance.GetSigStatData2(ModuleName.System);
  104. //this.signalTowerTrig.RST = true;
  105. //if (Singleton<EfemEntity>.Instance.IsOnlineMode)
  106. // Singleton<EfemEntity>.Instance.SendSigStatEvent(ModuleName.System);
  107. }
  108. public void Terminate()
  109. {
  110. }
  111. public void Reset()
  112. {
  113. }
  114. private void Subscriptions()
  115. {
  116. }
  117. }
  118. }