VCEModuleBase.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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 bool IsReady { get; }
  53. public abstract bool IsError { get; }
  54. public abstract bool IsInit { get; }
  55. //Home
  56. public abstract bool Home(string axis);
  57. public abstract bool HomeALL();
  58. //此处的Door 都是Outer Door
  59. public abstract bool OpenDoor();
  60. public abstract bool CloseDoor();
  61. //Load
  62. public abstract bool Load();
  63. public abstract bool UnLoad();
  64. //Goto
  65. public abstract bool Goto(int Targetslot);
  66. //Map
  67. public abstract bool Map();
  68. //Read
  69. public abstract bool ReadMap();
  70. public abstract bool GotoLP();
  71. public abstract bool ClearError();
  72. //public abstract void RHandExtend();
  73. //public abstract void RHandRetract();
  74. //Halt
  75. //public abstract bool Halt();
  76. protected bool CheckVceStatus()
  77. {
  78. if (Status == RState.Init)
  79. {
  80. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE is not homed, please home first.");
  81. return false;
  82. }
  83. else if (Status == RState.Running)
  84. {
  85. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE is busy, please wait a minute");
  86. return false;
  87. }
  88. else if (Status == RState.Failed || Status == RState.Timeout)
  89. {
  90. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE has a error, please check and fix the hardware issue and home it");
  91. return false;
  92. }
  93. return true;
  94. }
  95. //transfer
  96. public bool PrepareTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  97. {
  98. reason = "";
  99. return false;
  100. }
  101. public bool TransferHandoff(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  102. {
  103. reason = "";
  104. return false;
  105. }
  106. public bool PostTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  107. {
  108. reason = "";
  109. return false;
  110. }
  111. public bool CheckReadyForTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  112. {
  113. reason = "";
  114. return false;
  115. }
  116. public void NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  117. {
  118. return;
  119. }
  120. public void NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  121. {
  122. return;
  123. }
  124. public bool Home(out string reason)
  125. {
  126. reason = "";
  127. return false;
  128. }
  129. }
  130. }