Susceptor.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Runtime.Serialization;
  6. using Aitex.Core.Util;
  7. namespace Aitex.Core.Equipment.SusceptorDefine
  8. {
  9. [DataContract]
  10. public class Susceptor
  11. {
  12. [DataMember]
  13. public Guid Id { get; set; }
  14. [DataMember]
  15. public WaferStatus[] WaferStatusArray { get; set; }
  16. [DataMember]
  17. public WaferType[] WaferTypeArray { get; set; }
  18. [DataMember]
  19. public string Type { get; set; }
  20. [DataMember]
  21. public SusceptorConfig Config { get; set; }
  22. [DataMember]
  23. public SusceptorStatus Status { get; set; }
  24. [DataMember]
  25. public string RecipeName { get; set; }
  26. [DataMember]
  27. public string UserDefinedId { get; set; }
  28. [DataMember]
  29. public string Description { get; set; }
  30. [DataMember]
  31. public string ModuleProcessedIn { get; set; }
  32. [DataMember]
  33. public string ModuleBufferedIn { get; set; }
  34. [DataMember]
  35. public DateTime CreateTime { get; set; }
  36. [DataMember]
  37. public DateTime ProcessStartTime { get; set; }
  38. [DataMember]
  39. public DateTime ProcessEndTime { get; set; }
  40. [DataMember]
  41. public string TargetRecipe { get; set; }
  42. public Susceptor()
  43. {
  44. WaferStatusArray = new WaferStatus[150];
  45. WaferTypeArray = new WaferType[150];
  46. CreateTime = DateTime.Now;
  47. TargetRecipe = string.Empty;
  48. }
  49. public bool IsEmpty() { return Id == Guid.Empty; }
  50. public bool IsUnProcessed() { return (Id != Guid.Empty) && (Status == SusceptorStatus.Unprocessed); }
  51. /// <summary>
  52. ///
  53. /// Zone: 测量点旋转一周的轨迹
  54. /// Section:托盘上每一圈Pocket的轨迹
  55. ///
  56. /// 下面的辅助函数用于方便相互之间的转换
  57. ///
  58. /// </summary>
  59. public int[] GetZoneDisplayNumber(int zone)
  60. {
  61. if (zone >= GetZoneNameList().Length)
  62. return null;
  63. Section s = GetZoneSection(zone);
  64. if (s == null)
  65. return null;
  66. return GetSectionDisplayNumber(s.Name);
  67. }
  68. public Notch[] GetZoneNotch(int zone)
  69. {
  70. Section s = GetZoneSection(zone);
  71. if (s == null)
  72. return null;
  73. return GetSectionNotch(GetZoneSection(zone).Name);
  74. }
  75. Section GetZoneSection(int zone)
  76. {
  77. if (Config == null)
  78. return null;
  79. string[] ZoneName = GetZoneNameList();
  80. if (zone >= ZoneName.Length)
  81. return null;
  82. Zone z = Config.Zones.Find(x => x.Name == ZoneName[zone]);
  83. return Config.Sections.Find(x => x.Name == z.Section);
  84. }
  85. public string[] GetZoneNameList()
  86. {
  87. List<string> result = new List<string>();
  88. if (Config != null)
  89. foreach (var item in Config.Zones)
  90. result.Add(item.Name);
  91. return result.ToArray();
  92. }
  93. Notch[] GetSectionNotch(string section)
  94. {
  95. List<string> sectionName = new List<string>() { "A", "B", "C", "D" };
  96. int index = sectionName.FindIndex(x => x == section);
  97. int from = 0;
  98. for (int i = 0; i < index; i++)
  99. from += Config.Sections[i].NotchCount;
  100. return Config.Notches.GetRange(from, Config.Sections[index].NotchCount).ToArray();
  101. }
  102. int[] GetSectionDisplayNumber(string section)
  103. {
  104. Notch[] notches = GetSectionNotch(section);
  105. int[] result = new int[notches.Length];
  106. for (int i = 0; i < result.Length; i++)
  107. result[i] = notches[i].DisplayIndex;
  108. return result;
  109. }
  110. }
  111. }