Browse Source

process module 1215

sangwq 2 years ago
parent
commit
0606b882bc

+ 4 - 0
Venus/Venus_Core/EventDefine.cs

@@ -24,5 +24,9 @@ namespace Aitex.Core.RT.Log{
 		ERR_ESC_HV = 1005,
 		ERR_TURBO_PUMP = 1006,
 		ERR_RF = 1007,
+		INFO_DEVICE_CHILLER = 1008,
+		WARN_DEVICE_CHILLER = 1009,
+		ERR_DEVICE_CHILLER = 1010,
+		WARN_RF = 1011,
 	}
 }

+ 1 - 1
Venus/Venus_Core/ProcessUnitDefine.cs

@@ -22,7 +22,7 @@ namespace Venus_Core
     /// </summary>
  
 
-    public class PressureUnitByPressureMode : ProcessUnitBase
+    public partial class PressureUnitByPressureMode : ProcessUnitBase
     {
         public bool EnableRamp { get; set; }
         public int StartPressure { get; set; }

+ 24 - 9
Venus/Venus_Core/Recipe.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Diagnostics;
 
 namespace Venus_Core
 {
@@ -40,6 +41,7 @@ namespace Venus_Core
 
     public class RecipeHead
     {
+        public string Name { get; set; }
         public string Version { get; set; }
         public RecipeType Type { get; set; }
         public string ChuckRecipe { get; set; }
@@ -48,26 +50,29 @@ namespace Venus_Core
         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<RState> checker;
-        public Func<RState> starter;
+        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()
+        public RState Start(RecipeStep step)
         {
             if (starter != null)
-                return starter();
+                return starter(this, step);
 
             return RState.Running;
         }
-        public RState Run()
+        public RState Run(RecipeStep step)
         {
             if (checker != null)
-                return checker();
+                return checker(this, step);
 
             return RState.Running;
         }
@@ -88,18 +93,22 @@ namespace Venus_Core
         { 
             foreach(var unit in lstUnit)
             {
-                var state = unit.Start();
+                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();
+                var state = unit.Run(this);
                 if (state != RState.Running)
                     return state;
             }
@@ -112,11 +121,17 @@ namespace Venus_Core
             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();
     }
 
 
-    class Recipe
+    public class Recipe
     {
         public RecipeHead Header { get; set; }
         public Dictionary<int, RecipeStep> Steps = new Dictionary<int, RecipeStep>();

+ 36 - 0
Venus/Venus_RT/Config/LogDefine.json

@@ -205,5 +205,41 @@
     "GlobalDescription_en": "RF error: {0}",
     "Module": "PM",
     "Note": "RF Alarm"
+  },
+  {
+    "Id": 1008,
+    "Level": "Info",
+    "LogEnum": "INFO_DEVICE_CHILLER",
+    "GlobalDescription_zh": "Chiller: {0}",
+    "GlobalDescription_en": "Chiller: {0}",
+    "Module": "PM",
+    "Note": "Chiller Info"
+  },
+  {
+    "Id": 1009,
+    "Level": "Warning",
+    "LogEnum": "WARN_DEVICE_CHILLER",
+    "GlobalDescription_zh": "Chiller warning: {0}",
+    "GlobalDescription_en": "Chiller warning: {0}",
+    "Module": "PM",
+    "Note": "Chiller Warning"
+  },
+  {
+    "Id": 1010,
+    "Level": "Error",
+    "LogEnum": "ERR_DEVICE_CHILLER",
+    "GlobalDescription_zh": "Chiller alarm: {0}",
+    "GlobalDescription_en": "Chiller alarm: {0}",
+    "Module": "PM",
+    "Note": "Chiller Alarm"
+  },
+  {
+    "Id": 1011,
+    "Level": "Warning",
+    "LogEnum": "WARN_RF",
+    "GlobalDescription_zh": "RF warning: {0}",
+    "GlobalDescription_en": "RF warning: {0}",
+    "Module": "PM",
+    "Note": "RF warning"
   }
 ]

+ 2 - 22
Venus/Venus_RT/Config/System.sccfg

@@ -160,16 +160,6 @@
 			<config default="20" name="ToleranceAlarmRange" nameView="Tolerance Alarm Range" description="Tolerance Alarm Range" max="200" min="0" paramter="" tag="" unit="℃" type="Integer" />
 			<config default="60" name="ToleranceAlarmTime" nameView="Tolerance Alarm Time" description="Tolerance Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 		</configs>
-		<configs name="GridChiller" nameView="Grid Chiller" >
-			<config default="true" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
-			<!--<config default="false" name="ChillerSameWithPMB" nameView="Chiller Same With PMB" description="enable chiller same with PMB or not" max="1" min="0" tag="" unit="" type="Bool" />-->
-			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC;" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
-			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
-			<config default="COM12" name="Port" nameView="Port" description="serial port name of pump" max="" min="" paramter="" tag="" unit="" type="String" />
-			<config default="10" name="ChillerTemperatureOffset" nameView="Chiller Temperature Offset" description="" max="10" min="-10" paramter="" tag="" unit="degree" type="Double" />
-			<config default="300" name="SetPointLimitMax" nameView="Chiller Set Point Limit Max" description="" max="500" min="0" paramter="" tag="" unit="degree" type="Double" />
-			<config default="0" name="SetPointLimitMin" nameView="Chiller Set Point Limit Min" description="" max="500" min="0" paramter="" tag="" unit="degree" type="Double" />
-		</configs>
 		<configs name="DryPump" nameView="Dry Pump" >
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:Sky; 2:Edwards" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -378,7 +368,7 @@
 			<config default="30" name="LeakRate" nameView="Leak Rate" description="" max="756000" min="0" paramter="" tag="" unit="mTorrPerMin" type="Double" />
 			<config default="300" name="LeakCheckPumpingTime" nameView="Leak Check Pumping Time" description="" max="3000" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="180" name="LeakCheckHoldTime" nameView="Leak Check Hold Time" description="" max="3000" min="0" paramter="" tag="" unit="" type="Integer" />
-			<config default="150" name="PumpBasePressure" nameView="Pump Base Pressure" description="" max="756000" min="0" paramter="" tag="" unit="mTorr" type="Integer" />
+			<config default="10" name="PumpBasePressure" nameView="Pump Base Pressure" description="" max="756000" min="0" paramter="" tag="" unit="mTorr" type="Integer" />
 			<config default="1" name="LeakCheckBasePressure" nameView="Leak Check Base Pressure" description="" max="100" min="0" paramter="" tag="" unit="mTorr" type="Double" />
 			<config default="1,2,3,4,5,6,7,8" name="LeakCheckGasLineNums" nameView="LeakCheck GasLineNums" description="GasLine numbers for Leak Check" tag="" unit="" type="String" />
 			<config default="120" name="PumpTimeLimit" nameView="Pump Time Limit" description="" max="3000" min="0" paramter="" tag="" unit="" type="Double" />
@@ -611,16 +601,6 @@
 			<config default="20" name="ToleranceAlarmRange" nameView="Tolerance Alarm Range" description="Tolerance Alarm Range" max="200" min="0" paramter="" tag="" unit="℃" type="Integer" />
 			<config default="60" name="ToleranceAlarmTime" nameView="Tolerance Alarm Time" description="Tolerance Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 		</configs>
-		<configs name="GridChiller" nameView="Grid Chiller" >
-			<config default="true" name="EnableChiller" nameView="Enable Chiller" description="enable chiller or not" max="1" min="0" tag="" unit="" type="Bool" />
-			<!--<config default="false" name="ChillerSameWithPMB" nameView="Chiller Same With PMB" description="enable chiller same with PMB or not" max="1" min="0" tag="" unit="" type="Bool" />-->
-			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:SMC;" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
-			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
-			<config default="COM12" name="Port" nameView="Port" description="serial port name of pump" max="" min="" paramter="" tag="" unit="" type="String" />
-			<config default="10" name="ChillerTemperatureOffset" nameView="Chiller Temperature Offset" description="" max="10" min="-10" paramter="" tag="" unit="degree" type="Double" />
-			<config default="300" name="SetPointLimitMax" nameView="Chiller Set Point Limit Max" description="" max="500" min="0" paramter="" tag="" unit="degree" type="Double" />
-			<config default="0" name="SetPointLimitMin" nameView="Chiller Set Point Limit Min" description="" max="500" min="0" paramter="" tag="" unit="degree" type="Double" />
-		</configs>
 		<configs name="DryPump" nameView="Dry Pump" >
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:Sky; 2:Edwards" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -763,7 +743,7 @@
 			<config default="30" name="LeakRate" nameView="Leak Rate" description="" max="756000" min="0" paramter="" tag="" unit="mTorrPerMin" type="Double" />
 			<config default="180" name="LeakCheckPumpingTime" nameView="Leak Check Pumping Time" description="" max="3000" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="180" name="LeakCheckWaitTime" nameView="Leak Check Wait Time" description="" max="3000" min="0" paramter="" tag="" unit="" type="Integer" />
-			<config default="150" name="PumpBasePressure" nameView="Pump Base Pressure" description="" max="756000" min="0" paramter="" tag="" unit="mTorr" type="Integer" />
+			<config default="10" name="PumpBasePressure" nameView="Pump Base Pressure" description="" max="756000" min="0" paramter="" tag="" unit="mTorr" type="Integer" />
 			<config default="120" name="PumpTimeLimit" nameView="Pump Time Limit" description="" max="3000" min="0" paramter="" tag="" unit="" type="Double" />
 			<config default="5" name="PumpValveDelay" nameView="Pump Valve Delay" description="" max="3000" min="0" paramter="" tag="" unit="s" type="Integer" />
 		</configs>

+ 2 - 2
Venus/Venus_RT/Devices/AdTecRF.cs

@@ -507,7 +507,7 @@ namespace Venus_RT.Devices
             string str2 = str.Trim('\r');
             if (str2 == AdTecRfMessage.ERR_RES)
             {
-                EV.PostWarningLog(Module, $"AdTEC 收到 [{str2}]");
+                LOG.Write(eEvent.WARN_RF, Module, $"AdTEC 收到 [{str2}]");
                 return;
             }
 
@@ -522,7 +522,7 @@ namespace Venus_RT.Devices
 
                     if (!SC.GetValue<bool>("System.IsSimulatorMode"))
                     {
-                        //LOG.Write($"{Module}, AdTec 数据格式错误");
+                        LOG.Write( eEvent.WARN_RF, Module,$"{Module}, AdTec 数据格式错误");
                     }
 
                     return;

+ 0 - 7
Venus/Venus_RT/Devices/DeviceManager.cs

@@ -70,13 +70,6 @@ namespace Venus_RT.Instances
                 AddCustomModuleDevice(new SMCChiller(mod, "Chiller"));
             }
 
-            if (SC.GetValue<bool>($"{mod}.GridChiller.EnableChiller") &&
-                SC.GetValue<int>($"{mod}.GridChiller.CommunicationType") == (int)CommunicationType.RS232 &&
-                SC.GetValue<int>($"{mod}.GridChiller.MFG") == (int)ChillerMFG.SMC)
-            {
-                AddCustomModuleDevice(new SMCChiller(mod, "GridChiller"));
-            }
-
             if (SC.GetValue<bool>($"{mod}.match.EnableMatch") &&
                 SC.GetValue<int>($"{mod}.match.CommunicationType") == (int)CommunicationType.RS232 &&
                 SC.GetValue<int>($"{mod}.match.MFG") == (int)MatchMFG.AdTec)

+ 34 - 0
Venus/Venus_RT/Devices/JetPM.cs

@@ -96,6 +96,8 @@ namespace Venus_RT.Devices
         private readonly AdixenTurboPump _TurboPump;
         private readonly PendulumValve _pendulumValve;
 
+        private readonly SMCChiller _Chiller;
+
         private readonly IoSignalTower _SignalTower;
 
         private readonly IoHeater _ForelineTC;
@@ -137,6 +139,7 @@ namespace Venus_RT.Devices
         public bool IsVACLoadLock => LoadlockPressure <= 1000;
         public bool IsVAC => _VAC_sw.Value;
         public bool IsWLK => _WLK_sw.Value;
+        public bool IsRFGInterlockOn => _RFG_Interlock.Value;
 
         public double ProcessPressure => _pressureController.ProcessGauge.Value;
         public override double ChamberPressure => _pressureController.PressureGauge.Value;
@@ -145,6 +148,9 @@ namespace Venus_RT.Devices
         public double LoadlockPressure => _pressureController.LoadLockGauge.Value;
         public double ESCHePressure => _pressureController.ESCHeGauge.Value;
 
+        public float CoolantInletTempFB => _Chiller.CoolantInletTcFeedback;
+        public float CoolantOutletTempFB => _Chiller.CoolantOutletTcFeedback;
+
         //Loadlock_Arm
         public bool IsLoadlockArmRetract => _LoadLockArm.OFFFeedback;
         public bool IsLoadlockArmExtend => _LoadLockArm.ONFeedback;
@@ -303,6 +309,13 @@ namespace Venus_RT.Devices
             _ESCHV          = DEVICE.GetDevice<ESC5HighVoltage>($"{Module}.{VenusDevice.ESCHV}");
             _TurboPump      = DEVICE.GetDevice<AdixenTurboPump>($"{Module}.{VenusDevice.TurboPump}");
             _pendulumValve  = DEVICE.GetDevice<PendulumValve>($"{ Module}.{VenusDevice.PendulumValve}");
+
+            if (SC.GetValue<bool>($"{mod}.Chiller.EnableChiller") &&
+                SC.GetValue<int>($"{mod}.Chiller.CommunicationType") == (int)CommunicationType.RS232 &&
+                SC.GetValue<int>($"{mod}.Chiller.MFG") == (int)ChillerMFG.SMC)
+            {
+                _Chiller = DEVICE.GetDevice<SMCChiller>($"{Module}.{VenusDevice.Chiller}");
+            }
         }
 
 
