123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Diagnostics;
- 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 Name { get; set; }
- 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 string BasePressure { get; set; }
- public string ChillerTemp { get; set; }
- }
- public class ProcessUnitBase
- {
- public Func<ProcessUnitBase, RecipeStep, RState> checker;
- public Func<ProcessUnitBase, RecipeStep, RState> starter;
- public string Name { get; set; }
- public ProcessModule Moudle { get; set; }
- public RState Start(RecipeStep step)
- {
- if (starter != null)
- return starter(this, step);
- return RState.Running;
- }
- public RState Run(RecipeStep step)
- {
- if (checker != null)
- return checker(this, step);
- 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(this);
- if (state != RState.Running)
- return state;
- }
- _stepTimer.Restart();
- return RState.Running;
- }
- public RState Run()
- {
- if (Type == StepType.Time && _stepTimer.ElapsedMilliseconds >= Time * 1000)
- return RState.End;
- foreach (var unit in lstUnit)
- {
- var state = unit.Run(this);
- if (state != RState.Running)
- return state;
- }
- return RState.Running;
- }
- public void AppendUnit(ProcessUnitBase unit)
- {
- lstUnit.Append(unit);
- }
- public double RampFactor()
- {
- return (double)_stepTimer.ElapsedMilliseconds / (Time * 1000.0);
- }
- private List<ProcessUnitBase> lstUnit = new List<ProcessUnitBase>();
- private Stopwatch _stepTimer = new Stopwatch();
- }
- public class Recipe
- {
- public RecipeHead Header { get; set; }
- public Dictionary<int, RecipeStep> Steps = new Dictionary<int, RecipeStep>();
- public static Recipe Load(string recipeFile)
- {
- return null;
- }
- public bool Validate()
- {
- return true;
- }
- public bool Save(string recipeFile)
- {
- return true;
- }
- }
- }
|