VceModuleBase.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 都是Outer 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. public abstract bool GotoLP();
  58. //Halt
  59. //public abstract bool Halt();
  60. protected bool CheckVceStatus()
  61. {
  62. if (Status == RState.Init)
  63. {
  64. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE is not homed, please home first.");
  65. return false;
  66. }
  67. else if (Status == RState.Running)
  68. {
  69. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE is busy, please wait a minute");
  70. return false;
  71. }
  72. else if (Status == RState.Failed || Status == RState.Timeout)
  73. {
  74. LOG.Write(eEvent.ERR_DEVICE_INFO, _moduleName, "VCE has a error, please check and fix the hardware issue and home it");
  75. return false;
  76. }
  77. return true;
  78. }
  79. //transfer
  80. public bool PrepareTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  81. {
  82. reason = "";
  83. return false;
  84. }
  85. public bool TransferHandoff(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  86. {
  87. reason = "";
  88. return false;
  89. }
  90. public bool PostTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  91. {
  92. reason = "";
  93. return false;
  94. }
  95. public bool CheckReadyForTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
  96. {
  97. reason = "";
  98. return false;
  99. }
  100. public void NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  101. {
  102. return;
  103. }
  104. public void NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
  105. {
  106. return;
  107. }
  108. public bool Home(out string reason)
  109. {
  110. reason = "";
  111. return false;
  112. }
  113. }
  114. }