@@ -546,5 +559,26 @@ namespace Venus_RT.Devices
         {
             return _pendulumValve.TurnValve(on);
         }
+
+        public bool SetPVPressure(int pressure)
+        {
+            return _pendulumValve.SetPressure(pressure);
+        }
+
+        public bool SetPVPostion(int position)
+        {
+            return _pendulumValve.SetPosition(position);
+        }
+
+        public void HeatChiller(double value, double offset)
+        {
+            _Chiller?.SetChillerTemp((float)value, (float)offset);
+            _Chiller?.SetChillerOnOff(true);
+        }
+
+        public bool CheckChillerStatus()
+        {
+            return _Chiller != null && _Chiller.IsRunning && !_Chiller.IsError;
+        }
     }
 }

+ 29 - 9
Venus/Venus_RT/Devices/PendulumValve.cs

@@ -347,23 +347,43 @@ namespace Venus_RT.Devices
             return true;
         }
 
-        public void SetPosition(int postion)
+        public bool SetPosition(int postion)
         {
-            SendCommand(Operation.SetPosition, postion);
+            if(_CheckStatus())
+            {
+                return SendCommand(Operation.SetPosition, postion);
+            }
+
+            return false;
         }
 
-        public void SetPressure(int pressure)
+        public bool SetPressure(int pressure)
         {
-            SendCommand(Operation.SetPressure, pressure);
+            if(_CheckStatus())
+            {
+                return SendCommand(Operation.SetPressure, pressure);
+            }
+
+            return false;
         }
 
