FurtureAligner.cs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. using Aitex.Core.Common;
  2. using Aitex.Core.RT.Device;
  3. using Aitex.Core.RT.Event;
  4. using Aitex.Core.Util;
  5. using Aitex.Sorter.Common;
  6. using MECF.Framework.Common.Equipment;
  7. using MECF.Framework.Common.Schedulers;
  8. using MECF.Framework.Common.SubstrateTrackings;
  9. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Aligners;
  10. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Efems.Rorzes;
  11. using MECF.Framework.RT.EquipmentLibrary.LogicUnits;
  12. namespace FutureEfemLib.Aligners
  13. {
  14. public class FutureAligner : AlignerBase, ITransferTarget, IEfemAlignerCallback
  15. {
  16. private RorzeEfem _efem;
  17. private string _efemName;
  18. public FutureAligner(string module, string name, string efemName):base(module, name, module, module)
  19. {
  20. base.Module = module;
  21. base.Name = name;
  22. base.Display = name;
  23. base.DeviceID = "";
  24. _efemName = efemName;
  25. //IsMapWaferByLoadPort = false;
  26. }
  27. public override bool IsBusy
  28. {
  29. get
  30. {
  31. return _efem.CheckIsBusy(ModuleName.Aligner);
  32. }
  33. }
  34. public override bool Initialize()
  35. {
  36. if (_efem == null && !string.IsNullOrEmpty(_efemName))
  37. {
  38. _efem = DEVICE.GetDevice<RorzeEfem>(_efemName);
  39. _efem.SetAlignerCallback(ModuleHelper.Converter(Module), this);
  40. }
  41. //base.Initialize();
  42. return true;
  43. }
  44. private void _aligner_AlarmGenerated(string moduleName, EventLevel level, string message)
  45. {
  46. if (moduleName == Module)
  47. IsError = true;
  48. }
  49. public override bool Home(out string reason)
  50. {
  51. reason = string.Empty;
  52. if (!_efem.HomeWaferAligner(ModuleHelper.Converter(Module),out reason))
  53. {
  54. OnError();
  55. return false;
  56. }
  57. return true;
  58. }
  59. public override bool Align(double angle, out string reason)
  60. {
  61. reason = string.Empty;
  62. if (!_efem.AlignWafer(ModuleHelper.Converter(Module), angle, out reason))
  63. {
  64. OnError();
  65. return false;
  66. }
  67. return true;
  68. }
  69. public override bool QueryWaferPresence(out string reason)
  70. {
  71. reason = string.Empty;
  72. if (!_efem.AlignerMapWaferPresence(out string slotMap, out reason))
  73. {
  74. return false;
  75. }
  76. //bool hasWafer = slotMap.Substring(0, 1) == "1";
  77. //if (hasWafer &&
  78. // WaferManager.Instance.CheckNoWafer(Module, 0))
  79. //{
  80. // EV.PostInfoLog(Module, $"found map wafer, created wafer at {Module}");
  81. // WaferManager.Instance.CreateWafer(ModuleHelper.Converter(Module), 0, WaferStatus.Normal);
  82. //}
  83. //if (!hasWafer &&
  84. // WaferManager.Instance.CheckHasWafer(ModuleHelper.Converter(Module), 0))
  85. //{
  86. // EV.PostInfoLog(Module, $"did not find wafer, delete wafer from {Module} ");
  87. // WaferManager.Instance.DeleteWafer(ModuleHelper.Converter(Module), 0);
  88. //}
  89. return true;
  90. }
  91. public bool PrepareTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  92. {
  93. throw new System.NotImplementedException();
  94. }
  95. public bool TransferHandoff(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  96. {
  97. throw new System.NotImplementedException();
  98. }
  99. public bool PostTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  100. {
  101. throw new System.NotImplementedException();
  102. }
  103. public bool CheckReadyForTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType,
  104. out string reason)
  105. {
  106. reason=string.Empty;
  107. if (transferType == EnumTransferType.Pick)
  108. {
  109. return WaferManager.Instance.CheckHasWafer(Module,targetSlot);
  110. }
  111. if (transferType == EnumTransferType.Place)
  112. {
  113. return WaferManager.Instance.CheckNoWafer(Module,targetSlot);
  114. }
  115. return false;
  116. }
  117. public bool NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  118. {
  119. reason = string.Empty;
  120. return true;
  121. }
  122. public bool NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  123. {
  124. reason = string.Empty;
  125. return true;
  126. }
  127. public void NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  128. {
  129. }
  130. public void NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  131. {
  132. }
  133. public void NoteComplete()
  134. {
  135. }
  136. public void NoteCancel(string error)
  137. {
  138. }
  139. }
  140. }