VCEModuleBase.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. using Aitex.Core.RT.Device;
  2. using Aitex.Core.RT.Log;
  3. using Aitex.Sorter.Common;
  4. using MECF.Framework.Common.Equipment;
  5. using MECF.Framework.Common.Schedulers;
  6. using MECF.Framework.Common.SubstrateTrackings;
  7. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Efems;
  8. using MECF.Framework.RT.EquipmentLibrary.LogicUnits;
  9. using MECF.Framework.RT.ModuleLibrary.Commons;
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Linq;
  13. using System.Reflection;
  14. using System.Text;
  15. using System.Threading.Tasks;
  16. using Venus_Core;
  17. namespace Venus_RT.Devices.VCE
  18. {
  19. public abstract class VCEModuleBase : ModuleFsmDevice, ITransferTarget, IModuleDevice
  20. {
  21. private int _slot = 25;
  22. private ModuleName _moduleName;
  23. public virtual bool IsDashWaferError { get; }
  24. //private bool isJobDone;
  25. public virtual RState Status { get; }
  26. public virtual ILoadport this[ModuleName mod]
  27. {
  28. get { throw new ApplicationException(); }
  29. }
  30. public VCEModuleBase(int slot, ModuleName moduleName)
  31. {
  32. _slot = slot;
  33. _moduleName = moduleName;
  34. }
  35. public override bool Initialize()
  36. {
  37. WaferManager.Instance.SubscribeLocation(Module, _slot);
  38. CarrierManager.Instance.SubscribeLocation(Module);
  39. return base.Initialize();
  40. }
  41. public virtual void NoteJobStart()
  42. {
  43. //isJobDone = false;
  44. }
  45. public virtual void NoteJobComplete()
  46. {
  47. //isJobDone = true;
  48. }
  49. public virtual bool OutDoorIsOpen { get; set; }
  50. //IModuleDevice
  51. public abstract bool IsConnected { get; }
  52. public abstract int CurrentSlot { get; }
  53. public abstract bool IsReady { get; }
  54. public abstract bool IsError { get; }
  55. public abstract bool IsInit { get; }
  56. //Home
  57. public abstract bool Home(string axis);
  58. public abstract bool HomeALL();
  59. //此处的Door 都是Outer Door
  60. public abstract bool OpenDoor();
  61. public abstract bool CloseDoor();
  62. public abstract bool CheckStatus();
  63. //Load
  64. public abstract bool Load();
  65. public abstract bool UnLoad();
  66. //Goto
  67. public abstract bool Goto(int Targetslot);
  68. //Map
  69. public abstract bool Map();
  70. //Read
  71. public abstract bool ReadMap();
  72. public abstract bool GotoLP();
  73. public abstract bool ClearError();
  74. public abstract bool ServerUp();
  75. //public abstract void RHandExtend();
  76. //public abstract void RHandRetract();
  77. //Halt
  78. //public abstract bool Halt();
  79. protected bool CheckVceStatus()
  80. {
  81. if (Status == RState.Init)
  82. {
  83. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE is not homed, please home first.");
  84. return false;
  85. }
  86. else if (Status == RState.Running)
  87. {
  88. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE is busy, please wait a minute");
  89. return false;
  90. }
  91. else if (Status == RState.Failed || Status == RState.Timeout)
  92. {
  93. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE has a error, please check and fix the hardware issue and home it");
  94. return false;
  95. }
  96. return true;
  97. }
  98. //transfer
  99. public bool PrepareTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  100. {
  101. reason = "";
  102. return false;
  103. }
  104. public bool TransferHandoff(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  105. {
  106. reason = "";
  107. return false;
  108. }
  109. public bool PostTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  110. {
  111. reason = "";
  112. return false;
  113. }
  114. public bool CheckReadyForTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  115. {
  116. reason = "";
  117. return false;
  118. }
  119. public void NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  120. {
  121. return;
  122. }
  123. public void NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  124. {
  125. return;
  126. }
  127. public bool Home(out string reason)
  128. {
  129. reason = "";
  130. return false;
  131. }
  132. }
  133. }