-        public void Hold()
+        public bool Hold()
         {
-            SendCommand(Operation.Hold);
+            return SendCommand(Operation.Hold);
         }
 
         public bool TurnValve(bool on)
         {
+            if(_CheckStatus(on))
+            {
+                return SendCommand(on ? Operation.OpenValve : Operation.CloseValve);
+            }
+
+            return false;
+        }
+
+        bool _CheckStatus(bool bTurnOn = false)
+        {
             if (Status != null && Status[1] == 'E')
             {
                 _noRepeatAlarm($"PendulumValve is error status, can do turn on/off operation.");
@@ -371,19 +391,19 @@ namespace Venus_RT.Devices
             }
 
             var _chamber = DEVICE.GetDevice<JetPM>(Module);
-            if (on && !_chamber.IsTurboPumpAtSpeed)
+            if (bTurnOn && !_chamber.IsTurboPumpAtSpeed)
             {
                 _noRepeatAlarm($"Turbo Pump not at speed, can not turn on pendulum valve.");
                 return false;
             }
 
-            if(_chamber.ForelinePressure > 500)
+            if (_chamber.ForelinePressure > 500)
             {
                 _noRepeatAlarm($"Foreline Pressure:{_chamber.ForelinePressure} is too high, can not turn on pendulum valve.");
                 return false;
             }
 
-            return SendCommand(on ? Operation.OpenValve : Operation.CloseValve);
+            return true;
         }
     }
 }

+ 10 - 10
Venus/Venus_RT/Devices/SMCChiller.cs

@@ -272,7 +272,7 @@ namespace Venus_RT.Devices
             if (!_serial.Open())
             {
                 StatusSMC = SMCChillerState.Disconnected;
-                EV.PostAlarmLog(this.Module, "SMC Chiller串口无法打开");
+                LOG.Write( eEvent.ERR_DEVICE_CHILLER, Module, "SMC Chiller串口无法打开");
                 return false;
             }
 
@@ -299,14 +299,14 @@ namespace Venus_RT.Devices
                 }
                 if (string.IsNullOrEmpty(obj))
                 {
-                    //LOG.Error($"[{Module}] smc chiller message IsNullOrEmpty");
+                    LOG.Write(eEvent.ERR_DEVICE_CHILLER, Module, $"[{Module}] smc chiller message IsNullOrEmpty");
                     return;
                 }
                 string cmd = obj.Split(new char[] { '\r', '\n' })[0];
                 if (ModbusUtility.CalculateLrc(ModbusUtility.HexToBytes(cmd.Substring(1, cmd.Length - 3))).ToString("X2") !=
                     cmd.Substring(cmd.Length - 2))  //LRC check
                 {
-                    //LOG.Error($"[{Module}] smc chiller message LRC check error");
+                    LOG.Write(eEvent.ERR_DEVICE_CHILLER, Module, $"[{Module}] smc chiller message LRC check error");
                     return;
                 }
                 switch (cmd.Substring(3, 2))    //function code
@@ -368,7 +368,7 @@ namespace Venus_RT.Devices
             }
             catch (Exception ex)
             {
-                //LOG.Error($"[{Module}] smc chiller error: [{ex.Message}]");
+                LOG.Write(eEvent.ERR_DEVICE_CHILLER,  Module, $"[{Module}] smc chiller error: [{ex.Message}]");
             }
         }
 
@@ -376,7 +376,7 @@ namespace Venus_RT.Devices
         private void OnErrorOccurred(string obj)
         {
             StatusSMC = SMCChillerState.ERROR;
-            //LOG.Error($"[{Module}] smc chiller error: [{obj}]");
+            LOG.Write(eEvent.ERR_DEVICE_CHILLER, Module, $"[{Module}] smc chiller error: [{obj}]");
         }
 
         public override void Monitor()
@@ -404,9 +404,9 @@ namespace Venus_RT.Devices
                     {
                         //报警一次
                         if (NeedToStop[i])
-                            EV.PostAlarmLog(this.Module, AlarmMsg[i]);
+                            LOG.Write(eEvent.ERR_DEVICE_CHILLER, Module, AlarmMsg[i]);
                         else
-                            EV.PostWarningLog(this.Module, AlarmMsg[i]);
+                            LOG.Write(eEvent.WARN_DEVICE_CHILLER, Module, AlarmMsg[i]);
                     }
                     LastAlarmflag[i] = Alarmflag[i];
                 }
