VCEModuleBase.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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 void RHandExtend();
  75. //public abstract void RHandRetract();
  76. //Halt
  77. //public abstract bool Halt();
  78. protected bool CheckVceStatus()
  79. {
  80. if (Status == RState.Init)
  81. {
  82. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE is not homed, please home first.");
  83. return false;
  84. }
  85. else if (Status == RState.Running)
  86. {
  87. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE is busy, please wait a minute");
  88. return false;
  89. }
  90. else if (Status == RState.Failed || Status == RState.Timeout)
  91. {
  92. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE has a error, please check and fix the hardware issue and home it");
  93. return false;
  94. }
  95. return true;
  96. }
  97. //transfer
  98. public bool PrepareTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  99. {
  100. reason = "";
  101. return false;
  102. }
  103. public bool TransferHandoff(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  104. {
  105. reason = "";
  106. return false;
  107. }
  108. public bool PostTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  109. {
  110. reason = "";
  111. return false;
  112. }
  113. public bool CheckReadyForTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  114. {
  115. reason = "";
  116. return false;
  117. }
  118. public void NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  119. {
  120. return;
  121. }
  122. public void NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  123. {
  124. return;
  125. }
  126. public bool Home(out string reason)
  127. {
  128. reason = "";
  129. return false;
  130. }
  131. }
  132. }