123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364 |
- using System;
- using System.Collections.Generic;
- using Venus_RT.Devices;
- using Venus_RT.Modules;
- using Aitex.Core.Util;
- using Venus_Core;
- namespace Venus_RT.Modules.PMs
- {
- class ProcessHelper
- {
- static protected JetPM Chamber;
- private Dictionary<string, Func<ProcessUnitBase, RecipeStep, RState>> startHelper = new Dictionary<string, Func<ProcessUnitBase, RecipeStep, RState>>
- {
- {"PressureUnitByPressureMode", PressureUnitByPressureMode_Start},
- {"PressureUnitByValveMode", PressureUnitByValveMode_Start},
- {"TCPUnit", TCPUnit_Start},
- {"BiasUnit", BiasUnit_Start},
- {"GasControlUnit", GasControlUnit_Start },
- {"ESCHVUnit", ESCHVUnit_Start },
- {"ProcessKitUnit", ProcessKitUnit_Start },
- };
- private Dictionary<string, Func<ProcessUnitBase, RecipeStep, RState>> checkerHelper = new Dictionary<string, Func<ProcessUnitBase, RecipeStep, RState>>
- {
- {"PressureUnitByPressureMode", PressureUnitByPressureMode_Check},
- {"PressureUnitByValveMode", PressureUnitByValveMode_Check},
- {"TCPUnit", TCPUnit_Check},
- {"BiasUnit", BiasUnit_Check},
- {"GasControlUnit", GasControlUnit_Check},
- {"ESCHVUnit", ESCHVUnit_Check},
- {"ProcessKitUnit", ProcessKitUnit_Check}
- };
- private Dictionary<string, Action<ProcessUnitBase, RecipeStep>> endHelper = new Dictionary<string, Action<ProcessUnitBase, RecipeStep>>
- {
- {"PressureUnitByPressureMode", PressureUnitByPressureMode_End},
- {"PressureUnitByValveMode", PressureUnitByValveMode_End},
- {"TCPUnit", TCPUnit_End},
- {"BiasUnit", BiasUnit_End},
- {"GasControlUnit", GasControlUnit_End},
- {"ESCHVUnit", ESCHVUnit_End},
- {"ProcessKitUnit", ProcessKitUnit_End}
- };
- public ProcessHelper(JetPM pm)
- {
- Chamber = pm;
- }
- static private RState PressureUnitByPressureMode_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as PressureByPressureModeUnit;
- if (Chamber.SetPVPressure(ProcessUnit.StartPressure))
- {
- return RState.Running;
- }
- return RState.Failed;
- }
- static private RState PressureUnitByPressureMode_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as PressureByPressureModeUnit;
- if(ProcessUnit.EnableRamp)
- {
- if (Chamber.SetPVPressure(ProcessUnit.StartPressure + (int)((ProcessUnit.TargetPressure - ProcessUnit.StartPressure) * step.RampFactor())))
- return RState.Running;
- else
- return RState.Failed;
- }
- if(step.Type == StepType.Stable && Chamber.ChamberPressure == ProcessUnit.StartPressure)
- {
- return RState.End;
- }
- return RState.Running;
- }
- static private void PressureUnitByPressureMode_End(ProcessUnitBase unit, RecipeStep step)
- {
- }
- static private RState PressureUnitByValveMode_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as PressureByValveModeUnit;
- if(Chamber.SetPVPostion(ProcessUnit.StartPosition))
- {
- return RState.Running;
- }
- return RState.Failed;
- }
- static private RState PressureUnitByValveMode_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as PressureByValveModeUnit;
- if(ProcessUnit.EnableRamp)
- {
- if (Chamber.SetPVPostion(ProcessUnit.StartPosition + (int)((ProcessUnit.TargetPosition - ProcessUnit.StartPosition) * step.RampFactor())))
- return RState.Running;
- else
- return RState.Failed;
- }
- return RState.Running;
- }
- static private void PressureUnitByValveMode_End(ProcessUnitBase unit, RecipeStep step)
- {
- }
- static private RState TCPUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as TCPUnit;
- Chamber.GeneratorSetpower(ProcessUnit.RFPower);
- Chamber.GeneratorPowerOn(true);
- Chamber.SetMatchPosition(ProcessUnit.TuneCapPreset, ProcessUnit.LoadCapPreset);
- return RState.Running;
- }
- static private RState TCPUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as TCPUnit;
- if(ProcessUnit.MaxReflectedPower > 0 && Chamber.ReflectPower > ProcessUnit.MaxReflectedPower)
- {
- return RState.Failed;
- }
- if(step.ElapsedTime > ProcessUnit.HoldTime * 1000)
- {
- Chamber.GeneratorSetpower(0);
- Chamber.GeneratorPowerOn(false);
- }
- return RState.Running;
- }
- static private void TCPUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- Chamber.GeneratorSetpower(0);
- Chamber.GeneratorPowerOn(false);
- }
- static private RState BiasUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as BiasUnit;
- Chamber.GeneratorBiasSetpower(ProcessUnit.BiasRFPower);
- Chamber.GeneratorBiasPowerOn(true);
- Chamber.SetBiasMatchPosition(ProcessUnit.BiasTuneCapPreset, ProcessUnit.BiasLoadCapPreset);
- if(ProcessUnit.BiasGeneratorMode == GeneratorMode.Pulsing)
- {
- Chamber.SetBiasPulseMode(true);
- Chamber.SetBiasPulseRateFreq(ProcessUnit.PulseRateFreq);
- Chamber.SetDiasPulseDutyCycle(ProcessUnit.PulseDutyCycle);
- }
- return RState.Running;
- }
- static private RState BiasUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as BiasUnit;
- if (ProcessUnit.BiasMaxReflectedPower > 0 && Chamber.BiasReflectPower > ProcessUnit.BiasMaxReflectedPower)
- {
- return RState.Failed;
- }
- if (step.ElapsedTime > ProcessUnit.BiasRFHoldTime * 1000)
- {
- Chamber.GeneratorBiasSetpower(0);
- Chamber.GeneratorBiasPowerOn(false);
- }
- return RState.Running;
- }
- static private void BiasUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- Chamber.GeneratorBiasSetpower(0);
- Chamber.GeneratorBiasPowerOn(false);
- }
- static private RState GasControlUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as GasControlUnit;
- Chamber.FlowGas(0, ProcessUnit.Gas1);
- Chamber.FlowGas(1, ProcessUnit.Gas2);
- Chamber.FlowGas(2, ProcessUnit.Gas3);
- Chamber.FlowGas(3, ProcessUnit.Gas4);
- Chamber.FlowGas(4, ProcessUnit.Gas5);
- Chamber.FlowGas(5, ProcessUnit.Gas6);
- Chamber.FlowGas(6, ProcessUnit.Gas7);
- Chamber.FlowGas(7, ProcessUnit.Gas8);
- return RState.Running;
- }
- static private RState GasControlUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as GasControlUnit;
- if(ProcessUnit.EnableRamp)
- {
- double rampFactor = step.RampFactor();
- Chamber.FlowGas(0, ProcessUnit.Gas1 + (ProcessUnit.Gas1Target - ProcessUnit.Gas1) * rampFactor);
- Chamber.FlowGas(1, ProcessUnit.Gas2 + (ProcessUnit.Gas2Target - ProcessUnit.Gas2) * rampFactor);
- Chamber.FlowGas(2, ProcessUnit.Gas3 + (ProcessUnit.Gas3Target - ProcessUnit.Gas3) * rampFactor);
- Chamber.FlowGas(3, ProcessUnit.Gas4 + (ProcessUnit.Gas4Target - ProcessUnit.Gas4) * rampFactor);
- Chamber.FlowGas(4, ProcessUnit.Gas5 + (ProcessUnit.Gas5Target - ProcessUnit.Gas5) * rampFactor);
- Chamber.FlowGas(5, ProcessUnit.Gas6 + (ProcessUnit.Gas6Target - ProcessUnit.Gas6) * rampFactor);
- Chamber.FlowGas(6, ProcessUnit.Gas7 + (ProcessUnit.Gas7Target - ProcessUnit.Gas7) * rampFactor);
- Chamber.FlowGas(7, ProcessUnit.Gas8 + (ProcessUnit.Gas8Target - ProcessUnit.Gas8) * rampFactor);
- }
- return RState.Running;
- }
- static private void GasControlUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- Chamber.FlowGas(0, 0);
- Chamber.FlowGas(1, 0);
- Chamber.FlowGas(2, 0);
- Chamber.FlowGas(3, 0);
- Chamber.FlowGas(4, 0);
- Chamber.FlowGas(5, 0);
- Chamber.FlowGas(6, 0);
- Chamber.FlowGas(7, 0);
- }
- static private RState ESCHVUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as ESCHVUnit;
- Chamber.SetESCClampVoltage(ProcessUnit.ESCClampValtage);
- Chamber.SetBacksideHePressure(ProcessUnit.BacksideHelum * 1000);
- Chamber.SetBacksideHeThreshold(ProcessUnit.MinHeFlow, ProcessUnit.MaxHeFlow);
- return RState.Running;
- }
- static private RState ESCHVUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- if(Chamber.BackSideHeOutOfRange)
- {
- return RState.Failed;
- }
- return RState.Running;
- }
- static private void ESCHVUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- Chamber.SetESCClampVoltage(0);
-
- Chamber.SetBacksideHeThreshold(0, 0);
- }
- static private RState ProcessKitUnit_Start(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as ProcessKitUnit;
- return RState.Running;
- }
- static private RState ProcessKitUnit_Check(ProcessUnitBase unit, RecipeStep step)
- {
- var ProcessUnit = unit as ProcessKitUnit;
- return RState.Running;
- }
- static private void ProcessKitUnit_End(ProcessUnitBase unit, RecipeStep step)
- {
- }
- public bool LoadMethods(ProcessUnitBase unit)
- {
- var className = unit.GetType().Name;
- if(startHelper.ContainsKey(className) && checkerHelper.ContainsKey(className))
- {
- unit.starter = startHelper[className];
- unit.checker = checkerHelper[className];
- unit.end = endHelper[className];
- return true;
- }
- return false;
- }
- private static RState stepStarter(RecipeStep step)
- {
- return RState.Running;
- }
- private static RState stepChecker(RecipeStep step)
- {
- switch(step.Type)
- {
- case StepType.Time:
- return step.ElapsedTime > step.Time ? RState.End : RState.Running;
- case StepType.EndPoint:
- return Chamber.CheckEndPoint() ? RState.End : RState.Running;
- }
- return RState.Running;
- }
- public bool LoadStepFuns(RecipeStep step)
- {
- step.starter = stepStarter;
- step.checker = stepChecker;
- return true;
- }
- #region EndPoint
- public static bool CheckEndPoint()
- {
- return Chamber.CheckEndPoint();
- }
- public static void StartEndPoint(string config, int index)
- {
- Chamber.StartEndPoint(config, index);
- }
- public static void StopEndPoint()
- {
- Chamber.StopEndPoint();
- }
- public static void EndPointRecipeStop()
- {
- Chamber.EndPointRecipeStop();
- }
- public static void EndPointRecipeStart(string recipeName)
- {
- Chamber.EndPointRecipeStart(recipeName);
- }
- #endregion
- }
- public class test
- {
- test()
- {
-
-
-
-
-
- }
- }
- }
|