@@ -419,7 +419,7 @@ namespace Venus_RT.Devices
 
                     if (_toleranceChecker.Trig)
                     {
-                        EV.PostAlarmLog(Module, Display + $" temperature out of tolerance in {time:0} seconds");
+                        LOG.Write(eEvent.ERR_DEVICE_CHILLER, Module, Display + $" temperature out of tolerance in {time:0} seconds");
                     }
                 }
                 else
@@ -430,7 +430,7 @@ namespace Venus_RT.Devices
             }
             catch (Exception ex)
             {
-                //LOG.Write(ex);
+                LOG.Write(eEvent.ERR_DEVICE_CHILLER, Module, ex.ToString());
             }
         }
 
@@ -481,7 +481,7 @@ namespace Venus_RT.Devices
 
             _controlTcSetPoint = temp;
 
-            //LOG.Write($"{Module} {Name} set temperature to {isettemp}");
+            LOG.Write(eEvent.INFO_DEVICE_CHILLER, Module, $"{Module} {Name} set temperature to {isettemp}");
 
             return true;
         }

+ 209 - 4
Venus/Venus_RT/Modules/PMs/PMProcessRoutine.cs

@@ -1,7 +1,9 @@
-using Aitex.Core.RT.Routine;
+using System;
+using System.Collections.Generic;
+using Aitex.Core.RT.Routine;
 using Aitex.Core.RT.SCCore;
 using Venus_RT.Devices;
-using MECF.Framework.Common.Routine;
+using MECF.Framework.Common.SubstrateTrackings;
 using System.Text.Json;
 using Venus_Core;
 namespace Venus_RT.Modules.PMs
@@ -10,24 +12,227 @@ namespace Venus_RT.Modules.PMs
     {
         private enum ProcessStep
         {
+            kPreparePressure,
+            kPrepareTemperature,
+            kRunRecipes,
+            kEnd,
         }
+        public string CurrentRunningRecipe { get; set; }
+        public string ProcessRecipeName { get; set; }
+        public string ChuckRecipeName { get; set; }
+        public string DechuckRecipeNamae { get; set; }
+        public string CleanRecipeName { get; set; }
+        public RecipeHead ProcessRecipeHead { get; set; }
+        public DateTime RecipeStartTime { get; private set; }
 
-        public PMProcessRoutine(JetPM chamber) : base(chamber)
+        private readonly PumpDownRoutine _pumpDownRoutine;
+        private bool _withWafer = true;
+        private bool _needPumpDown = false;
+        private Recipe _currentRecipe = null;
+        private int _currentStep = 0;
+        private Queue<Recipe> _qeRecipes = new Queue<Recipe>();
+
+        private double _tolerance;
+        private double _OffsetTemp = 0.0f;
+
+        private double ChillerTemp
+        {
+            get
+            {
+                if (ProcessRecipeHead != null)
+                {
+                    if (!string.IsNullOrEmpty(ProcessRecipeHead.ChillerTemp))
+                    {
+                        double setpoint = Convert.ToDouble(ProcessRecipeHead.ChillerTemp);
+                        if (setpoint > 0 && setpoint < 600)
+                            return setpoint;
+                    }
+                }
+
+                return 0;
+            }
+        }
+        private double BasePressure
+        {
+            get
+            {
+                if (ProcessRecipeHead != null)
+                {
+                    if (!string.IsNullOrEmpty(ProcessRecipeHead.BasePressure))
+                    {
+                        double setpoint = Convert.ToDouble(ProcessRecipeHead.BasePressure);
+                        if (setpoint > 0 && setpoint < 750000)
+                            return setpoint;
+                    }
+                }
+                return SC.GetValue<int>($"{Module}.Pump.PumpBasePressure");
+            }
+        }
+        public double EstimatedTotalLeftTime
+        {
+            get;
+            private set;
+        }
+
+        public PMProcessRoutine(JetPM chamber, PumpDownRoutine pdRoutine) : base(chamber)
         {
             Name = "Process";
+            _pumpDownRoutine = pdRoutine;
         }
 
         public RState Start(params object[] objs)
         {
+            if (_withWafer && WaferManager.Instance.CheckNoWafer(Module.ToString(), 0))
+            {
+                Stop($"can not run process, no wafer at {Module}");
+                return RState.Failed;
+            }
 
-            return RState.Failed;
+            if (!CheckSlitDoor() || !CheckDryPump() || !CheckTurboPump())
+            {
+                return RState.Failed;
+            }
+
+            // Load/Validate Recipe
+            _qeRecipes.Clear();
+            string recipeName = (string)objs[0];
+            Recipe recipe = Recipe.Load(recipeName);
+            if(recipe == null)
+            {
+                return RState.Failed;
+            }
+            switch(recipe.Header.Type)
+            {
+                case RecipeType.Process:
+                    var chuckRecipe = Recipe.Load(recipe.Header.ChuckRecipe);
+                    var dechuckRecipe = Recipe.Load(recipe.Header.DechuckRecipe);
+                    if(chuckRecipe == null || dechuckRecipe == null)
+                    {
+                        return RState.Failed;
+                    }
+
+                    ProcessRecipeName = recipeName;
+                    ChuckRecipeName = recipe.Header.ChuckRecipe;
+                    DechuckRecipeNamae = recipe.Header.DechuckRecipe;
+                    _qeRecipes.Enqueue(chuckRecipe);
+                    _qeRecipes.Enqueue(recipe);
+                    _qeRecipes.Enqueue(dechuckRecipe);
+                    break;
+                case RecipeType.Chuck:
+                    ChuckRecipeName = recipeName;
+                    _qeRecipes.Enqueue(recipe);
+                    break;
+                case RecipeType.Dechuck:
+                    DechuckRecipeNamae = recipeName;
+                    _qeRecipes.Enqueue(recipe);
+                    break;
+                case RecipeType.Clean:
+                    CleanRecipeName = recipeName;
+                    _qeRecipes.Enqueue(recipe);
+                    break;
+            }
+
+            _tolerance = SC.GetValue<double>($"System.MaxTemperatureToleranceToTarget");
+            _OffsetTemp = SC.GetValue<double>($"{Module}.Chiller.ChillerTemperatureOffset");
+            return Runner.Start(Module, Name);
         }
         public RState Monitor()
         {
+            Runner.Run((int)ProcessStep.kPreparePressure,   PreparePressure,    IsPressureReady)
+                .Run((int)ProcessStep.kPrepareTemperature,  PrepareTemp,        IsTempReady)
+                .Run((int)ProcessStep.kRunRecipes,          StartNewRecipe,     RunRecipes)
+                .End((int)ProcessStep.kEnd,                 ProcessDone,        _delay_1s);
 
             return Runner.Status;
         }
 
+        private bool PreparePressure()
+        {
+            if(_chamber.ChamberPressure < BasePressure)
+            {
+                _needPumpDown = false;
+                return true;
+            }
+
+            _needPumpDown = true;
+            return _pumpDownRoutine.Start(BasePressure) == RState.Running;
+        }
+
+        private bool IsPressureReady()
+        {
+            if (_needPumpDown == false)
+                return true;
+
+            var status = _pumpDownRoutine.Monitor();
+            if(status == RState.End)
+            {
+                return true;
+            }
+            else if (status == RState.Failed || status == RState.Timeout)
+            {
+                Runner.Stop($"Pump down to {BasePressure} failed.");
+                return true;
+            }
+
+            return false;
+        }
+
+        private bool PrepareTemp()
+        {
+            return SetCoolantTemp(ChillerTemp, _OffsetTemp);
+            //return true;
+        }
+
+        private bool IsTempReady()
+        {
+            return CheckCoolantTemp(ChillerTemp, _tolerance);
+        }
+
+        private bool StartNewRecipe()
+        {
+            if(_qeRecipes.Count > 0)
+            {
+                _currentStep = 0;
+                _currentRecipe = _qeRecipes.Dequeue();
+                CurrentRunningRecipe = _currentRecipe.Header.Name;
+                _currentRecipe.Steps[_currentStep].Start();
+                Notify($"Recipe:{CurrentRunningRecipe} start");
+                return true;
+            }
+            
+            return false;
+        }
+        private bool RunRecipes()
+        {
+            var step = _currentRecipe.Steps[_currentStep];
+            var result = step.Run();
+            if(result == RState.Failed)
+            {
+                Runner.Stop($"Recipe:{CurrentRunningRecipe}, Step:{_currentStep + 1} Failed");
+                return true;
+            }
+            else if(result == RState.End)
+            {
+                if (_currentStep < _currentRecipe.Steps.Count - 1)
+                {
+                    _currentStep++;
+                    _currentRecipe.Steps[_currentStep].Start();
+                }
+                else
+                {
+                    Notify($"Recipe:{CurrentRunningRecipe} finished");
+                    return !StartNewRecipe();
+                }
+            }
+
+            return false;
+        }
+
+        private bool ProcessDone()
+        {
+            return true;
+        }
+
         public void Abort()
         {
             CloseAllValves();

+ 26 - 0
Venus/Venus_RT/Modules/PMs/PMRoutineBase.cs

@@ -3,6 +3,7 @@ using Venus_RT.Devices;
 using Aitex.Core.RT.Log;
 using MECF.Framework.Common.Equipment;
 using MECF.Framework.Common.Routine;
+using System;
 
 namespace Venus_RT.Modules.PMs
 {
@@ -157,5 +158,30 @@ namespace Venus_RT.Modules.PMs
 
             return true;
         }
+
+        protected bool SetCoolantTemp(double target, double offset)
+        {
+            if (!_chamber.CheckChillerStatus())
+            {
+                Stop("Chiller status error");
+                return false;
+            }
+
+            if (_chamber.CoolantOutletTempFB > target)
+            {
+                Notify($"水冷当前温度{_chamber.CoolantOutletTempFB} ℃, 大于目标 {target.ToString()} ℃");
+            }
+
+            _chamber.HeatChiller(target, offset);
+            Notify($"检查水冷温度值,当前温度{_chamber.CoolantOutletTempFB} ℃, 目标 {target.ToString()} ℃");
+
+            return true;
+        }
+
+        protected bool CheckCoolantTemp(double target, double tolerance)
+        {
+            return Math.Abs(_chamber.CoolantOutletTempFB - target) <= tolerance;
+        }
+       
     }
 }

