PickTask.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.RT.SCCore;
  3. using Aitex.Core.Util;
  4. using Aitex.Sorter.Common;
  5. using athosRT.Devices.EFEM.ABS;
  6. using athosRT.Modules;
  7. using athosRT.tool;
  8. using MECF.Framework.Common.Equipment;
  9. using MECF.Framework.Common.SubstrateTrackings;
  10. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase;
  11. using System;
  12. using System.Collections.Generic;
  13. using System.Linq;
  14. using System.Text;
  15. using System.Threading.Tasks;
  16. using EV = athosRT.tool.EV;
  17. namespace athosRT.Devices.EFEM.Task
  18. {
  19. public class PickTask : CheckImp, ITask
  20. {
  21. public bool Execute(out string result, params string[] args)
  22. {
  23. string str = "Robot";
  24. this.GetEntity(str);
  25. ModuleName target = ModuleName.System;
  26. int slot = 1;
  27. if (!this.ParseMoveTarget(args[0], out target, out slot))
  28. {
  29. result = "PARAM_NG";
  30. return false;
  31. }
  32. Hand arm = Hand.Blade2;
  33. if (!this.ParseMoveArm(args[1], out arm))
  34. {
  35. EV.PostWarningLog("Server", args[1] + " not valid arm parameter");
  36. result = "PARAM_NG";
  37. return false;
  38. }
  39. if (ModuleHelper.IsLoadLock(target) && !SC.GetValue<bool>("System.IsLoadLockEnableZMotion"))
  40. {
  41. EV.PostWarningLog("Server", string.Format("not support LL z motion, can not LOAD {0}", (object)target));
  42. result = "PARAM_NG";
  43. return false;
  44. }
  45. if (!this.MultiWaferSize)
  46. ;
  47. 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))
  48. return false;
  49. if (!this.Check<BusyPolicy>(str, out result))
  50. {
  51. LogObject.Warning("PickTask","PickTask " + str + " Busy");
  52. return false;
  53. }
  54. if (!this.Check<ClosePolicy>(str, out result) || !this.Check<NoWaferMappingCompletedPolicy>(str, out result) || !this.Check<NoPodPolicy>(str, out result))
  55. return false;
  56. if (!ModuleHelper.IsLoadLock(target) && !Singleton<WaferManager>.Instance.CheckHasWafer(target, slot - 1))
  57. {
  58. result = "NONWAF";
  59. return false;
  60. }
  61. if (ModuleHelper.IsLoadPort(target) && !this.Check<ErrorPolicy>(target.ToString(), out result))
  62. return false;
  63. switch (arm)
  64. {
  65. case Hand.Blade1:
  66. if (!Singleton<WaferManager>.Instance.CheckNoWafer(ModuleName.Robot, 0))
  67. {
  68. result = "WAFER";
  69. return false;
  70. }
  71. break;
  72. case Hand.Blade2:
  73. if (!Singleton<WaferManager>.Instance.CheckNoWafer(ModuleName.Robot, 1))
  74. {
  75. result = "WAFER";
  76. return false;
  77. }
  78. break;
  79. default:
  80. if (!Singleton<WaferManager>.Instance.CheckNoWafer(ModuleName.Robot, 0))
  81. {
  82. result = "WAFER";
  83. return false;
  84. }
  85. if (!Singleton<WaferManager>.Instance.CheckNoWafer(ModuleName.Robot, 1))
  86. {
  87. result = "WAFER";
  88. return false;
  89. }
  90. break;
  91. }
  92. if (!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))
  93. return false;
  94. if (!Singleton<RouteManager1>.Instance.IsIdle)
  95. {
  96. LogObject.Warning("PickTask", "PickTask RouteManager is Busy");
  97. result = "BUSY";
  98. return false;
  99. }
  100. this._token = Singleton<RouteManager1>.Instance.Invoke("Pick", new object[3]
  101. {
  102. (object) target.ToString(),
  103. (object) (slot - 1),
  104. (object) arm
  105. });
  106. return true;
  107. }
  108. public bool? Monitor(out string result, params string[] args)
  109. {
  110. result = string.Empty;
  111. RobotBaseDevice device = DEVICE.GetDevice<RobotBaseDevice>("Robot");
  112. if (device.IsError)
  113. {
  114. 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;
  115. 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;
  116. 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;
  117. return new bool?(this.CheckError("Robot", out result));
  118. }
  119. return Singleton<RouteManager1>.Instance.IsIdle && device.IsReady() && Singleton<RouteManager1>.Instance.CheckAcked(this._token) ? new bool?(true) : new bool?();
  120. }
  121. }
  122. }