Mag7RobotConvertor.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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.MAG7
  8. {
  9. public class ProtocolTag
  10. {
  11. public const string tag_end = "\r";
  12. public const string cmd_token = " ";
  13. public const string resp_tag_error = "_ERR";
  14. public const string resp_tag_excute = "_RDY";
  15. public const string resp_tag_event = "_EVENT";
  16. public const string resp_evt_error = "100";
  17. }
  18. public class Mag7RobotConvertor
  19. {
  20. public static string MapModuleSlot(ModuleName chamber, int slot)
  21. {
  22. string st = "";
  23. switch (chamber)
  24. {
  25. case ModuleName.LL1:
  26. case ModuleName.LLA:
  27. st = "2 SLOT 1";
  28. break;
  29. case ModuleName.LL2:
  30. case ModuleName.LLB:
  31. st = "1 SLOT 1";
  32. break;
  33. case ModuleName.PM1:
  34. st = slot==0 ? "3 SLOT 1" : "3 SLOT 2";
  35. break;
  36. case ModuleName.PM2:
  37. st = "4 SLOT 1";
  38. break;
  39. case ModuleName.PM3:
  40. st = "5 SLOT 1";
  41. break;
  42. case ModuleName.PM4:
  43. st = "6 SLOT 1";
  44. break;
  45. case ModuleName.PM5:
  46. st = "7 SLOT 1";
  47. break;
  48. case ModuleName.PM6:
  49. st = "8 SLOT 1";
  50. break;
  51. }
  52. return st;
  53. }
  54. public static string MapModule(ModuleName chamber )
  55. {
  56. string st = "";
  57. switch (chamber)
  58. {
  59. case ModuleName.LL1:
  60. case ModuleName.LLA:
  61. st = "2";
  62. break;
  63. case ModuleName.LL2:
  64. case ModuleName.LLB:
  65. st = "1";
  66. break;
  67. case ModuleName.PM1:
  68. st = "3";
  69. break;
  70. case ModuleName.PM2:
  71. st = "4";
  72. break;
  73. case ModuleName.PM3:
  74. st = "5";
  75. break;
  76. case ModuleName.PM4:
  77. st = "6";
  78. break;
  79. case ModuleName.PM5:
  80. st = "7";
  81. break;
  82. case ModuleName.PM6:
  83. st = "8";
  84. break;
  85. }
  86. return st;
  87. }
  88. public static string hand2string(Hand hand)
  89. {
  90. string st = "";
  91. switch (hand)
  92. {
  93. case Hand.Blade1:
  94. st = "A";
  95. break;
  96. case Hand.Blade2:
  97. st = "B";
  98. break;
  99. case Hand.Both:
  100. st = "AB";
  101. break;
  102. }
  103. return st;
  104. }
  105. }
  106. }