SchedulerLoadLock.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using System.Diagnostics;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Aitex.Core.RT.Fsm;
  7. using Aitex.Core.Util;
  8. using Aitex.Core.RT.SCCore;
  9. using Aitex.Sorter.Common;
  10. using MECF.Framework.Common.Equipment;
  11. using MECF.Framework.Common.Schedulers;
  12. using MECF.Framework.Common.SubstrateTrackings;
  13. using Venus_RT.Scheduler;
  14. using Venus_Core;
  15. namespace Venus_RT.Modules.Schedulers
  16. {
  17. public class SchedulerLoadLock : SchedulerModule
  18. {
  19. public override bool IsAvailable
  20. {
  21. get { return _entity.IsIdle && _entity.IsInclude && (_entity.IsOnline || !Singleton<RouteManager>.Instance.IsAutoMode) && CheckTaskDone(); }
  22. }
  23. public override bool IsOnline
  24. {
  25. get { return _entity.IsOnline; }
  26. }
  27. public override bool IsError
  28. {
  29. get { return _entity.IsError; }
  30. }
  31. public override bool IsIdle
  32. {
  33. get { return _entity.IsIdle; }
  34. }
  35. public override bool IsVac
  36. {
  37. get { return _entity.IsVac; }
  38. }
  39. public override bool IsAtm
  40. {
  41. get { return _entity.IsATM; }
  42. }
  43. public override bool IsInclude { get { return _entity.IsInclude; } }
  44. public override int TimeToReady
  45. {
  46. get { return (IsOnline && IsInclude) ? _entity.TimeToReady : int.MaxValue / 2; ; }
  47. }
  48. private LLEntity _entity = null;
  49. public SchedulerLoadLock(ModuleName module) : base(module.ToString())
  50. {
  51. _entity = Singleton<RouteManager>.Instance.GetLL(module);
  52. }
  53. private bool CheckTaskDone()
  54. {
  55. return true;
  56. }
  57. public override void ResetTask()
  58. {
  59. base.ResetTask();
  60. }
  61. public List<int> GetOrderedOutSlot()
  62. {
  63. return WaferArriveTicks.OrderBy(item => item.Value).ToDictionary(k => k.Key, v => v.Value).Keys.ToList();
  64. }
  65. public bool PreVent()
  66. {
  67. return _entity.Invoke(LLEntity.MSG.Vent.ToString()) == (int)LLEntity.MSG.Vent;
  68. }
  69. public bool PrePump()
  70. {
  71. return _entity.Invoke(LLEntity.MSG.Pump.ToString()) == (int)LLEntity.MSG.Pump;
  72. }
  73. public bool Cooling()
  74. {
  75. return _entity.Invoke(LLEntity.MSG.AutoCooling.ToString()) == (int)LLEntity.MSG.AutoCooling;
  76. }
  77. }
  78. }