SetTansferTask.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.RT.Device.Unit;
  3. using Aitex.Core.Util;
  4. using Aitex.Sorter.Common;
  5. using athosRT.Devices.EFEM.ABS;
  6. using athosRT.Modules.EFEMs;
  7. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. namespace athosRT.Devices.EFEM.Task
  14. {
  15. public class SetTransferTask : CheckImp, ITask
  16. {
  17. public bool Execute(out string result, params string[] args)
  18. {
  19. string str = this.Args2Unit(args.Length != 0 ? args[0] : string.Empty);
  20. IServerModule entity = this.GetEntity(str);
  21. if (entity == null || entity is LoadPortServerModule)
  22. {
  23. result = "PARAM_NG";
  24. return false;
  25. }
  26. if (!this.Check<NoReadyPolicy>(str, out result) || !this.Check<BusyPolicy>(str, out result) || !this.Check<RemovePolicy>(str, out result) || !this.Check<MaintenancePolicy>(str, out result) || !this.Check<LinkPolicy>(str, out result) || !this.Check<NoFuncPolicy>(str, out result))
  27. return false;
  28. E84Passiver device = DEVICE.GetDevice<E84Passiver>(Singleton<EfemEntity>.Instance.GetE84LpName(str.ToString()));
  29. if (device == null)
  30. return false;
  31. return bool.Parse(args[0]) ? device.SetAMHS(out result) : device.SetManual(out result);
  32. }
  33. public bool? Monitor(out string result, params string[] args)
  34. {
  35. result = string.Empty;
  36. string str = this.Args2Unit(args.Length != 0 ? args[0] : string.Empty);
  37. LoadPortBaseDevice device = DEVICE.GetDevice<LoadPortBaseDevice>(str);
  38. if (device.IsError)
  39. {
  40. this.flag3 = ErrorCheckList3.INTERNAL;
  41. return new bool?(this.CheckError(str, out result));
  42. }
  43. return !device.IsBusy && device.ClampState == FoupClampState.Close ? new bool?(true) : new bool?();
  44. }
  45. }
  46. }