using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Venus_Core { public enum RecipeType { Chuck, Dechuck, Process, Clean, } public enum StepType { Time, Stable, EndPoint, OverEtch, } public enum ProcessModule { Pressure, TCP, // Transformer Coupled Plasma (转换耦合等离子) Bias, Gas, ESC, Process, Compound, } public enum GeneratorMode { Pulsing, CW, } public class RecipeHead { public string Version { get; set; } public RecipeType Type { get; set; } public string ChuckRecipe { get; set; } public string DechuckRecipe { get; set; } public string CreateTime { get; set; } public string LastModifiedBy { get; set; } public string Barcode { get; set; } } public class ProcessUnitBase { public Func checker; public Func starter; public string Name { get; set; } public ProcessModule Moudle { get; set; } public RState Start() { if (starter != null) return starter(); return RState.Running; } public RState Run() { if (checker != null) return checker(); return RState.Running; } } public class RecipeStep { public StepType Type { get; set; } public int Time { get; set; } public int MinEndPointTime { get; set; } public int MaxEndPointTime { get; set; } public bool CycleStart { get; set; } public bool CycleEnd { get; set; } public int CycleNumber { get; set; } public RState Start() { foreach(var unit in lstUnit) { var state = unit.Start(); if (state != RState.Running) return state; } return RState.Running; } public RState Run() { foreach (var unit in lstUnit) { var state = unit.Run(); if (state != RState.Running) return state; } return RState.Running; } public void AppendUnit(ProcessUnitBase unit) { lstUnit.Append(unit); } private List lstUnit = new List(); } class Recipe { public RecipeHead Header { get; set; } public Dictionary Steps = new Dictionary(); } }