|
@@ -0,0 +1,187 @@
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+//using System.
|
|
|
+using Venus_RT.Devices;
|
|
|
+using Venus_RT.Modules;
|
|
|
+using Aitex.Core.Util;
|
|
|
+using Venus_Core;
|
|
|
+//#pragma warning disable 0436
|
|
|
+
|
|
|
+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}
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ public ProcessHelper(JetPM pm)
|
|
|
+ {
|
|
|
+ Chamber = pm;
|
|
|
+ }
|
|
|
+
|
|
|
+ static private RState PressureUnitByPressureMode_Start(ProcessUnitBase unit, RecipeStep step)
|
|
|
+ {
|
|
|
+ var ProcessUnit = unit as PressureUnitByPressureMode;
|
|
|
+ if (Chamber.SetPVPressure(ProcessUnit.StartPressure))
|
|
|
+ {
|
|
|
+ return RState.Running;
|
|
|
+ }
|
|
|
+
|
|
|
+ return RState.Failed;
|
|
|
+ }
|
|
|
+
|
|
|
+ static private RState PressureUnitByPressureMode_Check(ProcessUnitBase unit, RecipeStep step)
|
|
|
+ {
|
|
|
+ var ProcessUnit = unit as PressureUnitByPressureMode;
|
|
|
+ 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 RState PressureUnitByValveMode_Start(ProcessUnitBase unit, RecipeStep step)
|
|
|
+ {
|
|
|
+ var ProcessUnit = unit as PressureUnitByValveMode;
|
|
|
+ if(Chamber.SetPVPostion(ProcessUnit.StartPosition))
|
|
|
+ {
|
|
|
+ return RState.Running;
|
|
|
+ }
|
|
|
+
|
|
|
+ return RState.Failed;
|
|
|
+ }
|
|
|
+
|
|
|
+ static private RState PressureUnitByValveMode_Check(ProcessUnitBase unit, RecipeStep step)
|
|
|
+ {
|
|
|
+ var ProcessUnit = unit as PressureUnitByValveMode;
|
|
|
+ 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 RState TCPUnit_Start(ProcessUnitBase unit, RecipeStep step)
|
|
|
+ {
|
|
|
+ var ProcessUnit = unit as TCPUnit;
|
|
|
+ return RState.Running;
|
|
|
+ }
|
|
|
+
|
|
|
+ static private RState TCPUnit_Check(ProcessUnitBase unit, RecipeStep step)
|
|
|
+ {
|
|
|
+ var ProcessUnit = unit as TCPUnit;
|
|
|
+ return RState.Running;
|
|
|
+ }
|
|
|
+
|
|
|
+ static private RState BiasUnit_Start(ProcessUnitBase unit, RecipeStep step)
|
|
|
+ {
|
|
|
+ var ProcessUnit = unit as BiasUnit;
|
|
|
+ return RState.Running;
|
|
|
+ }
|
|
|
+
|
|
|
+ static private RState BiasUnit_Check(ProcessUnitBase unit, RecipeStep step)
|
|
|
+ {
|
|
|
+ var ProcessUnit = unit as BiasUnit;
|
|
|
+ return RState.Running;
|
|
|
+ }
|
|
|
+
|
|
|
+ static private RState GasControlUnit_Start(ProcessUnitBase unit, RecipeStep step)
|
|
|
+ {
|
|
|
+ var ProcessUnit = unit as GasControlUnit;
|
|
|
+ return RState.Running;
|
|
|
+ }
|
|
|
+
|
|
|
+ static private RState GasControlUnit_Check(ProcessUnitBase unit, RecipeStep step)
|
|
|
+ {
|
|
|
+ var ProcessUnit = unit as GasControlUnit;
|
|
|
+ return RState.Running;
|
|
|
+ }
|
|
|
+
|
|
|
+ static private RState ESCHVUnit_Start(ProcessUnitBase unit, RecipeStep step)
|
|
|
+ {
|
|
|
+ var ProcessUnit = unit as ESCHVUnit;
|
|
|
+ return RState.Running;
|
|
|
+ }
|
|
|
+
|
|
|
+ static private RState ESCHVUnit_Check(ProcessUnitBase unit, RecipeStep step)
|
|
|
+ {
|
|
|
+ var ProcessUnit = unit as ESCHVUnit;
|
|
|
+ return RState.Running;
|
|
|
+ }
|
|
|
+
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public class test
|
|
|
+ {
|
|
|
+ test()
|
|
|
+ {
|
|
|
+ //PressureUnitByPressureMode mode = new PressureUnitByPressureMode();
|
|
|
+ //mode.Start();
|
|
|
+ //mode.Run();
|
|
|
+ //mode.
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|