SchedulerAligner.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.EquipmentLibrary.HardwareUnits.Aligners;
  7. using MECF.Framework.RT.ModuleLibrary.AlignerModules;
  8. using MECF.Framework.RT.ModuleLibrary.LPModules;
  9. using MECF.Framework.RT.ModuleLibrary.SystemModules;
  10. namespace EfemDualSchedulerLib.Schedulers
  11. {
  12. public class SchedulerAligner : SchedulerModule
  13. {
  14. public override bool IsAvailable
  15. {
  16. get { return _aligner.IsReady && _aligner.IsOnline && CheckTaskDone(); }
  17. }
  18. public override bool IsOnline
  19. {
  20. get { return _aligner.IsOnline; }
  21. }
  22. public override bool IsError
  23. {
  24. get { return _aligner.IsError; }
  25. }
  26. private AlignerModuleBase _aligner = null;
  27. public SchedulerAligner(ModuleName module) : base(module.ToString())
  28. {
  29. _module = module.ToString();
  30. _aligner = EquipmentManager.Modules[module] as AlignerModuleBase;
  31. System.Diagnostics.Trace.Assert(_aligner!=null);
  32. }
  33. public void NoteJobStart()
  34. {
  35. }
  36. public void NoteJobComplete()
  37. {
  38. }
  39. public bool Monitor()
  40. {
  41. return true;
  42. }
  43. public override bool IsReadyForPick(ModuleName robot, Hand blade, int slot)
  44. {
  45. return _aligner.CheckReadyForTransfer(robot, blade, slot, EnumTransferType.Pick, out _)
  46. && WaferManager.Instance.CheckHasWafer(ModuleHelper.Converter(_module), slot);
  47. }
  48. public override bool IsReadyForPlace(ModuleName robot, Hand blade, int slot)
  49. {
  50. return _aligner.CheckReadyForTransfer(robot, blade, slot, EnumTransferType.Place, out _)
  51. && WaferManager.Instance.CheckNoWafer(ModuleHelper.Converter(_module), slot);
  52. }
  53. public bool CheckTaskDone()
  54. {
  55. bool ret = false;
  56. switch (_task)
  57. {
  58. case TaskType.None:
  59. ret = true;
  60. break;
  61. //case TaskType.PrepareTransfer:
  62. // ret = _aligner.CheckReadyForTransfer(ModuleName.EfemRobot, Hand.Blade1, 0, EnumTransferType.Pick, out _);
  63. // break;
  64. }
  65. if (ret && _task != TaskType.None)
  66. {
  67. LogTaskDone(_task, "");
  68. _task = TaskType.None;
  69. }
  70. return ret;
  71. }
  72. internal bool CheckReadyRunJob()
  73. {
  74. return true;
  75. }
  76. internal bool CheckReadyTransfer()
  77. {
  78. return _aligner.CheckReadyForTransfer(ModuleName.EfemRobot, Hand.Blade1, 0, EnumTransferType.Pick, out _);
  79. }
  80. internal bool Align(double angle)
  81. {
  82. return _aligner.Align(angle);
  83. }
  84. }
  85. }