VceModuleBase.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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.LogicUnits;
  8. using MECF.Framework.RT.ModuleLibrary.Commons;
  9. using Venus_Core;
  10. namespace MECF.Framework.RT.ModuleLibrary.VceModules
  11. {
  12. public abstract class VceModuleBase : ModuleFsmDevice, ITransferTarget, IModuleDevice
  13. {
  14. private int _slot = 25;
  15. private ModuleName _moduleName;
  16. //private bool isJobDone;
  17. public virtual RState Status { get; }
  18. public VceModuleBase(int slot, ModuleName moduleName)
  19. {
  20. _slot = slot;
  21. _moduleName = moduleName;
  22. }
  23. public override bool Initialize()
  24. {
  25. WaferManager.Instance.SubscribeLocation(Module, _slot);
  26. CarrierManager.Instance.SubscribeLocation(Module);
  27. return base.Initialize();
  28. }
  29. public virtual void NoteJobStart()
  30. {
  31. //isJobDone = false;
  32. }
  33. public virtual void NoteJobComplete()
  34. {
  35. //isJobDone = true;
  36. }
  37. public virtual bool OutDoorIsOpen { get; set; }
  38. //IModuleDevice
  39. public abstract bool IsConnected { get; }
  40. public abstract bool IsReady { get; }
  41. public abstract bool IsError { get; }
  42. public abstract bool IsInit { get; }
  43. //Home
  44. public abstract bool Home(string axis);
  45. public abstract bool HomeALL();
  46. //此处的Door 都是Outer Door
  47. public abstract bool OpenDoor();
  48. public abstract bool CloseDoor();
  49. //Load
  50. public abstract bool Load();
  51. public abstract bool UnLoad();
  52. //Goto
  53. public abstract bool Goto(int Targetslot);
  54. //Map
  55. public abstract bool Map();
  56. //Read
  57. public abstract bool ReadMap();
  58. public abstract bool GotoLP();
  59. public abstract bool ClearError();
  60. //Halt
  61. //public abstract bool Halt();
  62. protected bool CheckVceStatus()
  63. {
  64. if (Status == RState.Init)
  65. {
  66. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE is not homed, please home first.");
  67. return false;
  68. }
  69. else if (Status == RState.Running)
  70. {
  71. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE is busy, please wait a minute");
  72. return false;
  73. }
  74. else if (Status == RState.Failed || Status == RState.Timeout)
  75. {
  76. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE has a error, please check and fix the hardware issue and home it");
  77. return false;
  78. }
  79. return true;
  80. }
  81. //transfer
  82. public bool PrepareTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  83. {
  84. reason = "";
  85. return false;
  86. }
  87. public bool TransferHandoff(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  88. {
  89. reason = "";
  90. return false;
  91. }
  92. public bool PostTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  93. {
  94. reason = "";
  95. return false;
  96. }
  97. public bool CheckReadyForTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  98. {
  99. reason = "";
  100. return false;
  101. }
  102. public void NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  103. {
  104. return;
  105. }
  106. public void NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  107. {
  108. return;
  109. }
  110. public bool Home(out string reason)
  111. {
  112. reason = "";
  113. return false;
  114. }
  115. }
  116. }