Tasks.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using MECF.Framework.Common.Equipment;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace VirgoRT.Scheduler
  8. {
  9. public enum StepID
  10. {
  11. Source,
  12. LoadlockIn,
  13. ProcessA,
  14. ProcessB,
  15. ProcessC,
  16. LoadlockOut,
  17. Target,
  18. }
  19. public class Step
  20. {
  21. public bool Need;
  22. public ModuleName Chamber;
  23. public int Slot;
  24. public string Recipe;
  25. public Step(bool need, ModuleName chamber, int slot, string recipe)
  26. {
  27. Need = need;
  28. Chamber = chamber;
  29. Slot = slot;
  30. Recipe = recipe;
  31. }
  32. }
  33. public class Sequence
  34. {
  35. public Step[] Steps
  36. {
  37. get { return _steps; }
  38. }
  39. private StepID _curStep = StepID.Source;
  40. private Step[] _steps = new Step[]
  41. {
  42. new Step(true, ModuleName.LP1, 0, string.Empty),
  43. new Step(true, ModuleName.LLA, 0, string.Empty),
  44. new Step(true, ModuleName.PM1, 0, string.Empty),
  45. new Step(true, ModuleName.PM2, 0, string.Empty),
  46. new Step(true, ModuleName.PM3, 0, string.Empty),
  47. new Step(true, ModuleName.LLA, 0, string.Empty),
  48. new Step(true, ModuleName.LP1, 0, string.Empty),
  49. };
  50. public Sequence()
  51. {
  52. }
  53. public Step NextStep(bool move = true)
  54. {
  55. for (StepID _step = _curStep; _curStep < StepID.Target; _step++)
  56. {
  57. if (_steps[(int)_step].Need)
  58. {
  59. if(move)
  60. _curStep = _step;
  61. return _steps[(int)_step];
  62. }
  63. }
  64. return null;
  65. }
  66. }
  67. }