LiftTask.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using Aitex.Core.Common;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.Device.Unit;
  4. using athosRT.Devices.EFEM.ABS;
  5. using athosRT.tool;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace athosRT.Devices.EFEM.Task
  12. {
  13. public class LiftTask : CheckImp, ITask
  14. {
  15. public bool Execute(out string result, params string[] args)
  16. {
  17. string str1 = this.Args2Unit(args.Length != 0 ? args[0] : string.Empty);
  18. BufferServerModule entity = (BufferServerModule)this.GetEntity(str1);
  19. if (entity == null)
  20. {
  21. result = "PARAM_NG";
  22. return false;
  23. }
  24. string str2 = args[1];
  25. if (str2 != "UP" && str2 != "DOWN")
  26. {
  27. LogObject.Warning("LiftTask", "Lift command parameter 1 must be 'UP|DOWN'");
  28. result = "PARAM_NG";
  29. return false;
  30. }
  31. if (!this.Check<NoReadyPolicy>(str1, out result) || !this.Check<NoInitCompletedPolicy>(str1, out result) || !this.Check<NoOriginCompletedPolicy>(str1, out result) || !this.Check<VacPolicy>(str1, out result) || !this.Check<EMSPolicy>(str1, out result) || !this.Check<ErrorPolicy>(str1, out result) || !this.Check<BusyPolicy>(str1, out result) || !this.Check<HoldPolicy>(str1, out result) || !this.Check<RemovePolicy>(str1, out result) || !this.Check<MaintenancePolicy>(str1, out result) || !this.Check<LinkPolicy>(str1, out result) || !this.Check<ArmExtendPolicy>(str1, out result) || !this.Check<PowerDownPolicy>(str1, out result))
  32. return false;
  33. if (str2 == "UP")
  34. entity.LiftUp(out result);
  35. else
  36. entity.LiftDown(WaferSize.WS0, out result);
  37. return true;
  38. }
  39. public bool? Monitor(out string result, params string[] args)
  40. {
  41. result = string.Empty;
  42. string str = this.Args2Unit(args.Length != 0 ? args[0] : string.Empty);
  43. IoCoolingBuffer device = DEVICE.GetDevice<IoCoolingBuffer>(str);
  44. if (device.Error)
  45. {
  46. this.flag1 = ErrorCheckList1.VAC | ErrorCheckList1.STALL | ErrorCheckList1.LIMIT | ErrorCheckList1.POSITION | ErrorCheckList1.EMS | ErrorCheckList1.COMM | ErrorCheckList1.COMM2 | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF;
  47. this.flag2 = ErrorCheckList2.COMMAND | ErrorCheckList2.CLAMP_S;
  48. this.flag3 = ErrorCheckList3.WAFLOST | ErrorCheckList3.ALIGNNG | ErrorCheckList3.HARDWARE | ErrorCheckList3.INTERNAL;
  49. return new bool?(this.CheckError(str, out result));
  50. }
  51. return !device.Busy ? new bool?(true) : new bool?();
  52. }
  53. }
  54. }