+ 7 - 4
Venus/Venus_RT/Modules/PMs/PumpDownRoutine.cs

@@ -1,4 +1,5 @@
-using Aitex.Core.RT.Routine;
+using System;
+using Aitex.Core.RT.Routine;
 using Aitex.Core.RT.SCCore;
 using Venus_RT.Devices;
 using MECF.Framework.Common.Routine;
@@ -23,7 +24,7 @@ namespace Venus_RT.Modules.PMs
         private int _pump_delay = 5000;
         private int _roughPumpPressure = 75000;
         private int _vHe2FlowPressure = 200;
-        private int _gasfinalPressure = 10;
+        private int _basePressure = 10;
 
         public PumpDownRoutine(JetPM chamber) : base(chamber)
         {
@@ -41,7 +42,9 @@ namespace Venus_RT.Modules.PMs
                 _roughPumpPressure = SC.GetValue<int>($"{Module}.Pump.RoughPumpDownPressure") * 1000;
                 _vHe2FlowPressure = SC.GetValue<int>($"{Module}.Pump.PumpVHe2FlowPressure");
                 _pump_delay = SC.GetValue<int>($"{Module}.Pump.PumpValveDelay") * 1000;
-                
+                _basePressure = (objs.Length >= 1) ? Convert.ToInt32(objs[0]) : SC.GetValue<int>($"{Module}.Pump.PumpBasePressure");
+
+
                 return Runner.Start(Module, Name);
             }
 
@@ -55,7 +58,7 @@ namespace Venus_RT.Modules.PMs
                 .Run((int)PumpStep.kPVHe2,          OpenHe2Valve, _delay_1s)
                 .Run((int)PumpStep.kISOValve,       OpenISOValve, _delay_1s)
                 .Run((int)PumpStep.kTurboN2Purge,   HOFs.WrapAction(_chamber.OpenValve, ValveType.TurboPumpPurge, true),    _delay_1s)
-                .Run((int)PumpStep.kVATValve,       OpenVATValve,                                                           () => { return _chamber.ChamberPressure < _gasfinalPressure * 3; })
+                .Run((int)PumpStep.kVATValve,       OpenVATValve,                                                           () => { return _chamber.ChamberPressure < _basePressure; })
                 .End((int)PumpStep.kGasFinal,       HOFs.WrapAction(_chamber.OpenValve, ValveType.GasFinal, true),          _pump_delay);
 
             return Runner.Status;

+ 0 - 427
Venus/Venus_RT/Modules/PMs/Recipe.cs

