WaferStatusImp.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. using MECF.Framework.Common.DataCenter;
  2. using MECF.Framework.Common.Equipment;
  3. using OpenSEMI.ClientBase;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using ACC = Aitex.Core.Common;
  10. namespace CyberX8_MainPages.Unity
  11. {
  12. public class WaferStatusImp
  13. {
  14. public WaferStatusImp(IQueryDataService dataService)
  15. {
  16. DataService = dataService;
  17. }
  18. public List<WaferInfo> GetWaferStatus(string moduleID)
  19. {
  20. List<WaferInfo> result = new List<WaferInfo>();
  21. string param = moduleID + ".ModuleWaferList";
  22. ACC.WaferInfo[] wafers = QueryDataClient.Instance.Service.GetData(param) as ACC.WaferInfo[];
  23. if (wafers != null)
  24. {
  25. for (int i = 0; i < wafers.Length; i++)
  26. {
  27. result.Add(WaferInfoConverter(wafers[i], moduleID, i));
  28. }
  29. }
  30. return result;
  31. }
  32. private WaferInfo WaferInfoConverter(ACC.WaferInfo awafer, string modid, int slotid)
  33. {
  34. WaferInfo wafer = new WaferInfo();
  35. wafer.ModuleID = modid;
  36. wafer.SlotID = slotid;
  37. wafer.SlotIndex = slotid + 1;
  38. wafer.WaferID = awafer.WaferID;
  39. wafer.SourceName = awafer.WaferOrigin;
  40. wafer.WaferStatus = WaferStatusConverter(awafer);
  41. if (!string.IsNullOrEmpty(awafer.SequenceName))
  42. {
  43. wafer.SequenceName = awafer.SequenceName;
  44. }
  45. return wafer;
  46. }
  47. //0: trans?
  48. //1:goden
  49. //2:blue
  50. //3:cyan
  51. //4:green
  52. //5:error
  53. private int WaferStatusConverter(ACC.WaferInfo awafer)
  54. {
  55. if (awafer.Status == ACC.WaferStatus.Empty)
  56. return 0;
  57. if (awafer.Status == ACC.WaferStatus.Normal)
  58. {
  59. if (awafer.WaferType == ACC.WaferType.Assit)
  60. {
  61. return 6;
  62. }
  63. else
  64. {
  65. switch (awafer.ProcessState)
  66. {
  67. case ACC.EnumWaferProcessStatus.InProcess: return 3;
  68. case ACC.EnumWaferProcessStatus.Completed: return 4;
  69. case ACC.EnumWaferProcessStatus.Failed: return 5;
  70. case ACC.EnumWaferProcessStatus.Idle:
  71. return awafer.ProcessJob == null ? 1 : 2;
  72. case ACC.EnumWaferProcessStatus.Canceled:
  73. return 7;
  74. case ACC.EnumWaferProcessStatus.MisProcessed:
  75. return 8;
  76. case ACC.EnumWaferProcessStatus.MisSrdProcess:
  77. return 9;
  78. }
  79. }
  80. }
  81. else if (awafer.Status == ACC.WaferStatus.Crossed)
  82. {
  83. return 10;
  84. }
  85. else if (awafer.Status == ACC.WaferStatus.Double)
  86. {
  87. return 11;
  88. }
  89. else if (awafer.Status == ACC.WaferStatus.Unknown)
  90. {
  91. return 0;
  92. }
  93. if (awafer.Status == ACC.WaferStatus.Dummy)
  94. {
  95. return 6;
  96. }
  97. return 1;
  98. }
  99. private IQueryDataService DataService;
  100. }
  101. }