EfemBase.cs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. using System.Xml;
  8. using Aitex.Core.RT.Device;
  9. using Aitex.Core.RT.Log;
  10. using Aitex.Sorter.Common;
  11. using Aitex.Core.Common;
  12. using MECF.Framework.Common.Equipment;
  13. using CyberX8_RT.Devices;
  14. using CyberX8_RT.Devices.YASKAWA;
  15. using CyberX8_Core;
  16. using MECF.Framework.Common.CommonData;
  17. namespace CyberX8_RT.Devices.EFEM
  18. {
  19. public abstract class EfemBase : BaseDevice, IDevice
  20. {
  21. public virtual ILoadport this[ModuleName mod] => throw new ApplicationException();
  22. // Properties
  23. //
  24. public new ModuleName Module { get; set; } = ModuleName.EFEM;
  25. public OnlineFlag OnlineFlag { get; set; }
  26. public bool CommunicationConnected { get; protected set; }
  27. protected object _lockerAction = new object();
  28. public string GripStateBlade1
  29. {
  30. get;
  31. set;
  32. }
  33. public string GripStateBlade2
  34. {
  35. get;
  36. set;
  37. }
  38. protected EfemBase()
  39. {
  40. }
  41. protected bool CheckEfemStatus()
  42. {
  43. if (Status == RState.Init)
  44. {
  45. LOG.Write(eEvent.ERR_EFEM_ROBOT, ModuleName.EFEM, "EFEM is not homed, please home first.");
  46. return false;
  47. }
  48. else if (Status == RState.Running)
  49. {
  50. LOG.Write(eEvent.ERR_EFEM_ROBOT, ModuleName.EFEM, $"EFEM is busy, please wait a minute");
  51. return false;
  52. }
  53. else if (Status == RState.Failed || Status == RState.Timeout)
  54. {
  55. LOG.Write(eEvent.ERR_EFEM_ROBOT, ModuleName.EFEM, "EFEM has a error, please check and fix the hardware issue and home it");
  56. return false;
  57. }
  58. return true;
  59. }
  60. public virtual bool Initialize()
  61. {
  62. return true;
  63. }
  64. public abstract void Monitor();
  65. public abstract void Terminate();
  66. public abstract void Reset();
  67. public abstract void SetOnline(bool online);
  68. public abstract void SetOnline(ModuleName mod, bool online);
  69. public abstract void SetBusy(ModuleName mod, bool online);
  70. public virtual RState Status { get; }
  71. public virtual RobotMoveInfo TMRobotMoveInfo { get; }
  72. public virtual bool IsHomed { get; }
  73. public virtual bool LiftIsUp { get; }
  74. public virtual bool LiftIsDown { get; }
  75. public abstract bool HomeAll();
  76. public abstract bool Home(ModuleName mod);
  77. public abstract bool OriginalSearch(ModuleName mod);
  78. public abstract bool CheckWaferPresence();
  79. public abstract string GetWaferPresence();
  80. public abstract bool Halt();
  81. public abstract bool ClearError();
  82. public abstract bool CloseBuzzer();
  83. public abstract bool PickExtend(ModuleName chamber, int slot, Hand hand);
  84. public abstract bool PickRetract(ModuleName chamber, int slot, Hand hand);
  85. public abstract bool PlaceExtend(ModuleName chamber, int slot, Hand hand);
  86. public abstract bool PlaceRetract(ModuleName chamber, int slot, Hand hand);
  87. public abstract bool Pick(ModuleName station, int slot, Hand hand);
  88. public abstract bool Place(ModuleName station, int slot, Hand hand);
  89. public abstract bool Goto(ModuleName station, Hand hand,string updown="UP");
  90. public abstract bool Grip(Hand blade, bool isGrip);
  91. public abstract bool GotoMap(ModuleName mod, Hand hand,string extend="EX");
  92. public abstract bool Map(ModuleName mod);
  93. public abstract bool RequestMapResult(ModuleName mod);
  94. public abstract bool Vacuum(ModuleName mod,bool VacuumState);
  95. public abstract bool SetPinUp(ModuleName mod);
  96. public abstract bool SetPinDown(ModuleName mod);
  97. public abstract bool SetAlignAngle(ModuleName mod,double angle);
  98. public abstract bool SetRobotSpeed(ModuleName mod,int speed);
  99. public abstract bool RobotPowerOn(ModuleName mod,bool status);
  100. public abstract bool Align(ModuleName mod, double angle,float delayTime, WaferSize size);
  101. public abstract bool SetLamp(LightType light, LightStatus status);
  102. public abstract bool Load(ModuleName mod);
  103. public abstract bool Unload(ModuleName mod);
  104. public abstract bool ReadCarrierId(ModuleName mod);
  105. public abstract bool WriteCarrierId(ModuleName mod, string id);
  106. public abstract bool ReadTagData(ModuleName mod);
  107. public abstract bool WriteTagData(ModuleName mod, string tagData);
  108. public abstract bool Dock(ModuleName mod);
  109. public abstract bool Undock(ModuleName mod);
  110. public abstract bool Clamp(ModuleName mod, bool isUnloadClamp);
  111. public abstract bool Unclamp(ModuleName mod);
  112. public abstract bool SetThickness(ModuleName mod, string thickness);
  113. public abstract void SetRobotMovingInfo(RobotAction action, Hand hand, ModuleName target);
  114. public abstract bool GetWaferSize(ModuleName mod);
  115. public abstract bool SetWaferSize(ModuleName mod,int WaferSize);
  116. }
  117. }