SETMEntity.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. using Aitex.Core.RT.Fsm;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Diagnostics;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using Venus_Core;
  9. using Venus_RT.Devices;
  10. namespace Venus_RT.Modules.TM.VenusEntity
  11. {
  12. public class SETMEntity : Entity, IModuleEntity
  13. {
  14. public enum STATE
  15. {
  16. Unknown,
  17. Init,
  18. Initializing,
  19. InitializingRB,
  20. Idle,
  21. Error,
  22. Pumping,
  23. Venting,
  24. Purging,
  25. Leakchecking,
  26. Picking,
  27. Placing,
  28. Swaping,
  29. PMPicking,
  30. PMPlacing,
  31. PMSwaping,
  32. Aligning,
  33. Mapping,
  34. Extending,
  35. Retracting,
  36. Swapping,
  37. Gotoing,
  38. ControllingPressure
  39. }
  40. public enum MSG
  41. {
  42. Home,
  43. RobotHome,
  44. Online,
  45. Offline,
  46. Pump,
  47. Vent,
  48. Purge,
  49. CyclePurge,
  50. LeakCheck,
  51. Pick,
  52. Place,
  53. Swap,
  54. DoublePick,
  55. DoublePlace,
  56. DoubleSwap,
  57. PMPick,
  58. PMPlace,
  59. PMSwap,
  60. Extend,
  61. Retract,
  62. TMCycle,
  63. ControlPressure,
  64. Error,
  65. Abort,
  66. AbortControlPressure
  67. }
  68. public bool IsIdle
  69. {
  70. get { return fsm.State == (int)STATE.Idle; }
  71. }
  72. public bool IsError
  73. {
  74. get { return fsm.State == (int)STATE.Error; }
  75. }
  76. public bool IsInit
  77. {
  78. get { return fsm.State == (int)STATE.Unknown || fsm.State == (int)STATE.Init; }
  79. }
  80. public bool IsBusy
  81. {
  82. get { return !IsInit && !IsError && !IsIdle; }
  83. }
  84. public RState RobotStatus
  85. {
  86. get
  87. {
  88. if (_robot.Status != RState.Running)
  89. {
  90. if (_robotWatch.ElapsedMilliseconds < 100)
  91. return RState.Running;
  92. else
  93. return _robot.Status;
  94. }
  95. else
  96. return RState.Running;
  97. }
  98. }
  99. private readonly ITransferRobot _robot;
  100. private readonly Stopwatch _robotWatch;
  101. public SETMEntity()
  102. {
  103. }
  104. public bool Check(int msg, out string reason, params object[] args)
  105. {
  106. throw new NotImplementedException();
  107. }
  108. public bool CheckAcked(int msg)
  109. {
  110. throw new NotImplementedException();
  111. }
  112. public int Invoke(string function, params object[] args)
  113. {
  114. throw new NotImplementedException();
  115. }
  116. }
  117. }