SetClampTask.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Sorter.Common;
  3. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace athosRT.Devices.EFEM.Task
  10. {
  11. public class SetClampTask : CheckImp, ITask
  12. {
  13. public SetClampTask() => this.HasInfoMessage = false;
  14. public bool Execute(out string result, params string[] args)
  15. {
  16. result = "NOFUNC";
  17. return false;
  18. }
  19. public bool? Monitor(out string result, params string[] args)
  20. {
  21. result = "";
  22. if (!args[0].StartsWith("ARM"))
  23. return new bool?(true);
  24. string name = "Robot";
  25. Hand arm = Hand.Blade2;
  26. if (!this.ParseMoveArm(args[0], out arm) || arm == Hand.Both)
  27. {
  28. result = "PARAM_NG";
  29. return new bool?(false);
  30. }
  31. RobotBaseDevice device = DEVICE.GetDevice<RobotBaseDevice>(name);
  32. if (device.IsError)
  33. return new bool?(false);
  34. return !device.IsBusy ? new bool?(true) : new bool?();
  35. }
  36. }
  37. }