FutureEfemBase.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. using System;
  2. using System.Xml;
  3. using Aitex.Core.Common;
  4. using Aitex.Core.RT.DataCenter;
  5. using Aitex.Core.RT.Event;
  6. using Aitex.Core.RT.OperationCenter;
  7. using Aitex.Core.RT.Routine;
  8. using Aitex.Core.RT.SCCore;
  9. using Aitex.Sorter.Common;
  10. using MECF.Framework.Common.Equipment;
  11. using MECF.Framework.Common.Event;
  12. using MECF.Framework.Common.SubstrateTrackings;
  13. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Efems.Rorzes;
  14. namespace JetEfemLib
  15. {
  16. public class FutureEfemBase : RorzeEfem
  17. {
  18. public AlarmEventItem VacuumSourcePressureAlarm { get; set; }
  19. public AlarmEventItem CompressedAirPressureAlarm { get; set; }
  20. public AlarmEventItem FlowGaugeWarning { get; set; }
  21. public AlarmEventItem WaterLeakWarning { get; set; }
  22. public AlarmEventItem DrivePowerAlarm { get; set; }
  23. public AlarmEventItem DifferentialPressureSensorSetting1Alarm { get; set; }
  24. public AlarmEventItem DifferentialPressureSensorSetting2Alarm { get; set; }
  25. public AlarmEventItem IonizerAlarm { get; set; }
  26. public AlarmEventItem FfuAlarm { get; set; }
  27. public AlarmEventItem AirErrorForRobot { get; set; }
  28. //public AlarmEventItem AirErrorForChamber { get; set; }
  29. public AlarmEventItem IsMaintain { get; set; }
  30. public AlarmEventItem DoorOpen { get; set; }
  31. public AlarmEventItem EmoAlarm { get; set; }
  32. protected bool _stateVacuumSourcePressureAlarm;
  33. protected bool _stateCompressedAirPressureAlarm;
  34. protected bool _stateFlowGaugeWarning;
  35. protected bool _stateWaterLeakWarning;
  36. protected bool _stateDrivePowerAlarm;
  37. protected bool _stateDifferentialPressureSensorSetting1Alarm;
  38. protected bool _stateDifferentialPressureSensorSetting2Alarm;
  39. protected bool _stateIonizerAlarm;
  40. protected bool _stateFfuAlarm;
  41. protected bool _stateAirErrorForRobot;
  42. protected bool _stateIsMaintain;
  43. protected bool _stateDoorOpen;
  44. protected bool _stateEmoAlarm;
  45. public FutureEfemBase(string module, XmlElement node, string ioModule = "") : base("System", "EFEM", "")
  46. {
  47. }
  48. public FutureEfemBase(string system, string efemName) : base(system, efemName, "")
  49. {
  50. }
  51. public FutureEfemBase() : base("System", "EFEM", "")
  52. {
  53. }
  54. public override bool Initialize()
  55. {
  56. VacuumSourcePressureAlarm = SubscribeAlarm($"{Module}.{Name}.VacuumSourcePressureAlarm", "EFEM Vacuum Source Pressure Alarm", () => !_stateFfuAlarm, EventLevel.Alarm);
  57. CompressedAirPressureAlarm = SubscribeAlarm($"{Module}.{Name}.CompressedAirPressureAlarm", "EFEM Compressed Air Pressure Alarm", () => !_stateFfuAlarm, EventLevel.Alarm);
  58. FlowGaugeWarning = SubscribeAlarm($"{Module}.{Name}.FlowGaugeWarning", "EFEM Flow Gauge Warning", () => !_stateFfuAlarm, EventLevel.Alarm);
  59. WaterLeakWarning = SubscribeAlarm($"{Module}.{Name}.WaterLeakWarning", "EFEM Water Leak Warning", () => !_stateFfuAlarm, EventLevel.Alarm);
  60. DrivePowerAlarm = SubscribeAlarm($"{Module}.{Name}.DrivePowerAlarm", "EFEM Drive Power Alarm", () => !_stateFfuAlarm, EventLevel.Alarm);
  61. DifferentialPressureSensorSetting1Alarm = SubscribeAlarm($"{Module}.{Name}.DifferentialPressureSensorSetting1Alarm", "EFEM Differential Pressure Sensor Setting1 Alarm", () => !_stateFfuAlarm, EventLevel.Alarm);
  62. DifferentialPressureSensorSetting2Alarm = SubscribeAlarm($"{Module}.{Name}.DifferentialPressureSensorSetting2Alarm", "EFEM Differential Pressure Sensor Setting2 Alarm", () => !_stateFfuAlarm, EventLevel.Alarm);
  63. FfuAlarm = SubscribeAlarm($"{Module}.{Name}.FFUAlarm", "EFEM FFU Error", () => !_stateFfuAlarm, EventLevel.Warning);
  64. IonizerAlarm = SubscribeAlarm($"{Module}.{Name}.IonizerAlarm", "EFEM Ionizer Error", () => !_stateIonizerAlarm, EventLevel.Warning);
  65. AirErrorForRobot = SubscribeAlarm($"{Module}.{Name}.AirErrorForRobot", "EFEM Robot Air Error", () => !_stateAirErrorForRobot, EventLevel.Warning);
  66. //AirErrorForChamber = SubscribeAlarm($"{Module}.{Name}.AirErrorForChamber", "EFEM Chamber Air Error", () => !_stateAirErrorForChamber, EventLevel.Warning);
  67. IsMaintain = SubscribeAlarm($"{Module}.{Name}.IsMaintain", "EFEM in Maintenance Mode, switch to online and turn key to auto", () => !_stateIsMaintain, EventLevel.Alarm);
  68. DoorOpen = SubscribeAlarm($"{Module}.{Name}.DoorOpen", "EFEM door open", () => !_stateDoorOpen, EventLevel.Warning);
  69. EmoAlarm = SubscribeAlarm($"{Module}.{Name}.EmoAlarm", "EFEM EMO error", () => !_stateEmoAlarm, EventLevel.Alarm);
  70. //EfemVacuumSourcePressureAlarm = SubscribeAlarm($"{Module}.{Name}.EfemVacuumSourcePressureAlarm", "Efem Vacuum Source Pressure Alarm", () => !_stateEfemVacuumSourcePressureAlarm, EventLevel.Alarm);
  71. //EfemCompressedAirPressureAlarm = SubscribeAlarm($"{Module}.{Name}.EfemCompressedAirPressureAlarm", "Efem Compressed Air Pressure Alarm", () => !_stateEfemCompressedAirPressureAlarm, EventLevel.Alarm);
  72. DATA.Subscribe($"{Module}.{Name}.VacuumSourcePressureAlarm", () => _stateVacuumSourcePressureAlarm);
  73. DATA.Subscribe($"{Module}.{Name}.CompressedAirPressureAlarm", () => _stateCompressedAirPressureAlarm);
  74. DATA.Subscribe($"{Module}.{Name}.FlowGaugeWarning", () => _stateFlowGaugeWarning);
  75. DATA.Subscribe($"{Module}.{Name}.WaterLeakWarning", () => _stateWaterLeakWarning);
  76. DATA.Subscribe($"{Module}.{Name}.DrivePowerAlarm", () => _stateDrivePowerAlarm);
  77. DATA.Subscribe($"{Module}.{Name}.DifferentialPressureSensorSetting1Alarm", () => _stateDifferentialPressureSensorSetting1Alarm);
  78. DATA.Subscribe($"{Module}.{Name}.DifferentialPressureSensorSetting2Alarm", () => _stateDifferentialPressureSensorSetting2Alarm);
  79. DATA.Subscribe($"{Module}.{Name}.FFUAlarm", () => _stateFfuAlarm);
  80. DATA.Subscribe($"{Module}.{Name}.IonizerAlarm", () => _stateIonizerAlarm);
  81. DATA.Subscribe($"{Module}.{Name}.AirErrorForRobot", () => _stateAirErrorForRobot);
  82. //DATA.Subscribe($"{Module}.{Name}.AirErrorForChamber", () => _stateAirErrorForChamber);
  83. DATA.Subscribe($"{Module}.{Name}.IsMaintain", () => _stateIsMaintain);
  84. DATA.Subscribe($"{Module}.{Name}.DoorOpen", () => _stateDoorOpen);
  85. DATA.Subscribe($"{Module}.{Name}.EmoAlarm", () => _stateEmoAlarm);
  86. OP.Subscribe("System.SetWaferSize", (string cmd, object[] args) =>
  87. {
  88. string module = (string)args[0];
  89. int slot = (int)args[1];
  90. string size = (string)args[2];
  91. switch (size)
  92. {
  93. case "4":
  94. WaferManager.Instance.UpdateWaferSize(ModuleHelper.Converter(module), slot, WaferSize.WS4);
  95. break;
  96. case "6":
  97. WaferManager.Instance.UpdateWaferSize(ModuleHelper.Converter(module), slot, WaferSize.WS6);
  98. break;
  99. case "8":
  100. WaferManager.Instance.UpdateWaferSize(ModuleHelper.Converter(module), slot, WaferSize.WS8);
  101. break;
  102. case "12":
  103. WaferManager.Instance.UpdateWaferSize(ModuleHelper.Converter(module), slot, WaferSize.WS12);
  104. break;
  105. default:
  106. EV.PostWarningLog("System", $"wafer size {size} not valid");
  107. break;
  108. }
  109. return true;
  110. });
  111. return base.Initialize();
  112. }
  113. public override void NoteStateEvent(ModuleName module, string data1, string data2)
  114. {
  115. base.NoteStateEvent(module, data1, data2);
  116. }
  117. public override void NoteWaferTrack(string waferInfo)
  118. {
  119. if (waferInfo[0] == '1' && !WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, 1))
  120. {
  121. WaferManager.Instance.CreateWafer(ModuleName.EfemRobot, 1, WaferStatus.Normal);
  122. }
  123. else if (waferInfo[0] == '0' && !WaferManager.Instance.CheckNoWafer(ModuleName.EfemRobot, 1))
  124. {
  125. WaferManager.Instance.DeleteWafer(ModuleName.EfemRobot, 1);
  126. }
  127. if (waferInfo[1] == '1' && !WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, 0))
  128. {
  129. WaferManager.Instance.CreateWafer(ModuleName.EfemRobot, 0, WaferStatus.Normal);
  130. }
  131. else if (waferInfo[1] == '0' && !WaferManager.Instance.CheckNoWafer(ModuleName.EfemRobot, 0))
  132. {
  133. WaferManager.Instance.DeleteWafer(ModuleName.EfemRobot, 0);
  134. }
  135. if (waferInfo[2] == '1' && !WaferManager.Instance.CheckHasWafer(ModuleName.Aligner, 0))
  136. {
  137. WaferManager.Instance.CreateWafer(ModuleName.Aligner, 0, WaferStatus.Normal);
  138. }
  139. else if (waferInfo[2] == '0' && !WaferManager.Instance.CheckNoWafer(ModuleName.Aligner, 0))
  140. {
  141. WaferManager.Instance.DeleteWafer(ModuleName.Aligner, 0);
  142. }
  143. }
  144. public override void Monitor()
  145. {
  146. base.Monitor();
  147. }
  148. public override void Reset()
  149. {
  150. FfuAlarm.Reset();
  151. IonizerAlarm.Reset();
  152. AirErrorForRobot.Reset();
  153. //AirErrorForChamber.Reset();
  154. IsMaintain.Reset();
  155. DoorOpen.Reset();
  156. EmoAlarm.Reset();
  157. base.Reset();
  158. }
  159. public void ResetData()
  160. {
  161. Reset();
  162. }
  163. public bool MapCarrier(string lp, int thicknessIndex, out string slotMap, out string reason)
  164. {
  165. slotMap = string.Empty;
  166. if (!Connection.IsConnected)
  167. {
  168. reason = "not connected";
  169. return false;
  170. }
  171. return Connection.Execute(new RorzeEfemHandlerWafsh(this, ModuleHelper.Converter(lp), true, thicknessIndex), out reason);
  172. }
  173. public override bool GetWafer(ModuleName chamber, int slot, Hand hand, out string reason)
  174. {
  175. if (Connection == null || !Connection.IsConnected || !IsInitialized)
  176. {
  177. reason = "not connected";
  178. return false;
  179. }
  180. WaferSize ws = WaferManager.Instance.GetWaferSize(chamber, slot);
  181. int smallSize = SC.GetValue<int>("System.SmallWafer");
  182. int midSize = SC.GetValue<int>("System.MidWafer");
  183. int bigSize = SC.GetValue<int>("System.BigWafer");
  184. if (ws == (WaferSize)smallSize)
  185. {
  186. ws = WaferSize.WS3;
  187. }
  188. else if (ws == (WaferSize)midSize)
  189. {
  190. ws = WaferSize.WS4;
  191. }
  192. else if (ws == (WaferSize)bigSize)
  193. {
  194. ws = WaferSize.WS6;
  195. }
  196. return Connection.Execute(new RorzeEfemHandlerLoad(this, chamber, slot, hand, ws), out reason);
  197. }
  198. public override bool PutWafer(ModuleName chamber, int slot, Hand hand, out string reason)
  199. {
  200. if (Connection == null || !Connection.IsConnected || !IsInitialized)
  201. {
  202. reason = "not connected";
  203. return false;
  204. }
  205. WaferSize ws = WaferManager.Instance.GetWaferSize(ModuleName.EfemRobot, (int)hand);
  206. int smallSize = SC.GetValue<int>("System.SmallWafer");
  207. int midSize = SC.GetValue<int>("System.MidWafer");
  208. int bigSize = SC.GetValue<int>("System.BigWafer");
  209. if (ws == (WaferSize)smallSize)
  210. {
  211. ws = WaferSize.WS3;
  212. }
  213. else if (ws == (WaferSize)midSize)
  214. {
  215. ws = WaferSize.WS4;
  216. }
  217. else if (ws == (WaferSize)bigSize)
  218. {
  219. ws = WaferSize.WS6;
  220. }
  221. return Connection.Execute(new RorzeEfemHandlerUnload(this, chamber, slot, hand, ws), out reason);
  222. }
  223. }
  224. }