ModuleName.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.Serialization;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace MECF.Framework.Common.Equipment
  8. {
  9. /// <summary>
  10. /// 在框架中,Module指具备放置Wafer的单元
  11. /// </summary>
  12. [DataContract]
  13. [Serializable]
  14. public enum ModuleName
  15. {
  16. [EnumMember]
  17. System = 0,
  18. [EnumMember]
  19. LP1,
  20. [EnumMember]
  21. LP2,
  22. [EnumMember]
  23. LP3,
  24. [EnumMember]
  25. LP4,
  26. [EnumMember]
  27. LP5,
  28. [EnumMember]
  29. LP6,
  30. [EnumMember]
  31. LP7,
  32. [EnumMember]
  33. LP8,
  34. [EnumMember]
  35. LP9,
  36. [EnumMember]
  37. LP10,
  38. //robot modules
  39. //[EnumMember]
  40. //Robot,
  41. [EnumMember]
  42. VaccumRobot,
  43. [EnumMember]
  44. LoadRobot,
  45. [EnumMember]
  46. EfemRobot,
  47. //[EnumMember]
  48. //TMRobot,
  49. //upenders
  50. [EnumMember]
  51. Upender,
  52. //efem
  53. [EnumMember]
  54. EFEM,
  55. //aligners
  56. [EnumMember]
  57. Aligner,
  58. [EnumMember]
  59. Aligner1,
  60. [EnumMember]
  61. Aligner2,
  62. //load locks
  63. [EnumMember]
  64. LL1,
  65. [EnumMember]
  66. LL2,
  67. [EnumMember]
  68. LL3,
  69. [EnumMember]
  70. LL4,
  71. //load locks
  72. [EnumMember]
  73. LLA,
  74. [EnumMember]
  75. LLB,
  76. [EnumMember]
  77. LLC,
  78. [EnumMember]
  79. LLD,
  80. [EnumMember]
  81. VCE1,
  82. [EnumMember]
  83. VCE2,
  84. //transfer modules
  85. [EnumMember]
  86. TM,
  87. //buffers
  88. [EnumMember]
  89. Buffer,
  90. //[EnumMember]
  91. //Buffer1,
  92. //[EnumMember]
  93. //Buffer2,
  94. [EnumMember]
  95. Buffer3,
  96. //PMs
  97. [EnumMember]
  98. PM1,
  99. [EnumMember]
  100. PM2,
  101. [EnumMember]
  102. PM3,
  103. [EnumMember]
  104. PM4,
  105. [EnumMember]
  106. PM5,
  107. [EnumMember]
  108. PM6,
  109. [EnumMember]
  110. PM7,
  111. [EnumMember]
  112. PM8,
  113. [EnumMember]
  114. Robot,
  115. [EnumMember]
  116. PMA,
  117. [EnumMember]
  118. PMB,
  119. }
  120. public static class ModuleHelper
  121. {
  122. public static bool IsBuffer(ModuleName unit)
  123. {
  124. return false;
  125. }
  126. public static bool IsLoadPort(ModuleName unit)
  127. {
  128. return unit == ModuleName.LP1
  129. || unit == ModuleName.LP2
  130. || unit == ModuleName.LP3
  131. || unit == ModuleName.LP4
  132. || unit == ModuleName.LP5
  133. || unit == ModuleName.LP6
  134. || unit == ModuleName.LP7
  135. || unit == ModuleName.LP8
  136. || unit == ModuleName.LP9
  137. || unit == ModuleName.LP10;
  138. }
  139. public static bool IsPm(string unit)
  140. {
  141. return IsPm(ModuleHelper.Converter(unit));
  142. }
  143. public static bool IsPm(ModuleName unit)
  144. {
  145. return unit == ModuleName.PM1
  146. || unit == ModuleName.PM2
  147. || unit == ModuleName.PM3
  148. || unit == ModuleName.PM4
  149. || unit == ModuleName.PM5
  150. || unit == ModuleName.PM6
  151. || unit == ModuleName.PM7
  152. || unit == ModuleName.PM8
  153. || unit == ModuleName.PMA
  154. || unit == ModuleName.PMB;
  155. }
  156. public static bool IsLoadLock(string unit)
  157. {
  158. return IsLoadLock(ModuleHelper.Converter(unit));
  159. }
  160. public static bool IsAligner(ModuleName unit)
  161. {
  162. return unit == ModuleName.Aligner || unit == ModuleName.Aligner1 || unit == ModuleName.Aligner2;
  163. }
  164. public static bool IsLoadLock(ModuleName unit)
  165. {
  166. return unit == ModuleName.LLA
  167. || unit == ModuleName.LLB
  168. || unit == ModuleName.LL1
  169. || unit == ModuleName.LL2
  170. || unit == ModuleName.LL3
  171. || unit == ModuleName.LL4
  172. || unit == ModuleName.LLC
  173. || unit == ModuleName.LLD;
  174. }
  175. public static string GetAbbr(ModuleName module)
  176. {
  177. switch (module)
  178. {
  179. case ModuleName.Aligner: return "PA";
  180. case ModuleName.Robot: return "RB";
  181. default: return module.ToString();
  182. }
  183. }
  184. public static ModuleName Converter(string module)
  185. {
  186. return (ModuleName) Enum.Parse(typeof(ModuleName), module);
  187. }
  188. /// <summary>
  189. ///
  190. /// </summary>
  191. /// <param name="index">0 based</param>
  192. /// <returns></returns>
  193. public static ModuleName GetLoadPort(int index)
  194. {
  195. ModuleName[] lps = new ModuleName[]
  196. {
  197. ModuleName.LP1, ModuleName.LP2, ModuleName.LP3, ModuleName.LP4, ModuleName.LP5,
  198. ModuleName.LP6, ModuleName.LP7, ModuleName.LP8, ModuleName.LP9, ModuleName.LP10,
  199. };
  200. return lps[index];
  201. }
  202. }
  203. public class ModuleNameString
  204. {
  205. public const string System = "System";
  206. public const string LDULD = "LDULD";
  207. public const string BufferOut = "BufferOut";
  208. public const string BufferIn = "BufferIn";
  209. public const string Dryer = "Dryer";
  210. public const string QDR = "QDR";
  211. public const string Robot = "Robot";
  212. public const string Handler = "Handler";
  213. public static ModuleName ToEnum(string value)
  214. {
  215. return (ModuleName)Enum.Parse(typeof(ModuleName), value, true);
  216. }
  217. }
  218. }