Recipe.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Venus_Core
  7. {
  8. public enum RecipeType
  9. {
  10. Chuck,
  11. Dechuck,
  12. Process,
  13. Clean,
  14. }
  15. public enum StepType
  16. {
  17. Time,
  18. Stable,
  19. EndPoint,
  20. OverEtch,
  21. }
  22. public enum ProcessModule
  23. {
  24. Pressure,
  25. TCP, // Transformer Coupled Plasma (转换耦合等离子)
  26. Bias,
  27. Gas,
  28. ESC,
  29. Process,
  30. Compound,
  31. }
  32. public enum GeneratorMode
  33. {
  34. Pulsing,
  35. CW,
  36. }
  37. public class RecipeHead
  38. {
  39. public string Version { get; set; }
  40. public RecipeType Type { get; set; }
  41. public string ChuckRecipe { get; set; }
  42. public string DechuckRecipe { get; set; }
  43. public string CreateTime { get; set; }
  44. public string LastModifiedBy { get; set; }
  45. public string Barcode { get; set; }
  46. }
  47. public class ProcessUnitBase
  48. {
  49. public Func<RState> checker;
  50. public Func<RState> starter;
  51. public string Name { get; set; }
  52. public ProcessModule Moudle { get; set; }
  53. public RState Start()
  54. {
  55. if (starter != null)
  56. return starter();
  57. return RState.Running;
  58. }
  59. public RState Run()
  60. {
  61. if (checker != null)
  62. return checker();
  63. return RState.Running;
  64. }
  65. }
  66. public class RecipeStep
  67. {
  68. public StepType Type { get; set; }
  69. public int Time { get; set; }
  70. public int MinEndPointTime { get; set; }
  71. public int MaxEndPointTime { get; set; }
  72. public bool CycleStart { get; set; }
  73. public bool CycleEnd { get; set; }
  74. public int CycleNumber { get; set; }
  75. public RState Start()
  76. {
  77. foreach(var unit in lstUnit)
  78. {
  79. var state = unit.Start();
  80. if (state != RState.Running)
  81. return state;
  82. }
  83. return RState.Running;
  84. }
  85. public RState Run()
  86. {
  87. foreach (var unit in lstUnit)
  88. {
  89. var state = unit.Run();
  90. if (state != RState.Running)
  91. return state;
  92. }
  93. return RState.Running;
  94. }
  95. public void AppendUnit(ProcessUnitBase unit)
  96. {
  97. lstUnit.Append(unit);
  98. }
  99. private List<ProcessUnitBase> lstUnit = new List<ProcessUnitBase>();
  100. }
  101. class Recipe
  102. {
  103. public RecipeHead Header { get; set; }
  104. public Dictionary<int, RecipeStep> Steps = new Dictionary<int, RecipeStep>();
  105. }
  106. }