SigStatTask.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.Util;
  3. using Aitex.Sorter.Common;
  4. using Efem;
  5. using System.Threading;
  6. namespace EFEM.RT.Tasks
  7. {
  8. public class SigStatTask : CheckImp, ITask
  9. {
  10. public SigStatTask()
  11. {
  12. }
  13. public bool Execute(out string result, params string[] args)
  14. {
  15. string device = Args2Unit(args.Length > 0 ? args[0] : string.Empty);
  16. if (device == null)
  17. {
  18. result = PARAM_NG;
  19. return false;
  20. }
  21. if (!CheckIsPort(device) && device != DeviceName.System)
  22. {
  23. result = PARAM_NG;
  24. return false;
  25. }
  26. if (!Check<NoReadyPolicy>(device, out result))
  27. {
  28. return false;
  29. }
  30. if (!Check<MaintenancePolicy>(device, out result))
  31. {
  32. return false;
  33. }
  34. if (!Check<RemovePolicy>(device, out result))
  35. {
  36. return false;
  37. }
  38. return true;
  39. }
  40. public bool? Monitor(out string result, params string[] args)
  41. {
  42. result = string.Empty;
  43. string device = Args2Unit(args.Length > 0 ? args[0] : string.Empty);
  44. if (args.Length > 0)
  45. {
  46. var data1 = Singleton<EfemEntity>.Instance.GetSigStatData1(device);
  47. result = data1.ToString("X8");
  48. var data2 = Singleton<EfemEntity>.Instance.GetSigStatData2(device);
  49. result += "/" + data2.ToString("X8");
  50. }
  51. return true;
  52. }
  53. }
  54. }