RecipeParserAlign.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Aitex.Core.Common;
  6. using Aitex.Core.RT.DataCenter;
  7. using Aitex.Core.RT.Device;
  8. using Aitex.Core.RT.Log;
  9. using Aitex.Sorter.Common;
  10. using MECF.Framework.Common.Equipment;
  11. using MECF.Framework.Common.SubstrateTrackings;
  12. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
  13. namespace Aitex.Sorter.RT.Module.Recipe
  14. {
  15. /// <summary>
  16. /// Align,哪里来,哪里去;可选是否Read Wafer ID
  17. /// </summary>
  18. class RecipeParserAlign: IRecipeParser
  19. {
  20. public SorterRecipeXml XmlRecipe { get; set; }
  21. public bool Init(SorterRecipeXml xmlRecipe, out string reason)
  22. {
  23. reason = string.Empty;
  24. if (xmlRecipe.RecipeType != SorterRecipeType.Align)
  25. {
  26. LOG.Write("xml recipe type not valid, "+xmlRecipe.RecipeType);
  27. reason = "Recipe xml file not valid";
  28. return false;
  29. }
  30. XmlRecipe = xmlRecipe;
  31. return true;
  32. }
  33. public List<TransferInfo> Parse(out string reason)
  34. {
  35. List<TransferInfo> result = new List<TransferInfo>();
  36. reason = string.Empty;
  37. bool isLoad = false;
  38. for (int i = 0; i < XmlRecipe.Source.Count; i++)
  39. {
  40. LoadPort lp = DEVICE.GetDevice<LoadPort>(XmlRecipe.Source[i].ToString());
  41. if (lp.IsEnableTransferWafer(out reason))
  42. {
  43. isLoad = true;
  44. }
  45. }
  46. if (!isLoad)
  47. {
  48. reason = "Source is not valid for transfer.";
  49. return result;
  50. }
  51. for (int j = 0; j < XmlRecipe.Source.Count; j++)
  52. {
  53. string paramName = string.Empty;
  54. switch (XmlRecipe.Source[j])
  55. {
  56. case ModuleName.LP1:
  57. paramName = ParamName.WaferInfoFoupA;
  58. break;
  59. case ModuleName.LP2:
  60. paramName = ParamName.WaferInfoFoupB;
  61. break;
  62. case ModuleName.LP3:
  63. paramName = ParamName.WaferInfoFoupC;
  64. break;
  65. case ModuleName.LP4:
  66. paramName = ParamName.WaferInfoFoupD;
  67. break;
  68. case ModuleName.LP5:
  69. paramName = ParamName.WaferInfoFoupE;
  70. break;
  71. case ModuleName.LP6:
  72. paramName = ParamName.WaferInfoFoupF;
  73. break;
  74. case ModuleName.LP7:
  75. paramName = ParamName.WaferInfoFoupG;
  76. break;
  77. case ModuleName.LP8:
  78. paramName = ParamName.WaferInfoFoupH;
  79. break;
  80. case ModuleName.LP9:
  81. paramName = ParamName.WaferInfoFoupI;
  82. break;
  83. case ModuleName.LP10:
  84. paramName = ParamName.WaferInfoFoupJ;
  85. break;
  86. default:
  87. reason = string.Format("recipe source {0} not valid", XmlRecipe.Source);
  88. return result;
  89. }
  90. WaferInfo[] foupInfos = WaferManager.Instance.GetWafers(XmlRecipe.Source[j]);
  91. //Array.Reverse(foupInfos);
  92. for (int i = 0; i < foupInfos.Length; i++)
  93. {
  94. if (foupInfos[i].IsEmpty)
  95. continue;
  96. result.Add(new TransferInfo()
  97. {
  98. Angle = XmlRecipe.AlignAngle,
  99. Option = MoveOption.Align | (XmlRecipe.IsTurnOver ? MoveOption.Turnover : MoveOption.None),
  100. Source = XmlRecipe.Source[j],
  101. SourceSlot = i,
  102. Slot = i,
  103. Station = XmlRecipe.Source[j],
  104. WaferID = foupInfos[i].WaferID,
  105. });
  106. }
  107. }
  108. //if (result.Count == 0)
  109. // reason = "Recipe has no vaild transfer task.";
  110. return result;
  111. }
  112. }
  113. }