@@ -1,427 +0,0 @@
-using Aitex.Common.Util;
-using Aitex.Core.RT.Event;
-using Aitex.Core.RT.Log;
-using Aitex.Core.RT.SCCore;
-//using EPInterface.Datas;
-using System;
-using System.Collections.Generic;
-using System.Xml;
-
-namespace Venus_RT.Modules
-{
-    /// <summary>
-    /// Recipe head
-    /// </summary>
-    public class RecipeHead
-    {
-        public string RecipeVariation  { get; set; }
-        public string CreationTime     { get; set; }
-        public string LastRevisionTime { get; set; }
-        public string CreatedBy        { get; set; }
-        public string LastModifiedBy   { get; set; }
-        public string PressureMode     { get; set; }
-        public string Description      { get; set; }
-        public string Barcode          { get; set; }
-        public string BasePressure     { get; set; }
-        public string PumpDownLimit    { get; set; }
-        //public string ElectrodeTemp    { get; set; }
-        //public string HeaterTemp       { get; set; }
-        public string PurgeActive      { get; set; }
-        public string MatchPositionC1  { get; set; }
-        public string MatchPositionC2  { get; set; }
-        public string SubstrateTemp    { get; set; }
-        public string PumpingPinState  { get; set; }
-        public string NotToPurgeOrVent { get; set; }    //For keep vacuum after idle clean
-        public string VentingPinState { get; set; }
-        public string PinDownPressure { get; set; }
-    }
-
-    public class RecipeStep
-    {
-        public string StepName;
-        public double StepTime;
-        public bool IsJumpStep;
-        public bool IsLoopStartStep;
-        public bool IsLoopEndStep;
-        public int LoopCount;
-        public string EndBy;
-        public string EndPointConfig;
-        public bool FaultIfNoEPDTrigger;
-
-        //public double EndByValue;
-        public Dictionary<string, string> RecipeCommands = new Dictionary<string, string>();
-        public Dictionary<string, object[]> ToleranceCommands = new Dictionary<string, object[]>();
-    }
-
-    public class Recipe
-    {
-        /// <summary>
-        /// 当前Recipe Run 记录对应的Guid
-        /// 每个Recipe Run 都对应有一个唯一的Guid
-        /// </summary>
-        public static Guid CurrentRecipeRunGuid;
-
-        /// <summary>
-        /// 解析工艺程序文件
-        /// </summary>
-        /// <param name="recipeName">工艺程序名</param>
-        /// <param name="xmlRecipeData">xml格式的工艺数据内容</param>
-        /// <param name="recipeData">返回解析的工艺数据变量</param>
-        /// <returns>True:解析成功 | False:解析失败</returns>
-        public static bool Parse(string chamberId, string recipe, out RecipeHead recipeHead, out List<RecipeStep> recipeData)
-        {
-            recipeHead = new RecipeHead();
-            recipeData = new List<RecipeStep>();
-
-            try
-            {
-                //获取工艺程序文件中允许的命令字符串列表
-                //目的:如果工艺程序文件中含有规定之外的命令,则被禁止执行
-                HashSet<string> recipeAllowedCommands = new HashSet<string>();
-                XmlDocument rcpFormatDoc = new XmlDocument();
-
-                string recipeSchema = PathManager.GetCfgDir() + "RecipeFormat.xml";
-                rcpFormatDoc.Load(recipeSchema);
-
-                XmlNodeList rcpItemNodeList = rcpFormatDoc.SelectNodes("/Aitex/TableRecipeFormat/Catalog/Group/Step");
-                foreach (XmlElement item in rcpItemNodeList)
-                    recipeAllowedCommands.Add(item.Attributes["ControlName"].Value);
-
-                //获取工艺程序文件中所有步的内容
-                XmlDocument rcpDataDoc = new XmlDocument();
-                rcpDataDoc.LoadXml(recipe);
-
-                recipeHead.PressureMode = rcpDataDoc.DocumentElement.HasAttribute("PressureMode") ? rcpDataDoc.DocumentElement.Attributes["PressureMode"].Value : "";
-
-                recipeHead.BasePressure = rcpDataDoc.DocumentElement.HasAttribute("BasePressure") ? rcpDataDoc.DocumentElement.Attributes["BasePressure"].Value : "";
-
-                recipeHead.PumpDownLimit = rcpDataDoc.DocumentElement.HasAttribute("PumpDownLimit") ? rcpDataDoc.DocumentElement.Attributes["PumpDownLimit"].Value : "";
-
-                recipeHead.PurgeActive = rcpDataDoc.DocumentElement.HasAttribute("PurgeActive") ? rcpDataDoc.DocumentElement.Attributes["PurgeActive"].Value : "";
-
-                recipeHead.MatchPositionC1 = rcpDataDoc.DocumentElement.HasAttribute("MatchPositionC1") ? rcpDataDoc.DocumentElement.Attributes["MatchPositionC1"].Value : "";
-
-                recipeHead.MatchPositionC2 = rcpDataDoc.DocumentElement.HasAttribute("MatchPositionC2") ? rcpDataDoc.DocumentElement.Attributes["MatchPositionC2"].Value : "";
-
-                recipeHead.Barcode = rcpDataDoc.DocumentElement.HasAttribute("Barcode") ? rcpDataDoc.DocumentElement.Attributes["Barcode"].Value : "";
-
-                recipeHead.SubstrateTemp = rcpDataDoc.DocumentElement.HasAttribute("SubstrateTemp") ? rcpDataDoc.DocumentElement.Attributes["SubstrateTemp"].Value : "";
-
-                recipeHead.PumpingPinState = rcpDataDoc.DocumentElement.HasAttribute("PumpingPinState") ? rcpDataDoc.DocumentElement.Attributes["PumpingPinState"].Value : "Down";
-
-                //For keep vacuum after idle clean
-                recipeHead.NotToPurgeOrVent = rcpDataDoc.DocumentElement.HasAttribute("NotToPurgeOrVent") ? rcpDataDoc.DocumentElement.Attributes["NotToPurgeOrVent"].Value : "";
-
-                recipeHead.VentingPinState = rcpDataDoc.DocumentElement.HasAttribute("VentingPinState") ? rcpDataDoc.DocumentElement.Attributes["VentingPinState"].Value : "Down";
-
-                recipeHead.PinDownPressure = rcpDataDoc.DocumentElement.HasAttribute("PinDownPressure") ? rcpDataDoc.DocumentElement.Attributes["PinDownPressure"].Value : "1000";
-
-                XmlNodeList stepNodeList = rcpDataDoc.SelectNodes("/TableRecipeData/Step");
-                for (int i = 0; i < stepNodeList.Count; i++)
-                {
-                    var recipeStep = new RecipeStep();
-                    recipeData.Add(recipeStep);
-
-                    XmlElement stepNode = stepNodeList[i] as XmlElement;
-                    Dictionary<string, string> dic = new Dictionary<string, string>();
-
-                    //遍历Step节点
-                    foreach (XmlAttribute att in stepNode.Attributes)
-                    {
-                        if (recipeAllowedCommands.Contains(att.Name))
-                        {
-                            dic.Add(att.Name, att.Value);
-                        }
-                    }
-                    //遍历Step子节点中所有的attribute属性节点
-                    foreach (XmlElement subStepNode in stepNode.ChildNodes)
-                    {
-                        foreach (XmlAttribute att in subStepNode.Attributes)
-                        {
-                            if (recipeAllowedCommands.Contains(att.Name))
-                            {
-                                dic.Add(att.Name, att.Value);
-                            }
-                        }
-                        //遍历Step子节点的子节点中所有的attribute属性节点
-                        foreach (XmlElement subsubStepNode in subStepNode.ChildNodes)
-                        {
-                            foreach (XmlAttribute att in subsubStepNode.Attributes)
-                            {
-                                if (recipeAllowedCommands.Contains(att.Name))
-                                {
-                                    dic.Add(att.Name, att.Value);
-                                }
-                            }
-                        }
-                    }
-
-                    recipeStep.IsJumpStep = true;//!Convert.ToBoolean(dic["Ramp"]);
-                    recipeStep.StepName = dic["Name"];
-                    recipeStep.StepTime = double.Parse(dic["Time"]);
-                    string loopStr = dic["Loop"];
-                    recipeStep.IsLoopStartStep = System.Text.RegularExpressions.Regex.Match(loopStr, @"Loop\x20\d+\s*$").Success;
-                    recipeStep.IsLoopEndStep = System.Text.RegularExpressions.Regex.Match(loopStr, @"Loop End$").Success;
-                    if (recipeStep.IsLoopStartStep)
-                        recipeStep.LoopCount = Convert.ToInt32(loopStr.Replace("Loop", string.Empty));
-                    else
-                        recipeStep.LoopCount = 0;
-                    //recipeStep.EndByValue = Convert.ToDouble(dic["EndValue"]);
-                    recipeStep.EndBy = dic["EndBy"];
-
-                    if (recipeStep.EndBy == "EndByRfTime")
-                    {
-                        recipeStep.StepTime = double.Parse(dic["Rf.SetPowerOnTime"]);
-
-                        if (recipeStep.StepTime <= 0)
-                        {
-                            //LOG.Error("recipe 没有定义RF Power on的时间");
-                            return false;
-                        }
-                    }
-
-                    int rfPower = (int)Convert.ToDouble(dic["Rf.SetPower"]);
-                    dic.Add("Rf.SetPowerOnOff", rfPower > 0 ? "true" : "false");
-                    if (SC.GetValue<bool>($"{chamberId}.BiasRf.EnableBiasRF"))
-                    {
-                        int rfPowerBias = (int)Convert.ToDouble(dic["BiasRf.SetPower"]);
-                        dic.Add("BiasRf.SetPowerOnOff", rfPowerBias > 0 ? "true" : "false");
-                    }
-                    else
-                    {
-                        dic.Remove("BiasRf.SetPower");
-                        dic.Remove("BiasRf.SetMatchProcessMode");
-                        dic.Remove("BiasRf.SetMatchPositionC1");
-                        dic.Remove("BiasRf.SetMatchPositionC2");
-                    }
-
-                    bool epdInstalled = SC.ContainsItem("System.SetUp.EPDInstalled") && SC.GetValue<bool>($"System.SetUp.EPDInstalled");
-
-                    if (!epdInstalled)
-                    {
-                        if (dic.ContainsKey("EPD.SetConfig"))
-                            dic.Remove("EPD.SetConfig");
-                    }
-                    else
-                    {
-                        recipeStep.EndPointConfig = dic.ContainsKey("EPD.SetConfig") ? dic["EPD.SetConfig"] : null;
-
-                        if (string.IsNullOrEmpty(recipeStep.EndPointConfig))
-                        {
-                            if (recipeStep.EndBy == "EndByEndPoint")
-                            {
-                                EV.PostWarningLog("System", "EndPoint is empty");
-                                return false;
-                            }
-                            recipeStep.EndPointConfig = SC.GetStringValue("System.EndPoint.EndPointDefaultValue");
-                        }
-                        else
-                        {
-                            //if (!ParseEPD(recipeStep.EndPointConfig, out EPDConfig config))
-                            //{
-                            //    EV.PostWarningLog("System", "EndPoint config is not valid");
-                            //    return false;
-                            //}
-
-                            //recipeStep.FaultIfNoEPDTrigger = config.FaultIfNoEPDTrigger;
-                        }
-                    }
-
-                    //tolerance
-                    List<string> items = new List<string>() { "MfcGas1", "MfcGas2", "MfcGas3", "MfcGas4", "MfcGas5", "PressureControl", "Rf", "BiasRf" };
-                    Dictionary<string, object[]> tolerance = new Dictionary<string, object[]>();
-                    foreach (var item in items)
-                    {
-                        if (item == "BiasRf" && !SC.GetValue<bool>($"{chamberId}.BiasRf.EnableBiasRF"))
-                        {
-                            dic.Remove(($"{item}.SoftTolerance"));
-                            dic.Remove(($"{item}.HardTolerance"));
-                            continue;
-                        }
-
-                        var time = SC.GetValue<int>($"{chamberId}.RecipeToleranceIgnoreTime");
-                        var warning = dic.ContainsKey($"{item}.SoftTolerance") ? dic[$"{item}.SoftTolerance"] : "0";
-                        var alarm = dic.ContainsKey($"{item}.HardTolerance") ? dic[$"{item}.HardTolerance"] : "0";
-                        tolerance[$"{item}.SetRecipeTolerance"] = new object[]
-                        {
-                            time, warning, alarm
-                        };
-
-                        dic.Remove(($"{item}.SoftTolerance"));
-                        dic.Remove(($"{item}.HardTolerance"));
-                    }
-
-                    recipeStep.ToleranceCommands = tolerance;
-
-                    //dic.Remove("Ramp");
-                    dic.Remove("StepNo");
-                    dic.Remove("Name");
-                    dic.Remove("Loop");
-                    dic.Remove("Time");
-                    dic.Remove("EndBy");
-                    //dic.Remove("EndValue");
-                    dic.Remove("Rf.SetPowerOnTime");
-
-                    foreach (string key in dic.Keys)
-                        recipeStep.RecipeCommands.Add(key, dic[key]);
-                }
-            }
-            catch (Exception ex)
-            {
-                //LOG.Write(ex);
-                return false;
-            }
-            return true;
-        }
-
-        //private static bool ParseEPD(string config, out EPDConfig epdConfig)
-        //{
-        //    epdConfig = new EPDConfig();
-
-        //    try
-        //    {
-        //        epdConfig.nParameterCount = 1;
-
-        //        string[] items = config.Split(';');
-        //        foreach (var item in items)
-        //        {
-        //            if (string.IsNullOrEmpty(item))
-        //                continue;
-
-        //            string[] pairs = item.Split('=');
-        //            if (pairs.Length != 2)
-        //                continue;
-
-        //            switch (pairs[0])
-        //            {
-        //                case "ExposureTime":
-        //                    epdConfig.Columns[0].nCCDExposureTime = int.Parse(pairs[1]);
-        //                    break;
-        //                case "WaveLengthA":
-        //                    epdConfig.Columns[0].nWaveLength[0] = ushort.Parse(pairs[1]);
-        //                    break;
-        //                case "BinningA":
-        //                    epdConfig.Columns[0].nBinning[0] = ushort.Parse(pairs[1]);
-        //                    break;
-        //                case "WaveLengthB":
-        //                    epdConfig.Columns[0].nWaveLength[1] = ushort.Parse(pairs[1]);
-        //                    break;
-        //                case "BinningB":
-        //                    epdConfig.Columns[0].nBinning[1] = ushort.Parse(pairs[1]);
-        //                    break;
-        //                case "WaveLengthC":
-        //                    epdConfig.Columns[0].nWaveLength[2] = ushort.Parse(pairs[1]);
-        //                    break;
-        //                case "BinningC":
-        //                    epdConfig.Columns[0].nBinning[2] = ushort.Parse(pairs[1]);
-        //                    break;
-        //                case "WaveLengthD":
-        //                    epdConfig.Columns[0].nWaveLength[3] = ushort.Parse(pairs[1]);
-        //                    break;
-        //                case "BinningD":
-        //                    epdConfig.Columns[0].nBinning[3] = ushort.Parse(pairs[1]);
-        //                    break;
-
-        //                case "Fd":
-        //                    epdConfig.Columns[0].cFunc = pairs[1];
-        //                    break;
-        //                case "PrefilterTime":
-        //                    epdConfig.Columns[0].nPreFilterTime = int.Parse(pairs[1]);
-        //                    break;
-        //                case "PostfilterTime":
-        //                    epdConfig.Columns[0].nPostFilterTime = int.Parse(pairs[1]);
-        //                    break;
-        //                case "AlgorithmType":
-        //                    epdConfig.Columns[0].algorithmType = MapType(pairs[1]);
-        //                    break;
-        //                case "Criteria":
-        //                    epdConfig.Columns[0].nCriteria = float.Parse(pairs[1]);
-        //                    break;
-
-        //                case "DelayTime":
-        //                    epdConfig.Columns[0].nDelayTime = int.Parse(pairs[1]);
-        //                    break;
-        //                case "ValidationTime":
-        //                    epdConfig.Columns[0].nValidationTime = int.Parse(pairs[1]);
-        //                    break;
-        //                case "ValidationValue":
-        //                    epdConfig.Columns[0].nValidationValue = int.Parse(pairs[1]);
-        //                    break;
-        //                case "TimeWindow":
-        //                    epdConfig.Columns[0].nTimeWindow = int.Parse(pairs[1]);
-        //                    break;
-        //                case "MinimalTime":
-        //                    epdConfig.Columns[0].nMinimalTime = int.Parse(pairs[1]);
-        //                    break;
-        //                case "PostponeTime":
-        //                    epdConfig.Columns[0].nPostponeTime = int.Parse(pairs[1]);
-        //                    break;
-
-        //                case "Control":
-        //                    epdConfig.Columns[0].bControl = Convert.ToBoolean(pairs[1]);
-        //                    break;
-        //                case "Normalization":
-        //                    epdConfig.Columns[0].bNormalization = Convert.ToBoolean(pairs[1]);
-        //                    break;
-        //                case "EnablePostponePercent":
-        //                    epdConfig.Columns[0].bPostponePercent = Convert.ToBoolean(pairs[1]);
-        //                    break;
-        //                case "EnableCriterialPercent":
-        //                    epdConfig.Columns[0].bCriteriaPercent = Convert.ToBoolean(pairs[1]);
-        //                    break;
-
-
-        //                case "EnableEventTrigger":
-        //                    epdConfig.Columns[0].bEvtTrigger = Convert.ToBoolean(pairs[1]);
-        //                    break;
-
-
-
-        //                case "IsFaultIfNoTrigger":
-        //                    epdConfig.FaultIfNoEPDTrigger = Convert.ToBoolean(pairs[1]);
-        //                    break;
-
-        //            }
-        //        }
-
-        //        return true;
-        //    }
-        //    catch (Exception ex)
-        //    {
-        //        LOG.Write(ex);
-        //        EV.PostMessage("System", EventEnum.DefaultAlarm, "EPD config input not valid, ", ex.Message);
-        //        return false;
-        //    }
-
-
-        //}
-
-
-        //private static AlgorithmType MapType(string type)
-        //{
-        //    switch (type)
-        //    {
-        //        case "Unknown": return AlgorithmType.ALG_NONE;
-        //        case "Above_ABS_Value": return AlgorithmType.ALG_RISE_VALUE;
-        //        case "Below_ABS_Value": return AlgorithmType.ALG_FALL_VALUE;
-        //        case "Drop_Percent": return AlgorithmType.ALG_FALL_PERCENT;
-        //        case "Up_Percent": return AlgorithmType.ALG_RISE_PERCENT;
-        //        case "Range_In": return AlgorithmType.ALG_RANGE_IN;
-        //        case "Gradient": return AlgorithmType.ALG_GRADIENT;
-        //        case "Peek": return AlgorithmType.ALG_PEAK;
-        //        case "Valley": return AlgorithmType.ALG_VALLEY;
-        //        case "Min_Drop_Percent": return AlgorithmType.ALG_MIN_FALL_PERCENT;
-        //        case "Min_Up_Percent": return AlgorithmType.ALG_MIN_RISE_PERCENT;
-        //        case "Max_Drop_Percent": return AlgorithmType.ALG_MAX_FALL_PERCENT;
-        //        case "Max_Up_Percent": return AlgorithmType.ALG_MAX_RISE_PERCENT;
-        //        case "Rise_Fall": return AlgorithmType.ALG_RISE_FALL;
-        //        case "Fall_Rise": return AlgorithmType.ALG_FALL_RISE;
-        //    }
-
-        //    return AlgorithmType.ALG_NONE;
-        //}
-
-    }
-
-
-}

+ 1 - 1
Venus/Venus_RT/Venus_RT.csproj

@@ -150,8 +150,8 @@
     <Compile Include="Modules\PMs\PMProcessRoutine.cs" />
     <Compile Include="Modules\PMs\PMPurgeRoutine.cs" />
     <Compile Include="Modules\PMs\PMRoutineBase.cs" />
+    <Compile Include="Modules\PMs\ProcessDefine.cs" />
     <Compile Include="Modules\PMs\PumpDownRoutine.cs" />
-    <Compile Include="Modules\PMs\Recipe.cs" />
     <Compile Include="Modules\PMs\StartDryPumpRoutine.cs" />
     <Compile Include="Modules\PMs\StartTurboPumpRoutine.cs" />
     <Compile Include="Modules\PMs\VentRoutine.cs" />