SetModeTask.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Sorter.Common;
  3. using athosRT.Devices.EFEM.ABS;
  4. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace athosRT.Devices.EFEM.Task
  11. {
  12. public class SetModeTask : CheckImp, ITask
  13. {
  14. public bool Execute(out string result, params string[] args)
  15. {
  16. string str = this.Args2Unit(args.Length != 0 ? args[0] : string.Empty);
  17. IServerModule entity = this.GetEntity(str);
  18. if (entity == null || !(entity is LoadPortServerModule))
  19. {
  20. result = "PARAM_NG";
  21. return false;
  22. }
  23. return this.Check<NoReadyPolicy>(str, out result) && this.Check<NoInitCompletedPolicy>(str, out result) && this.Check<NoOriginCompletedPolicy>(str, out result) && this.Check<ErrorPolicy>(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<ArmExtendPolicy>(str, out result) && this.Check<NoPosPolicy>(str, out result) && this.Check<NoPodPolicy>(str, out result) && this.Check<NoFuncPolicy>(str, out result);
  24. }
  25. public bool? Monitor(out string result, params string[] args)
  26. {
  27. result = string.Empty;
  28. LoadPortBaseDevice device = DEVICE.GetDevice<LoadPortBaseDevice>(this.Args2Unit(args.Length != 0 ? args[0] : string.Empty));
  29. if (device.IsError)
  30. return new bool?(false);
  31. return !device.IsBusy && device.ClampState == FoupClampState.Close ? new bool?(true) : new bool?();
  32. }
  33. }
  34. }