ErrorTask.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. using System;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Sorter.Common;
  4. using Aitex.Sorter.RT.EFEMs.Servers;
  5. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
  6. namespace Aitex.Sorter.RT.EFEMs.Tasks
  7. {
  8. public class ClearErrorTask : CheckImp, ITask
  9. {
  10. public ClearErrorTask()
  11. {
  12. HasInfoMessage = false;
  13. }
  14. public bool Execute(out string result, params string[] args)
  15. {
  16. string device = DeviceName.System;
  17. EfemEventType type;
  18. if (!String.Equals(args[0], "CLEAR"))
  19. {
  20. result = PARAM_NG;
  21. return false;
  22. }
  23. if (!Check<NoReadyPolicy>(device, out result))
  24. {
  25. return false;
  26. }
  27. if (!Check<MaintenancePolicy>(device, out result))
  28. {
  29. return false;
  30. }
  31. SystemServerModule entity = (SystemServerModule)GetEntity(device);
  32. entity.ClearError();
  33. return true;
  34. }
  35. public bool? Monitor(out string result, params string[] args)
  36. {
  37. result = string.Empty;
  38. SystemServerModule entity = (SystemServerModule)GetEntity(DeviceName.System);
  39. string device = DeviceName.System;
  40. LoadPort _device = DEVICE.GetDevice<LoadPort>(device);
  41. if (_device!= null && _device.Error)
  42. {
  43. flag3 = ErrorCheckList3.HARDWARE
  44. | ErrorCheckList3.INTERNAL;
  45. return CheckError(device, out result);
  46. }
  47. if (_device==null || !_device.IsBusy)
  48. return true;
  49. return null;
  50. }
  51. }
  52. public class QueryErrorTask : CheckImp, ITask
  53. {
  54. public QueryErrorTask()
  55. {
  56. HasInfoMessage = true;
  57. }
  58. public bool Execute(out string result, params string[] args)
  59. {
  60. string device = DeviceName.System;
  61. if (!Check<NoReadyPolicy>(device, out result))
  62. {
  63. return false;
  64. }
  65. return true;
  66. }
  67. public bool? Monitor(out string result, params string[] args)
  68. {
  69. result = string.Empty;
  70. SystemServerModule entity = (SystemServerModule)GetEntity(DeviceName.System);
  71. //if (entity.Error)
  72. //{
  73. // flag1 = ErrorCheckList1.VAC | ErrorCheckList1.AIR | ErrorCheckList1.STALL
  74. // | ErrorCheckList1.LIMIT | ErrorCheckList1.SENSOR | ErrorCheckList1.POSITION | ErrorCheckList1.EMS
  75. // | ErrorCheckList1.COMM | ErrorCheckList1.COMM2 | ErrorCheckList1.VACON | ErrorCheckList1.VACOFF
  76. // | ErrorCheckList1.CLAMPON | ErrorCheckList1.CLAMPOF;
  77. // flag2 = ErrorCheckList2.RRTWAF | ErrorCheckList2.CRSWAF | ErrorCheckList2.THICKWAF | ErrorCheckList2.THINWAF
  78. // | ErrorCheckList2.DBLWAF | ErrorCheckList2.BAOWAF | ErrorCheckList2.COMMAND | ErrorCheckList2.PODNG
  79. // | ErrorCheckList2.PODMISMATCH | ErrorCheckList2.VAC_S | ErrorCheckList2.CLAMP_S | ErrorCheckList2.SAFTY
  80. // | ErrorCheckList2.LOCKNG | ErrorCheckList2.UNLOCKNG | ErrorCheckList2.L_KEY_LK | ErrorCheckList2.L_KEY_UL;
  81. // flag3 = ErrorCheckList3.MAP_S | ErrorCheckList3.MAP_S1 | ErrorCheckList3.MAP_S2 | ErrorCheckList3.WAFLOST
  82. // | ErrorCheckList3.ALIGNNG
  83. // | ErrorCheckList3.DRIVER | ErrorCheckList3.DRPOWERDOWN | ErrorCheckList3.HARDWARE
  84. // | ErrorCheckList3.INTERNAL | ErrorCheckList3.E84_TIMEOUTx | ErrorCheckList3.E84_CS_VALID | ErrorCheckList3.READFAIL;
  85. // return CheckError(device, out result);
  86. //}
  87. if (!entity.Error)
  88. {
  89. result = "NOTHING/";
  90. return true;
  91. }
  92. result = "INTERNAL/UNDEFINITION";
  93. return true;
  94. }
  95. }
  96. }