PlaceTask.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 PlaceTask : 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. result = "PARAM_NG";
  36. return false;
  37. }
  38. if (ModuleHelper.IsLoadLock(target) && !SC.GetValue<bool>("System.IsLoadLockEnableZMotion"))
  39. {
  40. EV.PostWarningLog("Server", string.Format("not support LL z motion, can not LOAD {0}", (object)target));
  41. result = "PARAM_NG";
  42. return false;
  43. }
  44. if (!this.MultiWaferSize)
  45. ;
  46. 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))
  47. return false;
  48. if (!this.Check<BusyPolicy>(str, out result))
  49. {
  50. LogObject.Warning("PlaceTask ","Busy");
  51. return false;
  52. }
  53. 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<NoWaferMappingCompletedPolicy>(target.ToString(), out result) || !this.Check<NoPodPolicy>(target.ToString(), out result) || !this.Check<ClosePolicy>(target.ToString(), out result) || ModuleHelper.IsLoadPort(target) && !this.Check<ErrorPolicy>(target.ToString(), out result))
  54. return false;
  55. if (!ModuleHelper.IsLoadLock(target) && !Singleton<WaferManager>.Instance.CheckNoWafer(target, slot - 1))
  56. {
  57. result = "WAFER";
  58. return false;
  59. }
  60. switch (arm)
  61. {
  62. case Hand.Blade1:
  63. if (!Singleton<WaferManager>.Instance.CheckHasWafer(ModuleName.Robot, 0))
  64. {
  65. result = "NONWAF";
  66. return false;
  67. }
  68. break;
  69. case Hand.Blade2:
  70. if (!Singleton<WaferManager>.Instance.CheckHasWafer(ModuleName.Robot, 1))
  71. {
  72. result = "NONWAF";
  73. return false;
  74. }
  75. break;
  76. default:
  77. if (!Singleton<WaferManager>.Instance.CheckHasWafer(ModuleName.Robot, 0))
  78. {
  79. result = "NONWAF";
  80. return false;
  81. }
  82. if (!Singleton<WaferManager>.Instance.CheckHasWafer(ModuleName.Robot, 1))
  83. {
  84. result = "NONWAF";
  85. return false;
  86. }
  87. break;
  88. }
  89. if (!this.Check<PowerDownPolicy>(str, out result))
  90. return false;
  91. if (!Singleton<RouteManager1>.Instance.IsIdle)
  92. {
  93. LogObject.Warning("PlaceTask", "PlaceTask RouteManager is Busy");
  94. result = "BUSY";
  95. return false;
  96. }
  97. this._token = Singleton<RouteManager1>.Instance.Invoke("Place", new object[3]
  98. {
  99. (object) target.ToString(),
  100. (object) (slot - 1),
  101. (object) arm
  102. });
  103. return true;
  104. }
  105. public bool? Monitor(out string result, params string[] args)
  106. {
  107. result = string.Empty;
  108. RobotBaseDevice device = DEVICE.GetDevice<RobotBaseDevice>("Robot");
  109. if (device.IsError)
  110. {
  111. 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;
  112. 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;
  113. 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;
  114. return this.CheckError("Robot", out result);
  115. }
  116. return Singleton<RouteManager1>.Instance.IsIdle && device.IsReady() && Singleton<RouteManager1>.Instance.CheckAcked(this._token) ? new bool?(true) : new bool?();
  117. }
  118. }
  119. }