HomeTask.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using athosRT.Devices.EFEM.ABS;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace athosRT.Devices.EFEM.Task
  8. {
  9. public class HomeTask : CheckImp, ITask
  10. {
  11. public bool Execute(out string result, params string[] args)
  12. {
  13. result = string.Empty;
  14. string str = Args2Unit(args.Length != 0 ? args[0] : string.Empty);
  15. if (string.IsNullOrEmpty(str))
  16. {
  17. result = "PARAM_NG";
  18. return false;
  19. }
  20. IServerModule entity = GetEntity(str);
  21. int num;
  22. switch (entity)
  23. {
  24. case null:
  25. num = 1;
  26. break;
  27. case RobotServerModule _:
  28. case LoadPortServerModule _:
  29. num = 0;
  30. break;
  31. default:
  32. num = !(entity is BufferServerModule) ? 1 : 0;
  33. break;
  34. }
  35. if (num != 0)
  36. {
  37. result = "PARAM_NG";
  38. return false;
  39. }
  40. if (!Check<NoReadyPolicy>(str, out result) || !Check<NoInitCompletedPolicy>(str, out result) || !Check<NoOriginCompletedPolicy>(str, out result) || !Check<VacPolicy>(str, out result) || !Check<AirPolicy>(str, out result) || !Check<EMSPolicy>(str, out result) || !Check<ErrorPolicy>(str, out result) || !Check<InitBusyPolicy>(str, out result) || !Check<HoldPolicy>(str, out result) || !Check<MaintenancePolicy>(str, out result) || !Check<LinkPolicy>(str, out result) || !Check<ArmExtendPolicy>(str, out result) || !Check<PowerDownPolicy>(str, out result))
  41. return false;
  42. entity.Initialized = false;
  43. return entity.Home(out result);
  44. }
  45. public bool? Monitor(out string result, params string[] args)
  46. {
  47. result = string.Empty;
  48. string str = Args2Unit(args.Length != 0 ? args[0] : string.Empty);
  49. IServerModule entity = GetEntity(str);
  50. if (entity.Error)
  51. {
  52. 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;
  53. 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;
  54. 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;
  55. return new bool?(this.CheckError(str, out result));
  56. }
  57. if (entity.Busy)
  58. return new bool?();
  59. entity.Initialized = true;
  60. return new bool?(true);
  61. }
  62. }
  63. }