VceModuleBase.cs 4.2 KB

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