SchedulerLoadLock.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. namespace Venus_RT.Modules.Schedulers
  15. {
  16. public class SchedulerLoadLock : SchedulerModule
  17. {
  18. public override bool IsAvailable
  19. {
  20. get { return _entity.IsIdle && _entity.IsInclude && (_entity.IsOnline || !Singleton<RouteManager>.Instance.IsAutoMode) && CheckTaskDone(); }
  21. }
  22. public override bool IsOnline
  23. {
  24. get { return _entity.IsOnline; }
  25. }
  26. public override bool IsError
  27. {
  28. get { return _entity.IsError; }
  29. }
  30. public override bool IsIdle
  31. {
  32. get { return _entity.IsIdle; }
  33. }
  34. public override bool IsVac
  35. {
  36. get { return _entity.IsVac; }
  37. }
  38. public override bool IsAtm
  39. {
  40. get { return _entity.IsATM; }
  41. }
  42. public override bool IsInclude { get { return _entity.IsInclude; } }
  43. public override int TimeToReady
  44. {
  45. get { return (IsOnline && IsInclude) ? _entity.TimeToReady : int.MaxValue / 2; ; }
  46. }
  47. private LLEntity _entity = null;
  48. public SchedulerLoadLock(ModuleName module) : base(module.ToString())
  49. {
  50. _entity = Singleton<RouteManager>.Instance.GetLL(module);
  51. }
  52. private bool CheckTaskDone()
  53. {
  54. return true;
  55. }
  56. public List<int> GetOrderedOutSlot()
  57. {
  58. return WaferArriveTicks.OrderBy(item => item.Value).ToDictionary(k => k.Key, v => v.Value).Keys.ToList();
  59. }
  60. public bool PreVent()
  61. {
  62. return _entity.Invoke(LLEntity.MSG.Vent.ToString()) == (int)LLEntity.MSG.Vent;
  63. }
  64. public bool PrePump()
  65. {
  66. return _entity.Invoke(LLEntity.MSG.Pump.ToString()) == (int)LLEntity.MSG.Pump;
  67. }
  68. }
  69. }