TransferTask.cs 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. using Aitex.Core.Common;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.SCCore;
  4. using Aitex.Core.Util;
  5. using Aitex.Sorter.Common;
  6. using athosRT.Devices.EFEM.ABS;
  7. using athosRT.FSM;
  8. using athosRT.Modules;
  9. using MECF.Framework.Common.Equipment;
  10. using MECF.Framework.Common.SubstrateTrackings;
  11. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
  12. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase;
  13. using System;
  14. using System.Collections.Generic;
  15. using System.Linq;
  16. using System.Text;
  17. using System.Threading.Tasks;
  18. using EV = athosRT.tool.EV;
  19. namespace athosRT.Devices.EFEM.Task
  20. {
  21. public class TransferTask : CheckImp, ITask
  22. {
  23. public bool Execute(out string result, params string[] args)
  24. {
  25. string str = "Robot";
  26. this.GetEntity(str);
  27. ModuleName target1 = ModuleName.System;
  28. int slot1 = 1;
  29. if (!this.ParseMoveTarget(args[0], out target1, out slot1))
  30. {
  31. result = "PARAM_NG";
  32. return false;
  33. }
  34. Hand arm1 = Hand.Blade2;
  35. if (!this.ParseMoveArm(args[1], out arm1))
  36. {
  37. result = "PARAM_NG";
  38. return false;
  39. }
  40. Hand arm2 = Hand.Blade2;
  41. if (!this.ParseMoveArm(args[2], out arm2))
  42. {
  43. result = "PARAM_NG";
  44. return false;
  45. }
  46. ModuleName target2 = ModuleName.System;
  47. int slot2 = 1;
  48. if (!this.ParseMoveTarget(args[3], out target2, out slot2))
  49. {
  50. result = "PARAM_NG";
  51. return false;
  52. }
  53. if (ModuleHelper.IsLoadPort(target2))
  54. {
  55. OpenStageWithWaferSizeLoadPort device = DEVICE.GetDevice<OpenStageWithWaferSizeLoadPort>(target2.ToString());
  56. if (slot2 == 1 && device.WaferSize == WaferSize.WS3)
  57. {
  58. EV.PostWarningLog("EFEM", string.Format("{0} is 3', slot 1 is disabled", (object)target2));
  59. result = "PARAM_NG";
  60. return false;
  61. }
  62. }
  63. if (ModuleHelper.IsLoadPort(target1))
  64. {
  65. OpenStageWithWaferSizeLoadPort device = DEVICE.GetDevice<OpenStageWithWaferSizeLoadPort>(target1.ToString());
  66. if (slot1 == 1 && device.WaferSize == WaferSize.WS3)
  67. {
  68. EV.PostWarningLog("EFEM", string.Format("{0} is 3', slot 1 is disabled", (object)target1));
  69. result = "PARAM_NG";
  70. return false;
  71. }
  72. }
  73. if (ModuleHelper.IsLoadLock(target1) && !SC.GetValue<bool>("System.IsLoadLockEnableZMotion"))
  74. {
  75. EV.PostWarningLog("Server", string.Format("not support LL z motion, can not TRANS {0}", (object)target1));
  76. result = "PARAM_NG";
  77. return false;
  78. }
  79. if (ModuleHelper.IsLoadLock(target2) && !SC.GetValue<bool>("System.IsLoadLockEnableZMotion"))
  80. {
  81. EV.PostWarningLog("Server", string.Format("not support LL z motion, can not TRANS {0}", (object)target2));
  82. result = "PARAM_NG";
  83. return false;
  84. }
  85. if (!this.Check<NoReadyPolicy>(str, out result) || !this.Check<NoInitCompletedPolicy>(str, out result) || !this.Check<NoOriginCompletedPolicy>(str, out result) || !this.Check<VacPolicy>(str, out result) || !this.Check<EMSPolicy>(str, out result) || !this.Check<ErrorPolicy>(str, out result) || ModuleHelper.IsLoadPort(target1) && !this.Check<NoWaferMappingCompletedPolicy>(target1.ToString(), out result) || ModuleHelper.IsLoadPort(target2) && !this.Check<NoWaferMappingCompletedPolicy>(target2.ToString(), out result))
  86. return false;
  87. if (!ModuleHelper.IsLoadLock(target2) && !Singleton<WaferManager>.Instance.CheckNoWafer(target2, slot2 - 1))
  88. {
  89. result = "WAFER";
  90. return false;
  91. }
  92. if (!ModuleHelper.IsLoadLock(target1) && !Singleton<WaferManager>.Instance.CheckHasWafer(target1, slot1 - 1))
  93. {
  94. result = "NONWAF";
  95. return false;
  96. }
  97. if (!this.Check<BusyPolicy>(str, out result) || !this.Check<HoldPolicy>(str, out result) || !this.Check<RemovePolicy>(str, out result) || !this.Check<MaintenancePolicy>(str, out result) || !this.Check<LinkPolicy>(str, out result) || !this.Check<PowerDownPolicy>(str, out result) || !this.Check<NoWaferMappingCompletedPolicy>(target1.ToString(), out result) || !this.Check<NoWaferMappingCompletedPolicy>(target2.ToString(), out result) || !this.Check<NoPodPolicy>(target1.ToString(), out result) || !this.Check<NoPodPolicy>(target2.ToString(), out result) || !this.Check<ClosePolicy>(target1.ToString(), out result) || !this.Check<ClosePolicy>(target2.ToString(), out result))
  98. return false;
  99. Singleton<RouteManager1>.Instance.InvokeMoveWafer("MoveWafer", new object[7]
  100. {
  101. (object) MoveType.Move,
  102. (object) MoveOption.None,
  103. (object) arm2,
  104. (object) target1,
  105. (object) (slot1 - 1),
  106. (object) target2,
  107. (object) (slot2 - 1)
  108. });
  109. return true;
  110. }
  111. public bool? Monitor(out string result, params string[] args)
  112. {
  113. result = string.Empty;
  114. RobotBaseDevice device = DEVICE.GetDevice<RobotBaseDevice>("Robot");
  115. if (Singleton<RouteManager1>.Instance.GetTaskState("MoveWafer") == RState.Failed)
  116. {
  117. result = "MoveFailed";
  118. return new bool?(false);
  119. }
  120. if (device.IsError)
  121. {
  122. this.flag1 = ErrorCheckList1.VAC | ErrorCheckList1.AIR | ErrorCheckList1.STALL | ErrorCheckList1.LIMIT | ErrorCheckList1.SENSOR | ErrorCheckList1.POSITION | ErrorCheckList1.EMS | ErrorCheckList1.COMM | ErrorCheckList1.COMM2 | ErrorCheckList1.VACON | ErrorCheckList1.VACOFF | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF;
  123. this.flag2 = ErrorCheckList2.RRTWAF | ErrorCheckList2.CRSWAF | ErrorCheckList2.THICKWAF | ErrorCheckList2.THINWAF | ErrorCheckList2.DBLWAF | ErrorCheckList2.BAOWAF | ErrorCheckList2.COMMAND | ErrorCheckList2.PODNG | ErrorCheckList2.PODMISMATCH | ErrorCheckList2.VAC_S | ErrorCheckList2.CLAMP_S | ErrorCheckList2.SAFTY | ErrorCheckList2.LOCKNG | ErrorCheckList2.UNLOCKNG | ErrorCheckList2.L_KEY_LK | ErrorCheckList2.L_KEY_UL;
  124. this.flag3 = ErrorCheckList3.MAP_S | ErrorCheckList3.MAP_S1 | ErrorCheckList3.MAP_S2 | ErrorCheckList3.WAFLOST | ErrorCheckList3.ALIGNNG | ErrorCheckList3.DRIVER | ErrorCheckList3.DRPOWERDOWN | ErrorCheckList3.HARDWARE | ErrorCheckList3.INTERNAL | ErrorCheckList3.E84_TIMEOUTx | ErrorCheckList3.E84_CS_VALID | ErrorCheckList3.READFAIL;
  125. return new bool?(CheckError("Robot", out result));
  126. }
  127. return Singleton<RouteManager1>.Instance.Running && !Singleton<RouteManager1>.Instance.IsRunning ? new bool?(true) : new bool?();
  128. }
  129. }
  130. }