IRobotHandlerFactory.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Text.RegularExpressions;
  6. using Aitex.Core.RT.Log;
  7. using Aitex.Sorter.Common;
  8. using Aitex.Core.RT.SCCore;
  9. using MECF.Framework.Common.Equipment;
  10. using Aitex.Core.RT.Device;
  11. using Aitex.Core.Common;
  12. namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot
  13. {
  14. public interface ITransferMsg
  15. {
  16. IDevice Robot { set; }
  17. bool background { get; }
  18. bool evt { get; }
  19. string package(params object[] args);
  20. /// </summary>
  21. /// return value, completed
  22. /// <param name="type"></param>
  23. /// <param name="cmd"></param>
  24. /// <returns></returns>
  25. bool unpackage(string type, string[] cmd);
  26. }
  27. public class TokenGenerator
  28. {
  29. private int _last = 0;
  30. List<int> _pool = new List<int>();
  31. SCConfigItem scToken = null;
  32. public TokenGenerator(string scName)
  33. {
  34. scToken = SC.GetConfigItem(scName);
  35. if (scToken == null)
  36. _last = scToken.IntValue;
  37. Random r = new Random();
  38. _last = r.Next() % 20;
  39. }
  40. public int create()
  41. {
  42. int first = _last;
  43. int token = first;
  44. do
  45. {
  46. token = (token + 1) % 100;
  47. if (_pool.Contains(token))
  48. continue;
  49. _pool.Add(token);
  50. _last = token;
  51. scToken.IntValue = _last;
  52. return _last;
  53. } while (token != first);
  54. throw (new ExcuteFailedException("Get token failed,pool is full"));
  55. }
  56. public void release(int token)
  57. {
  58. _pool.Remove(token);
  59. }
  60. public void release()
  61. {
  62. _last = 0;
  63. _pool.Clear();
  64. }
  65. }
  66. public interface IRobotHandlerFactory
  67. {
  68. IHandler Init();
  69. IHandler Home();
  70. IHandler ArmHome();
  71. IHandler Event();
  72. IHandler Grip(Hand hand);
  73. IHandler Release(Hand hand);
  74. IHandler QueryState();
  75. IHandler QueryPosition();
  76. IHandler Clear();
  77. IHandler Stop(bool isEmergency);
  78. IHandler Resume();
  79. IHandler SetSpeed(int speed);
  80. IHandler Pick(ModuleName chamber, int slot, Hand hand);
  81. IHandler PickExtend(ModuleName chamber, int slot, Hand hand);
  82. IHandler PickRetract(ModuleName chamber, int slot, Hand hand);
  83. IHandler PickReadyPosition(ModuleName chamber, int slot, Hand hand);
  84. IHandler Place(ModuleName chamber, int slot, Hand hand);
  85. IHandler PlaceExtend(ModuleName chamber, int slot, Hand hand);
  86. IHandler PlaceRetract(ModuleName chamber, int slot, Hand hand);
  87. IHandler PlaceReadyPosition(ModuleName chamber, int slot, Hand hand);
  88. IHandler Extend(ModuleName chamber, int slot, Hand hand);
  89. IHandler Retract(ModuleName chamber, int slot, Hand hand);
  90. IHandler Exchange(ModuleName chamber, int slot, Hand hand);
  91. IHandler ExchangeReadyPosition(ModuleName chamber, int slot, Hand pickHand, Hand placeHand);
  92. IHandler ExchangePickExtend(ModuleName chamber, int slot, Hand pickHand, Hand placeHand);
  93. IHandler ExchangePlaceExtend(ModuleName chamber, int slot, Hand pickHand, Hand placeHand);
  94. IHandler ExchangePlaceRetract(ModuleName chamber, int slot, Hand pickHand, Hand placeHand);
  95. IHandler ExchangeReadyExtend(ModuleName chamber, int slot, Hand pickHand, Hand placeHand);
  96. IHandler ExchangeAfterReadyExtend(ModuleName chamber, int slot, Hand pickHand, Hand placeHand);
  97. IHandler Goto(ModuleName chamber, int slot, Motion next, Hand hand, int x,int y, int z);
  98. IHandler MoveTo(ModuleName chamber, int slot,Hand hand, bool isPick, int x,int y, int z);
  99. IHandler WaferMapping(ModuleName loadport);
  100. IHandler QueryWaferMap(ModuleName loadport);
  101. IHandler PickEx(ModuleName chamber, int slot, Hand hand, int x, int y, int z);
  102. IHandler PlaceEx(ModuleName chamber, int slot, Hand hand, int x, int y, int z);
  103. IHandler ExchangeEx(ModuleName chamber, int slot, Hand hand, int x, int y, int z);
  104. IHandler PositionAdjustment(Axis axis, Hand hand, int value);
  105. IHandler SetCommunication();
  106. IHandler SetLoad(Hand hand);
  107. IHandler CheckLoad(ModuleName chamber, int slot);
  108. IHandler CheckLoad(Hand hand);
  109. IHandler RequestWaferPresent(Hand hand);
  110. IHandler RequestWaferPresent();
  111. IHandler RequestAWCData();
  112. IHandler SetWaferSize(int size);
  113. IHandler QueryWaferSize();
  114. IHandler SetWaferSize(int cmd, WaferSize size);
  115. IHandler QueryParameter(int parameter, string parameterType);
  116. IHandler SetServoOnOff(bool trueForOnFalseForOff);
  117. }
  118. }