SchedulerLoadPort.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. using Aitex.Core.Util;
  2. using Aitex.Sorter.Common;
  3. using MECF.Framework.Common.Equipment;
  4. using MECF.Framework.Common.Schedulers;
  5. using MECF.Framework.Common.SubstrateTrackings;
  6. using MECF.Framework.RT.ModuleLibrary.LPModules;
  7. using MECF.Framework.RT.ModuleLibrary.SystemModules;
  8. namespace EfemDualSchedulerLib.Schedulers
  9. {
  10. public class SchedulerLoadPort : SchedulerModule
  11. {
  12. public override bool IsAvailable
  13. {
  14. get { return _lp.IsReady && IsOnline && CheckTaskDone(); }
  15. }
  16. public override bool IsOnline
  17. {
  18. get { return true; }
  19. }
  20. public override bool IsError
  21. {
  22. get { return _lp.IsError; }
  23. }
  24. private LoadPortModuleBase _lp = null;
  25. public SchedulerLoadPort(ModuleName module) : base(module.ToString())
  26. {
  27. _module = module.ToString();
  28. _lp = EquipmentManager.Modules[module] as LoadPortModuleBase;
  29. System.Diagnostics.Trace.Assert(_lp!=null);
  30. }
  31. public void NoteJobStart()
  32. {
  33. _lp.NoteJobStart();
  34. }
  35. public void NoteJobComplete()
  36. {
  37. _lp.NoteJobComplete();
  38. }
  39. public bool Monitor()
  40. {
  41. return true;
  42. }
  43. public bool IsLoaded
  44. {
  45. get { return _lp.IsLoaded; }
  46. }
  47. public bool IsUnloaded
  48. {
  49. get { return _lp.IsUnloaded; }
  50. }
  51. public bool Load()
  52. {
  53. return _lp.Load();
  54. }
  55. public bool Unload()
  56. {
  57. return _lp.Unload();
  58. }
  59. public override bool IsReadyForPick(ModuleName robot, Hand blade, int slot)
  60. {
  61. return _lp.CheckReadyForTransfer(robot, blade, slot, EnumTransferType.Pick, out _)
  62. && WaferManager.Instance.CheckHasWafer(ModuleHelper.Converter(_module), slot);
  63. }
  64. public override bool IsReadyForPlace(ModuleName robot, Hand blade, int slot)
  65. {
  66. return _lp.CheckReadyForTransfer(robot, blade, slot, EnumTransferType.Pick, out _)
  67. && WaferManager.Instance.CheckNoWafer(ModuleHelper.Converter(_module), slot);
  68. }
  69. public bool CheckTaskDone()
  70. {
  71. bool ret = false;
  72. switch (_task)
  73. {
  74. case TaskType.None:
  75. ret = true;
  76. break;
  77. case TaskType.PrepareTransfer:
  78. ret = _lp.CheckReadyForTransfer(ModuleName.EfemRobot, Hand.Blade1, 0, EnumTransferType.Pick, out _);
  79. break;
  80. case TaskType.TransferTarget:
  81. ret = _lp.CheckReadyForTransfer(ModuleName.EfemRobot, Hand.Blade1, 0, EnumTransferType.Place, out _);
  82. break;
  83. }
  84. if (ret && _task != TaskType.None)
  85. {
  86. LogTaskDone(_task, "");
  87. _task = TaskType.None;
  88. }
  89. return ret;
  90. }
  91. internal bool CheckReadyRunJob()
  92. {
  93. return true;
  94. }
  95. internal bool CheckReadyTransfer()
  96. {
  97. return _lp.CheckReadyForTransfer(ModuleName.EfemRobot, Hand.Blade1, 0, EnumTransferType.Pick, out _);
  98. }
  99. }
  100. }