VceModuleBase.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. //IModuleDevice
  38. public abstract bool IsConnected { get; }
  39. public abstract bool IsReady { get; }
  40. public abstract bool IsError { get; }
  41. public abstract bool IsInit { get; }
  42. //Home
  43. public abstract bool Home(string axis);
  44. public abstract bool HomeALL();
  45. //Door
  46. public abstract bool OpenDoor();
  47. public abstract bool CloseDoor();
  48. //Load
  49. public abstract bool Load();
  50. public abstract bool UnLoad();
  51. //Goto
  52. public abstract bool Goto(int Targetslot);
  53. //Map
  54. public abstract bool Map();
  55. //Read
  56. public abstract bool ReadMap();
  57. //Halt
  58. //public abstract bool Halt();
  59. protected bool CheckVceStatus()
  60. {
  61. if (Status == RState.Init)
  62. {
  63. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE is not homed, please home first.");
  64. return false;
  65. }
  66. else if (Status == RState.Running)
  67. {
  68. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE is busy, please wait a minute");
  69. return false;
  70. }
  71. else if (Status == RState.Failed || Status == RState.Timeout)
  72. {
  73. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE has a error, please check and fix the hardware issue and home it");
  74. return false;
  75. }
  76. return true;
  77. }
  78. //transfer
  79. public bool PrepareTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  80. {
  81. reason = "";
  82. return false;
  83. }
  84. public bool TransferHandoff(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  85. {
  86. reason = "";
  87. return false;
  88. }
  89. public bool PostTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  90. {
  91. reason = "";
  92. return false;
  93. }
  94. public bool CheckReadyForTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  95. {
  96. reason = "";
  97. return false;
  98. }
  99. public void NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  100. {
  101. return;
  102. }
  103. public void NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  104. {
  105. return;
  106. }
  107. public bool Home(out string reason)
  108. {
  109. reason = "";
  110. return false;
  111. }
  112. }
  113. }