Utils.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Aitex.Sorter.Common;
  6. using MECF.Framework.Common.Equipment;
  7. namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot.SR100
  8. {
  9. public class ProtocolTag
  10. {
  11. public const string tag_end = "\r";
  12. public const string tag_cmd_start = "$";
  13. public const string cmd_token = ",";
  14. public const string resp_tag_normal = "$";
  15. public const string resp_tag_error = "?";
  16. public const string resp_tag_excute = "!";
  17. public const string resp_tag_event = ">";
  18. public const string resp_evt_error = "100";
  19. }
  20. public class RobotConvertor
  21. {
  22. public static string chamber2staion(ModuleName chamber)
  23. {
  24. string st = "";
  25. switch (chamber)
  26. {
  27. case ModuleName.LP1:
  28. st = "C01";
  29. break;
  30. case ModuleName.LP2:
  31. st = "C02";
  32. break;
  33. case ModuleName.LP3:
  34. st = "C03";
  35. break;
  36. case ModuleName.LP4:
  37. st = "C04";
  38. break;
  39. case ModuleName.LP5:
  40. st = "C05";
  41. break;
  42. case ModuleName.LP6:
  43. st = "C06";
  44. break;
  45. case ModuleName.LP7:
  46. st = "C07";
  47. break;
  48. case ModuleName.LP8:
  49. st = "C08";
  50. break;
  51. case ModuleName.Aligner:
  52. st = "P01";
  53. break;
  54. }
  55. return st;
  56. }
  57. public static string chamberSlot2Slot(ModuleName chamber, int slot)
  58. {
  59. string sslot = "";
  60. switch (chamber)
  61. {
  62. case ModuleName.LP1:
  63. case ModuleName.LP2:
  64. case ModuleName.LP3:
  65. case ModuleName.LP4:
  66. case ModuleName.LP5:
  67. case ModuleName.LP6:
  68. case ModuleName.LP7:
  69. case ModuleName.LP8:
  70. case ModuleName.LP9:
  71. case ModuleName.LP10:
  72. sslot = string.Format("{0:D2}", slot + 1);
  73. break;
  74. case ModuleName.Aligner:
  75. sslot = "00";
  76. break;
  77. }
  78. return sslot;
  79. }
  80. public static string hand2string(Hand hand)
  81. {
  82. string st = "";
  83. switch (hand)
  84. {
  85. case Hand.Blade1:
  86. st = "1";
  87. break;
  88. case Hand.Blade2:
  89. st = "2";
  90. break;
  91. case Hand.Both:
  92. st = "F";
  93. break;
  94. }
  95. return st;
  96. }
  97. public static string IsPick2Position(bool isPick)
  98. {
  99. var pos = isPick ? "P1" : "G1";
  100. return pos;
  101. }
  102. public static string Offset2String(int offset)
  103. {
  104. string st = "";
  105. if (offset >= 0)
  106. {
  107. st = string.Format("{0:D8}", offset);
  108. }
  109. else
  110. {
  111. st = string.Format("{0:D7}", offset);
  112. }
  113. return st;
  114. }
  115. }
  116. }