Browse Source

Recipe 每个模块做成ui可配,设计clean recipe模块,Kepler2200 模拟器recipe工艺测试

# Conflicts:
#	Venus/Venus_RT/Modules/PMs/PMProcessRoutine.cs
lixiang 1 year ago
parent
commit
0af54acc48

+ 16 - 7
Venus/Venus_Core/ProcessUnitDefine.cs

@@ -36,6 +36,13 @@ namespace Venus_Core
         ESCHVUnit,
         ESCHVUnit,
         ProcessKitUnit
         ProcessKitUnit
     }
     }
+    public enum VenusCleanRecipeUnits
+    {
+        PressureByPressureModeUnit,
+        TCPUnit,
+        GasControlUnit,
+        ProcessKitUnit
+    }
     public enum Kepler2300Uints
     public enum Kepler2300Uints
     {
     {
         PressureByPressureModeUnit,
         PressureByPressureModeUnit,
@@ -44,11 +51,18 @@ namespace Venus_Core
         GasControlUnit,
         GasControlUnit,
         ProcessKitUnit
         ProcessKitUnit
     }
     }
+    public enum Kepler2300CleanRecipeUints
+    {
+        PressureByPressureModeUnit,
+        TCPUnit,
+        GasControlUnit,
+        ProcessKitUnit
+    }
     public enum Kepler2200AUnits
     public enum Kepler2200AUnits
     {
     {
         Kepler2200GasControlUnit,
         Kepler2200GasControlUnit,
         HeaterUnit,
         HeaterUnit,
-        Kepler2200RFUnit
+        TCPUnit
     }
     }
     public enum Kepler2200BUnits
     public enum Kepler2200BUnits
     {
     {
@@ -116,12 +130,7 @@ namespace Venus_Core
         public int TargetPower { get; set; }       
         public int TargetPower { get; set; }       
     }
     }
 
 
-    public class Kepler2200RFUnit : ProcessUnitBase
-    {
-        public string UnitName { get; set; } = "RFUnit";
-        public int TuneCapPreset { get; set; }
-        public int LoadCapPreset { get; set; }                
-    }
+
 
 
     public class BiasUnit : ProcessUnitBase
     public class BiasUnit : ProcessUnitBase
     {
     {

+ 189 - 82
Venus/Venus_Core/Recipe.cs

@@ -1,13 +1,9 @@
 using System;
 using System;
-using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Collections.ObjectModel;
 using System.ComponentModel;
 using System.ComponentModel;
 using System.Diagnostics;
 using System.Diagnostics;
 using System.IO;
 using System.IO;
 using System.Linq;
 using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Threading.Tasks;
 using Newtonsoft.Json;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Converters;
 using Newtonsoft.Json.Converters;
 using Venus_Core.Attributes;
 using Venus_Core.Attributes;
@@ -52,7 +48,7 @@ namespace Venus_Core
         Valve
         Valve
     }
     }
 
 
-    public class RecipeHead: INotifyPropertyChanged
+    public class RecipeHead : INotifyPropertyChanged
     {
     {
         private string m_name;
         private string m_name;
         [IsOnlyRead]
         [IsOnlyRead]
@@ -86,20 +82,20 @@ namespace Venus_Core
         private string m_ChunckRecipe;
         private string m_ChunckRecipe;
         public string ChuckRecipe
         public string ChuckRecipe
         {
         {
-            get { return m_ChunckRecipe;}
+            get { return m_ChunckRecipe; }
             set { m_ChunckRecipe = value; InvokePropertyChanged("ChuckRecipe"); }
             set { m_ChunckRecipe = value; InvokePropertyChanged("ChuckRecipe"); }
         }
         }
         private string m_DechuckRecipe;
         private string m_DechuckRecipe;
         public string DechuckRecipe
         public string DechuckRecipe
         {
         {
-            get { return m_DechuckRecipe;}
-            set{ m_DechuckRecipe = value;InvokePropertyChanged("DechuckRecipe");}
+            get { return m_DechuckRecipe; }
+            set { m_DechuckRecipe = value; InvokePropertyChanged("DechuckRecipe"); }
         }
         }
         private string m_CreateTime;
         private string m_CreateTime;
         [IsOnlyRead]
         [IsOnlyRead]
         public string CreateTime
         public string CreateTime
         {
         {
-            get { return m_CreateTime;}
+            get { return m_CreateTime; }
             set { m_CreateTime = value; InvokePropertyChanged("CreateTime"); }
             set { m_CreateTime = value; InvokePropertyChanged("CreateTime"); }
         }
         }
         private string m_EditTime;
         private string m_EditTime;
@@ -113,28 +109,28 @@ namespace Venus_Core
         [IsOnlyRead]
         [IsOnlyRead]
         public string LastModifiedBy
         public string LastModifiedBy
         {
         {
-            get {  return m_LastModifiedBy;}
+            get { return m_LastModifiedBy; }
             set { m_LastModifiedBy = value; InvokePropertyChanged("LastModifiedBy"); }
             set { m_LastModifiedBy = value; InvokePropertyChanged("LastModifiedBy"); }
         }
         }
         private string m_Barcode;
         private string m_Barcode;
         public string Barcode
         public string Barcode
         {
         {
-            get { return m_Barcode;}
+            get { return m_Barcode; }
             set { m_Barcode = value; InvokePropertyChanged("Barcode"); }
             set { m_Barcode = value; InvokePropertyChanged("Barcode"); }
         }
         }
         private string m_BasePressure;
         private string m_BasePressure;
         public string BasePressure
         public string BasePressure
         {
         {
-            get { return m_BasePressure;}
+            get { return m_BasePressure; }
             set { m_BasePressure = value; InvokePropertyChanged("BasePressure"); }
             set { m_BasePressure = value; InvokePropertyChanged("BasePressure"); }
         }
         }
         private string m_ChillerTemp;
         private string m_ChillerTemp;
         public string ChillerTemp
         public string ChillerTemp
         {
         {
-            get { return m_ChillerTemp;}
+            get { return m_ChillerTemp; }
             set { m_ChillerTemp = value; InvokePropertyChanged("ChillerTemp"); }
             set { m_ChillerTemp = value; InvokePropertyChanged("ChillerTemp"); }
         }
         }
-        private int m_RFHoldTime=1000;
+        private int m_RFHoldTime = 1000;
         public int RFHoldTime
         public int RFHoldTime
         {
         {
             get { return m_RFHoldTime; }
             get { return m_RFHoldTime; }
@@ -225,7 +221,7 @@ namespace Venus_Core
         }
         }
     }
     }
     [Serializable]
     [Serializable]
-    public class RecipeStep:INotifyPropertyChanged
+    public class RecipeStep : INotifyPropertyChanged
     {
     {
 
 
         [JsonIgnore]
         [JsonIgnore]
@@ -236,7 +232,7 @@ namespace Venus_Core
         public Func<RecipeStep, RState> ender;
         public Func<RecipeStep, RState> ender;
 
 
 
 
-        private int m_StepNo;
+        private int m_StepNo=1;
         [IsOnlyRead]
         [IsOnlyRead]
         public int StepNo
         public int StepNo
         {
         {
@@ -247,14 +243,14 @@ namespace Venus_Core
         [JsonConverter(typeof(StringEnumConverter))]
         [JsonConverter(typeof(StringEnumConverter))]
         public StepType Type
         public StepType Type
         {
         {
-            get { return m_StepType;}
+            get { return m_StepType; }
             set { m_StepType = value; InvokePropertyChanged("Type"); }
             set { m_StepType = value; InvokePropertyChanged("Type"); }
         }
         }
 
 
         private int m_Time;
         private int m_Time;
         public int Time
         public int Time
         {
         {
-            get { return m_Time;}
+            get { return m_Time; }
             set { m_Time = value; InvokePropertyChanged("Time"); }
             set { m_Time = value; InvokePropertyChanged("Time"); }
         }
         }
         private string m_Description;
         private string m_Description;
@@ -303,19 +299,19 @@ namespace Venus_Core
         private bool m_CycleStart;
         private bool m_CycleStart;
         public bool CycleStart
         public bool CycleStart
         {
         {
-            get { return m_CycleStart;}
+            get { return m_CycleStart; }
             set { m_CycleStart = value; InvokePropertyChanged("CycleStart"); }
             set { m_CycleStart = value; InvokePropertyChanged("CycleStart"); }
         }
         }
         private bool m_CycleEnd;
         private bool m_CycleEnd;
         public bool CycleEnd
         public bool CycleEnd
         {
         {
-            get { return m_CycleEnd;}
+            get { return m_CycleEnd; }
             set { m_CycleEnd = value; InvokePropertyChanged("CycleEnd"); }
             set { m_CycleEnd = value; InvokePropertyChanged("CycleEnd"); }
         }
         }
         private int m_CycleNumber;
         private int m_CycleNumber;
         public int CycleNumber
         public int CycleNumber
         {
         {
-            get { return m_CycleNumber;}
+            get { return m_CycleNumber; }
             set { m_CycleNumber = value; InvokePropertyChanged("CycleNumber"); }
             set { m_CycleNumber = value; InvokePropertyChanged("CycleNumber"); }
         }
         }
 
 
@@ -330,7 +326,7 @@ namespace Venus_Core
 
 
         public long ElapsedTime()
         public long ElapsedTime()
         {
         {
-            return _stepTimer.ElapsedMilliseconds; 
+            return _stepTimer.ElapsedMilliseconds;
         }
         }
         public void StartStepTimer()
         public void StartStepTimer()
         {
         {
@@ -363,7 +359,7 @@ namespace Venus_Core
                 }
                 }
                 else
                 else
                     return RState.Failed;
                     return RState.Failed;
-                
+
             }
             }
 
 
             return RState.Running;
             return RState.Running;
@@ -380,7 +376,7 @@ namespace Venus_Core
                 if (processUnit != null)
                 if (processUnit != null)
                 {
                 {
                     var state = processUnit.Run(this);
                     var state = processUnit.Run(this);
-                    if(Type == StepType.Stable)
+                    if (Type == StepType.Stable)
                     {
                     {
                         if (state != RState.Running && state != RState.End)
                         if (state != RState.Running && state != RState.End)
                             return state;
                             return state;
@@ -437,7 +433,7 @@ namespace Venus_Core
     }
     }
 
 
 
 
-    public class Recipe: INotifyPropertyChanged
+    public class Recipe : INotifyPropertyChanged
     {
     {
 
 
         private RecipeHead m_Header = new RecipeHead();
         private RecipeHead m_Header = new RecipeHead();
@@ -456,7 +452,7 @@ namespace Venus_Core
 
 
         public static Recipe Load(string recipeFile)
         public static Recipe Load(string recipeFile)
         {
         {
-           var recipe= JsonConvert.DeserializeObject<Recipe>(recipeFile);
+            var recipe = JsonConvert.DeserializeObject<Recipe>(recipeFile);
             if (recipe == null)
             if (recipe == null)
             {
             {
                 return null;
                 return null;
@@ -474,18 +470,18 @@ namespace Venus_Core
                 //}
                 //}
                 //var item = step.LstUnit[0];
                 //var item = step.LstUnit[0];
 
 
-                for (int i=0;i< step.LstUnit.Count; i++)
+                for (int i = 0; i < step.LstUnit.Count; i++)
                 {
                 {
                     //object item=step.LstUnit[i];
                     //object item=step.LstUnit[i];
                     //step.LstUnit[i].
                     //step.LstUnit[i].
                     string value = step.LstUnit[i].ToString();
                     string value = step.LstUnit[i].ToString();
                     string[] striparr = value.Split(new string[] { "\r\n" }, StringSplitOptions.None);
                     string[] striparr = value.Split(new string[] { "\r\n" }, StringSplitOptions.None);
-                    string item1= striparr[1].Remove(0, 15);
+                    string item1 = striparr[1].Remove(0, 15);
                     string item2 = item1.Remove(item1.Length - 2, 2);
                     string item2 = item1.Remove(item1.Length - 2, 2);
                     //var item= value.Substring(value.IndexOf("UnitName"));
                     //var item= value.Substring(value.IndexOf("UnitName"));
 
 
                     //Type t = Type.GetType(value);
                     //Type t = Type.GetType(value);
-                    
+
 
 
                     switch (item2)
                     switch (item2)
                     {
                     {
@@ -518,20 +514,17 @@ namespace Venus_Core
                         case "GasUnit":
                         case "GasUnit":
                             unit.Add(JsonConvert.DeserializeObject<Kepler2200GasControlUnit>(step.LstUnit[i].ToString()));
                             unit.Add(JsonConvert.DeserializeObject<Kepler2200GasControlUnit>(step.LstUnit[i].ToString()));
                             break;
                             break;
-                        case "RFUnit":
-                            unit.Add(JsonConvert.DeserializeObject<Kepler2200RFUnit>(step.LstUnit[i].ToString()));
-                            break;
 
 
-                            
+
                     }
                     }
                 }
                 }
                 step.LstUnit.Clear();
                 step.LstUnit.Clear();
-                unit.ToList().ForEach(x => 
+                unit.ToList().ForEach(x =>
                 {
                 {
                     step.LstUnit.Add(x);
                     step.LstUnit.Add(x);
                 });
                 });
-               
-                
+
+
             }
             }
             return recipe;
             return recipe;
         }
         }
@@ -589,74 +582,188 @@ namespace Venus_Core
         {
         {
             return JsonConvert.SerializeObject(recipe);
             return JsonConvert.SerializeObject(recipe);
         }
         }
-        public static String CreateRecipe(JetChamber currentChamber, RecipeType recipeType,string recipeName)
+        public static String CreateRecipe(JetChamber currentChamber, RecipeType recipeType, string recipeName)
         {
         {
             Recipe recipe = new Recipe();
             Recipe recipe = new Recipe();
             recipe.Header = new RecipeHead();
             recipe.Header = new RecipeHead();
             recipe.Header.CreateTime = DateTime.Now.ToString();
             recipe.Header.CreateTime = DateTime.Now.ToString();
             recipe.Header.EditTime = DateTime.Now.ToString();
             recipe.Header.EditTime = DateTime.Now.ToString();
             recipe.Header.Type = recipeType;
             recipe.Header.Type = recipeType;
-            recipe.Header.ChamberType= currentChamber;
+            recipe.Header.ChamberType = currentChamber;
             recipe.Header.Name = recipeName;
             recipe.Header.Name = recipeName;
             recipe.Header.LastModifiedBy = "Admin";
             recipe.Header.LastModifiedBy = "Admin";
             recipe.Steps = new ObservableCollection<RecipeStep>();
             recipe.Steps = new ObservableCollection<RecipeStep>();
+            RecipeStep recipeStep = new RecipeStep();
+            recipeStep.LstUnit = GetAllUnits(currentChamber,recipeType);
+            //switch (currentChamber)
+            //{
+            //    case JetChamber.Venus:
+            //        foreach (var item in Enum.GetValues(typeof(VenusUnits)))
+            //        {
+            //            Type t = Type.GetType($"Venus_Core.{item.ToString()}");
+            //            var obj = System.Activator.CreateInstance(t);
+            //            recipeStep.LstUnit.Add(obj);
+            //        }
+            //        break;
+
+            //    case JetChamber.Kepler2300:
+            //        foreach (var item in Enum.GetValues(typeof(Kepler2300Uints)))
+            //        {
+            //            Type t = Type.GetType($"Venus_Core.{item.ToString()}");
+            //            var obj = System.Activator.CreateInstance(t);
+            //            recipeStep.LstUnit.Add(obj);
+            //        }
+            //        break;
+            //    case JetChamber.Kepler2200A:
+            //        foreach (var item in Enum.GetValues(typeof(Kepler2200AUnits)))
+            //        {
+            //            Type t = Type.GetType($"Venus_Core.{item.ToString()}");
+            //            var obj = System.Activator.CreateInstance(t);
+            //            recipeStep.LstUnit.Add(obj);
+            //        }
+            //        break;
+                    //case JetChamber.Venus:
+                    //    recipe.Steps.Add(new RecipeStep()
+                    //    {
+                    //        //StepNo = 1,
+                    //        LstUnit = new ObservableCollection<Object>()
+                    //       {
+                    //        new PressureByPressureModeUnit(),
+                    //        new TCPUnit(),
+                    //        new BiasUnit(),
+                    //        new GasControlUnit(),
+                    //        new ESCHVUnit(),
+                    //        new ProcessKitUnit()
+                    //        }
+                    //    });
+                    //    break;
+                    //case JetChamber.Kepler2300:
+                    //    recipe.Steps.Add(new RecipeStep()
+                    //    {
+                    //        //StepNo = 1,
+                    //        LstUnit = new ObservableCollection<Object>()
+                    //       {
+                    //        new PressureByPressureModeUnit(),
+                    //        new TCPUnit(),
+                    //        new BiasUnit(),
+                    //        new GasControlUnit(),
+                    //        new ProcessKitUnit()
+                    //        }
+                    //    });
+                    //    break;
+
+                    //case JetChamber.Kepler2200A:
+                    //    recipe.Steps.Add(new RecipeStep()
+                    //    {
+                    //        //StepNo = 1,
+
+
+                    //        LstUnit = new ObservableCollection<Object>()
+                    //       {
+                    //    new Kepler2200GasControlUnit(),
+                    //    new HeaterUnit(),
+                    //    new Kepler2200RFUnit()
+                    //        }
+                    //    });
+
+                    //    break;
+            //}
+            recipe.Steps.Add(recipeStep);
+
+            var recipeString = JsonConvert.SerializeObject(recipe);
 
 
-            switch (currentChamber)
+            return recipeString;
+        }
+        public static ObservableCollection<Object> GetAllUnits(JetChamber jetChamber)
+        {
+            ObservableCollection<Object> LstUnit = new ObservableCollection<object>();
+            switch (jetChamber)
             {
             {
                 case JetChamber.Venus:
                 case JetChamber.Venus:
-                    recipe.Steps.Add(new RecipeStep()
+                    foreach (var item in Enum.GetValues(typeof(VenusUnits)))
                     {
                     {
-                        StepNo = 1,
-                        LstUnit = new ObservableCollection<Object>()
-                {
-                 new PressureByPressureModeUnit(),
-                 new TCPUnit(),
-                 new BiasUnit(),
-                 new GasControlUnit(),
-                 new ESCHVUnit(),
-                 new ProcessKitUnit()
-                 }
-                    });
+                        Type t = Type.GetType($"Venus_Core.{item.ToString()}");
+                        var obj = System.Activator.CreateInstance(t);
+                        LstUnit.Add(obj);
+                    }
                     break;
                     break;
+
                 case JetChamber.Kepler2300:
                 case JetChamber.Kepler2300:
-                    recipe.Steps.Add(new RecipeStep()
+                    foreach (var item in Enum.GetValues(typeof(Kepler2300Uints)))
                     {
                     {
-                        StepNo = 1,
-                        LstUnit = new ObservableCollection<Object>()
-                {
-                 new PressureByPressureModeUnit(),
-                 new TCPUnit(),
-                 new BiasUnit(),
-                 new GasControlUnit(),
-                 new ProcessKitUnit()
-                 }
-                    });
+                        Type t = Type.GetType($"Venus_Core.{item.ToString()}");
+                        var obj = System.Activator.CreateInstance(t);
+                        LstUnit.Add(obj);
+                    }
                     break;
                     break;
-
                 case JetChamber.Kepler2200A:
                 case JetChamber.Kepler2200A:
-                    recipe.Steps.Add(new RecipeStep()
+                    foreach (var item in Enum.GetValues(typeof(Kepler2200AUnits)))
                     {
                     {
-                        StepNo = 1,
-
-
-                        LstUnit = new ObservableCollection<Object>()
-                {
-             new Kepler2200GasControlUnit(),
-             new HeaterUnit(),
-             new Kepler2200RFUnit()
-                 }
-                    });
-
+                        Type t = Type.GetType($"Venus_Core.{item.ToString()}");
+                        var obj = System.Activator.CreateInstance(t);
+                        LstUnit.Add(obj);
+                    }
                     break;
                     break;
             }
             }
+            return LstUnit;
+        }
+        public static ObservableCollection<Object> GetAllUnits(JetChamber jetChamber,RecipeType recipeType)
+        {
+            ObservableCollection<Object> LstUnit = new ObservableCollection<object>();
+            switch (jetChamber)
+            {
+                case JetChamber.Venus:
+                    if (recipeType == RecipeType.Clean)
+                    {
+                        foreach (var item in Enum.GetValues(typeof(VenusCleanRecipeUnits)))
+                        {
+                            Type t = Type.GetType($"Venus_Core.{item.ToString()}");
+                            var obj = System.Activator.CreateInstance(t);
+                            LstUnit.Add(obj);
+                        }
+                    }
+                    else
+                    {
+                        foreach (var item in Enum.GetValues(typeof(VenusUnits)))
+                        {
+                            Type t = Type.GetType($"Venus_Core.{item.ToString()}");
+                            var obj = System.Activator.CreateInstance(t);
+                            LstUnit.Add(obj);
+                        }
+                    }
+                    
+                    break;
 
 
-          
-            var recipeString = JsonConvert.SerializeObject(recipe);
-            //var Recipe2=JsonConvert.DeserializeObject<Recipe>(recipeString);
-            //string test = "";
-            //test = Recipe2.Steps[0].LstUnit[0].ToString();
-            //var tcpinit = JsonConvert.DeserializeObject<TCPUnit>(test);
-            return recipeString;
+                case JetChamber.Kepler2300:
+                    if (recipeType == RecipeType.Clean)
+                    {
+                        foreach (var item in Enum.GetValues(typeof(Kepler2300CleanRecipeUints)))
+                        {
+                            Type t = Type.GetType($"Venus_Core.{item.ToString()}");
+                            var obj = System.Activator.CreateInstance(t);
+                            LstUnit.Add(obj);
+                        }
+                    }
+                    else
+                    {
+                        foreach (var item in Enum.GetValues(typeof(Kepler2300Uints)))
+                        {
+                            Type t = Type.GetType($"Venus_Core.{item.ToString()}");
+                            var obj = System.Activator.CreateInstance(t);
+                            LstUnit.Add(obj);
+                        }
+                    }           
+                    break;
+                case JetChamber.Kepler2200A:
+                    foreach (var item in Enum.GetValues(typeof(Kepler2200AUnits)))
+                    {
+                        Type t = Type.GetType($"Venus_Core.{item.ToString()}");
+                        var obj = System.Activator.CreateInstance(t);
+                        LstUnit.Add(obj);
+                    }
+                    break;
+            }
+            return LstUnit;
         }
         }
     }
     }
 }
 }

+ 193 - 236
Venus/Venus_MainPages/ViewModels/RecipeViewModel.cs

@@ -1,10 +1,6 @@
-using Aitex.Core.Account;
-using Aitex.Core.Common.DeviceData;
-using Aitex.Core.RT.IOCore;
+using Aitex.Core.Common.DeviceData;
 using Aitex.Core.RT.Log;
 using Aitex.Core.RT.Log;
 using Aitex.Core.UI.View.Common;
 using Aitex.Core.UI.View.Common;
-using MECF.Framework.Common.CommonData;
-//using MECF.Framework.Common.CommonData;
 using MECF.Framework.Common.DataCenter;
 using MECF.Framework.Common.DataCenter;
 using MECF.Framework.Common.OperationCenter;
 using MECF.Framework.Common.OperationCenter;
 using Microsoft.VisualBasic;
 using Microsoft.VisualBasic;
@@ -17,7 +13,6 @@ using System.Collections.Generic;
 using System.IO;
 using System.IO;
 using System.Linq;
 using System.Linq;
 using System.Reflection;
 using System.Reflection;
-using System.Runtime.InteropServices;
 using System.Text;
 using System.Text;
 using System.Threading;
 using System.Threading;
 using System.Windows;
 using System.Windows;
@@ -25,18 +20,14 @@ using System.Windows.Controls;
 using System.Windows.Data;
 using System.Windows.Data;
 using System.Windows.Input;
 using System.Windows.Input;
 using System.Windows.Media;
 using System.Windows.Media;
-using System.Windows.Threading;
 using System.Xml;
 using System.Xml;
 using Venus_Core;
 using Venus_Core;
 using Venus_Core.Attributes;
 using Venus_Core.Attributes;
 using Venus_MainPages.PMs;
 using Venus_MainPages.PMs;
 using Venus_MainPages.Unity;
 using Venus_MainPages.Unity;
 using Venus_MainPages.Views;
 using Venus_MainPages.Views;
-using Venus_Themes.CustomControls;
 using Venus_Themes.UserControls;
 using Venus_Themes.UserControls;
 using WPF.Themes.UserControls;
 using WPF.Themes.UserControls;
-using Xceed.Wpf.Toolkit.Primitives;
-using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
 using RecipeStep = Venus_Core.RecipeStep;
 using RecipeStep = Venus_Core.RecipeStep;
 
 
 namespace Venus_MainPages.ViewModels
 namespace Venus_MainPages.ViewModels
@@ -47,6 +38,7 @@ namespace Venus_MainPages.ViewModels
         WCF,
         WCF,
         None
         None
     }
     }
+
     internal class RecipeViewModel : BindableBase
     internal class RecipeViewModel : BindableBase
     {
     {
         #region 私有字段     
         #region 私有字段     
@@ -105,8 +97,6 @@ namespace Venus_MainPages.ViewModels
 
 
         #region 命令
         #region 命令
 
 
-
-
         private DelegateCommand<Object> _MouseRightButtonDownCommand;
         private DelegateCommand<Object> _MouseRightButtonDownCommand;
         public DelegateCommand<Object> MouseRightButtonDownCommand =>
         public DelegateCommand<Object> MouseRightButtonDownCommand =>
             _MouseRightButtonDownCommand ?? (_MouseRightButtonDownCommand = new DelegateCommand<Object>(OnMouseRightButtonDown));
             _MouseRightButtonDownCommand ?? (_MouseRightButtonDownCommand = new DelegateCommand<Object>(OnMouseRightButtonDown));
@@ -115,8 +105,6 @@ namespace Venus_MainPages.ViewModels
         public DelegateCommand<Object> LoadedCommand =>
         public DelegateCommand<Object> LoadedCommand =>
             _LoadedCommand ?? (_LoadedCommand = new DelegateCommand<Object>(OnLoaded));
             _LoadedCommand ?? (_LoadedCommand = new DelegateCommand<Object>(OnLoaded));
 
 
-      
-
         private DelegateCommand _SaveRecipeCommand;
         private DelegateCommand _SaveRecipeCommand;
         public DelegateCommand SaveRecipeCommand =>
         public DelegateCommand SaveRecipeCommand =>
             _SaveRecipeCommand ?? (_SaveRecipeCommand = new DelegateCommand(OnSaveRecipe));
             _SaveRecipeCommand ?? (_SaveRecipeCommand = new DelegateCommand(OnSaveRecipe));
@@ -150,37 +138,37 @@ namespace Venus_MainPages.ViewModels
                 {
                 {
 
 
                     recipeStep = new RecipeStep();
                     recipeStep = new RecipeStep();
+                    recipeStep.LstUnit = RecipeUnity.GetAllUnits(currentChamber,CurrentRecipe.Header.Type);
+                    //switch (currentChamber)
+                    //{
+                    //    case JetChamber.Venus:
+                    //        recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
+                    //        recipeStep.LstUnit.Add(new TCPUnit());
+                    //        recipeStep.LstUnit.Add(new BiasUnit());
+                    //        recipeStep.LstUnit.Add(new GasControlUnit());
+                    //        recipeStep.LstUnit.Add(new ESCHVUnit());
+                    //        recipeStep.LstUnit.Add(new ProcessKitUnit());
+                    //        break;
+                    //    case JetChamber.Kepler2300:
+                    //        recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
+                    //        recipeStep.LstUnit.Add(new TCPUnit());
+                    //        recipeStep.LstUnit.Add(new BiasUnit());
+                    //        recipeStep.LstUnit.Add(new GasControlUnit());
+                    //        recipeStep.LstUnit.Add(new ProcessKitUnit());
+                    //        break;
 
 
-                    switch (currentChamber)
-                    {
-                        case JetChamber.Venus:
-                            recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
-                            recipeStep.LstUnit.Add(new TCPUnit());
-                            recipeStep.LstUnit.Add(new BiasUnit());
-                            recipeStep.LstUnit.Add(new GasControlUnit());
-                            recipeStep.LstUnit.Add(new ESCHVUnit());
-                            recipeStep.LstUnit.Add(new ProcessKitUnit());
-                            break;
-                        case JetChamber.Kepler2300:
-                            recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
-                            recipeStep.LstUnit.Add(new TCPUnit());
-                            recipeStep.LstUnit.Add(new BiasUnit());
-                            recipeStep.LstUnit.Add(new GasControlUnit());
-                            recipeStep.LstUnit.Add(new ProcessKitUnit());
-                            break;
+                    //    case JetChamber.Kepler2200A:
+                    //        recipeStep.LstUnit.Add(new Kepler2200GasControlUnit());
 
 
-                        case JetChamber.Kepler2200A:
-                            recipeStep.LstUnit.Add(new Kepler2200GasControlUnit());
+                    //        recipeStep.LstUnit.Add(new HeaterUnit());
+                    //        recipeStep.LstUnit.Add(new Kepler2200RFUnit());
 
 
-                            recipeStep.LstUnit.Add(new HeaterUnit());
-                            recipeStep.LstUnit.Add(new Kepler2200RFUnit());
 
 
-                            
 
 
 
 
 
 
-                            break;
-                    }
+                    //        break;
+                    //}
 
 
                     CurrentRecipe.Steps.Insert(index - 1, recipeStep);
                     CurrentRecipe.Steps.Insert(index - 1, recipeStep);
 
 
@@ -242,10 +230,7 @@ namespace Venus_MainPages.ViewModels
 
 
                     if (currentEPDType == EPDType.Socket)
                     if (currentEPDType == EPDType.Socket)
                     {
                     {
-
                         EPDCfgList = (List<string>)QueryDataClient.Instance.Service.GetData($"{ModuleName}.EPDCfgList");
                         EPDCfgList = (List<string>)QueryDataClient.Instance.Service.GetData($"{ModuleName}.EPDCfgList");
-
-
                     }
                     }
                     if (EPDCfgList != null)
                     if (EPDCfgList != null)
                     {
                     {
@@ -330,7 +315,12 @@ namespace Venus_MainPages.ViewModels
         {
         {
             try
             try
             {
             {
-                RecipeNameInputDlg dlg = new RecipeNameInputDlg(Application.Current.Resources["GlobalLableMsgInputRecipeName"].ToString())
+                bool hasHV=false;
+                if (currentChamber == JetChamber.Venus)
+                {
+                    hasHV = true;
+                }
+                RecipeNameInputDlg dlg = new RecipeNameInputDlg(Application.Current.Resources["GlobalLableMsgInputRecipeName"].ToString(),hasHV)
                 {
                 {
                     Owner = Application.Current.MainWindow
                     Owner = Application.Current.MainWindow
                 };
                 };
@@ -464,9 +454,17 @@ namespace Venus_MainPages.ViewModels
                 switch (propertyInfo.Name)
                 switch (propertyInfo.Name)
                 {
                 {
                     case "ChuckRecipe":
                     case "ChuckRecipe":
+                        if (currentChamber != JetChamber.Venus)
+                        {
+                            continue;
+                        }
                         textBlock.Text = "Chuck:";
                         textBlock.Text = "Chuck:";
                         break;
                         break;
                     case "DechuckRecipe":
                     case "DechuckRecipe":
+                        if (currentChamber != JetChamber.Venus)
+                        {
+                            continue;
+                        }
                         textBlock.Text = "DeChuck:";
                         textBlock.Text = "DeChuck:";
                         break;
                         break;
                     default:
                     default:
@@ -501,10 +499,16 @@ namespace Venus_MainPages.ViewModels
                         cb.SelectionChanged += ChangeUI;
                         cb.SelectionChanged += ChangeUI;
                         control = cb;
                         control = cb;
                         control.Height = 23;
                         control.Height = 23;
-                        control.SetBinding(ComboBox.SelectedItemProperty, binding);
                         ItemsControlHelper.SetEnumValuesToItemsSource(control, true);
                         ItemsControlHelper.SetEnumValuesToItemsSource(control, true);
+                       
+                        control.SetBinding(ComboBox.SelectedItemProperty, binding);
+
                         break;
                         break;
                     case "ChuckRecipe":
                     case "ChuckRecipe":
+                        if (currentChamber != JetChamber.Venus)
+                        {
+                            continue;
+                        }
                         string[] chucklist = new string[] { "" };
                         string[] chucklist = new string[] { "" };
                         ArrayList arrayList = new ArrayList(chucklist.ToList());
                         ArrayList arrayList = new ArrayList(chucklist.ToList());
                         IEnumerable<string> chlist= GetFilesNames(Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName)).ToList().Where(item => item.ToLower().Contains("chuck") && (item.ToLower().Contains("dechuck") == false));
                         IEnumerable<string> chlist= GetFilesNames(Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName)).ToList().Where(item => item.ToLower().Contains("chuck") && (item.ToLower().Contains("dechuck") == false));
@@ -530,6 +534,10 @@ namespace Venus_MainPages.ViewModels
                         control.SetBinding(ComboBox.SelectedItemProperty, binding);
                         control.SetBinding(ComboBox.SelectedItemProperty, binding);
                         break;
                         break;
                     case "DechuckRecipe":
                     case "DechuckRecipe":
+                        if (currentChamber != JetChamber.Venus)
+                        {
+                            continue;
+                        }
                         string[] dechucklist = new string[] { "" };
                         string[] dechucklist = new string[] { "" };
                         ArrayList dearrayList = new ArrayList(dechucklist.ToList());
                         ArrayList dearrayList = new ArrayList(dechucklist.ToList());
                         IEnumerable<string> delist = GetFilesNames(Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName)).ToList().Where(item => item.ToLower().Contains("dechuck"));
                         IEnumerable<string> delist = GetFilesNames(Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName)).ToList().Where(item => item.ToLower().Contains("dechuck"));
@@ -609,11 +617,10 @@ namespace Venus_MainPages.ViewModels
                 HeadWrapPanel.Children.Add(control);
                 HeadWrapPanel.Children.Add(control);
             }
             }
         }
         }
-
         private void ChangeUI(object sender, SelectionChangedEventArgs e)
         private void ChangeUI(object sender, SelectionChangedEventArgs e)
         {
         {
             var t = sender as ComboBox;
             var t = sender as ComboBox;
-            if (t.SelectedValue.ToString() == "Chuck" || t.SelectedValue.ToString() == "DeChuck")
+            if (t.SelectedValue.ToString() != "Process")
             {
             {
                 headWrapPanel.Children[8].Visibility = Visibility.Collapsed;
                 headWrapPanel.Children[8].Visibility = Visibility.Collapsed;
                 headWrapPanel.Children[9].Visibility = Visibility.Collapsed;
                 headWrapPanel.Children[9].Visibility = Visibility.Collapsed;
@@ -628,8 +635,6 @@ namespace Venus_MainPages.ViewModels
                 headWrapPanel.Children[11].Visibility = Visibility.Visible;
                 headWrapPanel.Children[11].Visibility = Visibility.Visible;
             }
             }
         }
         }
-
-
         private void MenuItemLeftInsert_Click(object sender, RoutedEventArgs e)
         private void MenuItemLeftInsert_Click(object sender, RoutedEventArgs e)
         {
         {
             var t = ((sender as MenuItem).Parent as ContextMenu).PlacementTarget as TextBox;
             var t = ((sender as MenuItem).Parent as ContextMenu).PlacementTarget as TextBox;
@@ -638,31 +643,31 @@ namespace Venus_MainPages.ViewModels
             if (copyIndex == -1)
             if (copyIndex == -1)
             {
             {
                 var recipeStep = new RecipeStep();
                 var recipeStep = new RecipeStep();
-                switch (currentChamber)
-                {
-                    case JetChamber.Venus:
-                    case JetChamber.Kepler2300:
-                        recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
-                        recipeStep.LstUnit.Add(new TCPUnit());
-                        recipeStep.LstUnit.Add(new BiasUnit());
-                        recipeStep.LstUnit.Add(new GasControlUnit());
-                        recipeStep.LstUnit.Add(new ESCHVUnit());
-                        recipeStep.LstUnit.Add(new ProcessKitUnit());
-                        break;
+                //switch (currentChamber)
+                //{
+                //    case JetChamber.Venus:
+                //    case JetChamber.Kepler2300:
+                //        recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
+                //        recipeStep.LstUnit.Add(new TCPUnit());
+                //        recipeStep.LstUnit.Add(new BiasUnit());
+                //        recipeStep.LstUnit.Add(new GasControlUnit());
+                //        recipeStep.LstUnit.Add(new ESCHVUnit());
+                //        recipeStep.LstUnit.Add(new ProcessKitUnit());
+                //        break;
 
 
-                    case JetChamber.Kepler2200A:
-                        recipeStep.LstUnit.Add(new Kepler2200GasControlUnit());
+                //    case JetChamber.Kepler2200A:
+                //        recipeStep.LstUnit.Add(new Kepler2200GasControlUnit());
 
 
-                        recipeStep.LstUnit.Add(new HeaterUnit());
-                        recipeStep.LstUnit.Add(new Kepler2200RFUnit());
+                //        recipeStep.LstUnit.Add(new HeaterUnit());
+                //        recipeStep.LstUnit.Add(new Kepler2200RFUnit());
 
 
 
 
 
 
 
 
 
 
-                        break;
-                }
-
+                //        break;
+                //}
+                recipeStep.LstUnit = RecipeUnity.GetAllUnits(currentChamber, CurrentRecipe.Header.Type);
                 CurrentRecipe.Steps.Insert(insertIndex - 1, recipeStep);
                 CurrentRecipe.Steps.Insert(insertIndex - 1, recipeStep);
             }
             }
             else
             else
@@ -681,74 +686,38 @@ namespace Venus_MainPages.ViewModels
             LoadRecipe(CurrentRecipe);
             LoadRecipe(CurrentRecipe);
         }
         }
         private void MenuItemRightInsert_Click(object sender, RoutedEventArgs e)
         private void MenuItemRightInsert_Click(object sender, RoutedEventArgs e)
-        {
-            //var t = ((sender as MenuItem).Parent as ContextMenu).PlacementTarget as TextBox;
-            //int insertIndex = Convert.ToInt32(t.Text);
-            ////OnAddStep(insertIndex + 1);
-            //var recipeStep = new RecipeStep();
-            //switch (currentChamber)
-            //{
-            //    case JetChamber.Venus:
-            //    case JetChamber.Kepler2300:
-            //        recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
-            //        recipeStep.LstUnit.Add(new TCPUnit());
-            //        recipeStep.LstUnit.Add(new BiasUnit());
-            //        recipeStep.LstUnit.Add(new GasControlUnit());
-            //        recipeStep.LstUnit.Add(new ESCHVUnit());
-            //        recipeStep.LstUnit.Add(new ProcessKitUnit());
-            //        break;
-
-            //    case JetChamber.Kepler2200A:
-            //        recipeStep.LstUnit.Add(new Kepler2200GasControlUnit());
-
-            //        recipeStep.LstUnit.Add(new HeaterUnit());
-            //        recipeStep.LstUnit.Add(new Kepler2200RFUnit());
-
-
-
-
-
-            //        break;
-            //}
-            //CurrentRecipe.Steps.Insert(insertIndex, recipeStep);
-            //for (int i=0;i< CurrentRecipe.Steps.Count;i++)
-            //{
-            //    CurrentRecipe.Steps[i].StepNo = i + 1;
-            //}
-            //LoadRecipe(CurrentRecipe);
+        {         
             var t = ((sender as MenuItem).Parent as ContextMenu).PlacementTarget as TextBox;
             var t = ((sender as MenuItem).Parent as ContextMenu).PlacementTarget as TextBox;
             int insertIndex = Convert.ToInt32(t.Text);
             int insertIndex = Convert.ToInt32(t.Text);
 
 
             if (copyIndex == -1)
             if (copyIndex == -1)
             {
             {
                 var recipeStep = new RecipeStep();
                 var recipeStep = new RecipeStep();
-                switch (currentChamber)
-                {
-                    case JetChamber.Venus:
-                        recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
-                        recipeStep.LstUnit.Add(new TCPUnit());
-                        recipeStep.LstUnit.Add(new BiasUnit());
-                        recipeStep.LstUnit.Add(new GasControlUnit());
-                        recipeStep.LstUnit.Add(new ESCHVUnit());
-                        recipeStep.LstUnit.Add(new ProcessKitUnit());
-                        break;
-                    case JetChamber.Kepler2300:
-                        recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
-                        recipeStep.LstUnit.Add(new TCPUnit());
-                        recipeStep.LstUnit.Add(new BiasUnit());
-                        recipeStep.LstUnit.Add(new GasControlUnit());
-                        recipeStep.LstUnit.Add(new ProcessKitUnit());
-                        break;
-
-                    case JetChamber.Kepler2200A:
-                        recipeStep.LstUnit.Add(new Kepler2200GasControlUnit());
-
-                        recipeStep.LstUnit.Add(new HeaterUnit());
-                        recipeStep.LstUnit.Add(new Kepler2200RFUnit());
-
-                        break;
-                }
+                //switch (currentChamber)
+                //{
+                //    case JetChamber.Venus:
+                //        recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
+                //        recipeStep.LstUnit.Add(new TCPUnit());
+                //        recipeStep.LstUnit.Add(new BiasUnit());
+                //        recipeStep.LstUnit.Add(new GasControlUnit());
+                //        recipeStep.LstUnit.Add(new ESCHVUnit());
+                //        recipeStep.LstUnit.Add(new ProcessKitUnit());
+                //        break;
+                //    case JetChamber.Kepler2300:
+                //        recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
+                //        recipeStep.LstUnit.Add(new TCPUnit());
+                //        recipeStep.LstUnit.Add(new BiasUnit());
+                //        recipeStep.LstUnit.Add(new GasControlUnit());
+                //        recipeStep.LstUnit.Add(new ProcessKitUnit());
+                //        break;
 
 
+                //    case JetChamber.Kepler2200A:
+                //        recipeStep.LstUnit.Add(new Kepler2200GasControlUnit());
+                //        recipeStep.LstUnit.Add(new HeaterUnit());
+                //        recipeStep.LstUnit.Add(new Kepler2200RFUnit());
+                //        break;
+                //}
+                recipeStep.LstUnit=RecipeUnity.GetAllUnits(currentChamber, CurrentRecipe.Header.Type);
                 CurrentRecipe.Steps.Insert(insertIndex, recipeStep);
                 CurrentRecipe.Steps.Insert(insertIndex, recipeStep);
             }
             }
             else
             else
@@ -1002,49 +971,50 @@ namespace Venus_MainPages.ViewModels
                 {
                 {
                     Type unitType = x.GetType();
                     Type unitType = x.GetType();
                     bool isIgnore = false;
                     bool isIgnore = false;
-                    switch (currentChamber)
-                    {
-
-                        case JetChamber.Venus:
-                            var VenusUnitsValues = Enum.GetValues(typeof(VenusUnits));
-                            foreach (var item in VenusUnitsValues)
-                            {
-                                if (item.ToString() == unitType.Name)
-                                {
-                                    isIgnore = true;
-                                    break;
-                                }
-                            }
-                            break;
-                        case JetChamber.Kepler2300:
-                            var Kepler2300UintsValues = Enum.GetValues(typeof(Kepler2300Uints));
-                            foreach (var item in Kepler2300UintsValues)
-                            {
-                                if (item.ToString() == unitType.Name)
-                                {
-                                    isIgnore = true;
-                                    break;
-                                }
-                            }
-                            break;
-                        case JetChamber.Kepler2200A:
-                            var Kepler2200AUintsValues = Enum.GetValues(typeof(Kepler2200AUnits));
-                            foreach (var item in Kepler2200AUintsValues)
-                            {
-                                if (item.ToString() == unitType.Name)
-                                {
-                                    isIgnore = true;
-                                    break;
-                                }
-                            }
-                            break;
-                        case JetChamber.Kepler2200B:
-                            break;
-                    }
-                    if (!isIgnore)
-                    {
-                        continue;
-                    }
+       
+                    //switch (currentChamber)
+                    //{
+
+                    //    case JetChamber.Venus:
+                    //        var VenusUnitsValues = Enum.GetValues(typeof(VenusUnits));
+                    //        foreach (var item in VenusUnitsValues)
+                    //        {
+                    //            if (item.ToString() == unitType.Name)
+                    //            {
+                    //                isIgnore = true;
+                    //                break;
+                    //            }
+                    //        }
+                    //        break;
+                    //    case JetChamber.Kepler2300:
+                    //        var Kepler2300UintsValues = Enum.GetValues(typeof(Kepler2300Uints));
+                    //        foreach (var item in Kepler2300UintsValues)
+                    //        {
+                    //            if (item.ToString() == unitType.Name)
+                    //            {
+                    //                isIgnore = true;
+                    //                break;
+                    //            }
+                    //        }
+                    //        break;
+                    //    case JetChamber.Kepler2200A:
+                    //        var Kepler2200AUintsValues = Enum.GetValues(typeof(Kepler2200AUnits));
+                    //        foreach (var item in Kepler2200AUintsValues)
+                    //        {
+                    //            if (item.ToString() == unitType.Name)
+                    //            {
+                    //                isIgnore = true;
+                    //                break;
+                    //            }
+                    //        }
+                    //        break;
+                    //    case JetChamber.Kepler2200B:
+                    //        break;
+                    //}
+                    //if (!isIgnore)
+                    //{
+                    //    continue;
+                    //}
                     Binding checkbinding = null;
                     Binding checkbinding = null;
                     foreach (PropertyInfo propertyInfo in unitType.GetProperties())
                     foreach (PropertyInfo propertyInfo in unitType.GetProperties())
                     {
                     {
@@ -1276,21 +1246,11 @@ namespace Venus_MainPages.ViewModels
                     }
                     }
                     k++;
                     k++;
                 }
                 }
-                //recipeStep.LstUnit.ToList().ForEach(x =>
-                //{
-                   
-                //});
-                //index++;
             }
             }
 
 
 
 
 
 
         }
         }
-        //private void EPDcomboBox_DropDownOpened(object sender, EventArgs e)
-        //{
-           
-        //}
-
         private void EPDButton_Click(object sender, RoutedEventArgs e)
         private void EPDButton_Click(object sender, RoutedEventArgs e)
         {
         {
             Button button = sender as Button;
             Button button = sender as Button;
@@ -1304,7 +1264,6 @@ namespace Venus_MainPages.ViewModels
 
 
            (new EndPointDlg(para, endpointconfigitem,CurrentRecipe)).ShowDialog();
            (new EndPointDlg(para, endpointconfigitem,CurrentRecipe)).ShowDialog();
         }
         }
-
         private void UpdateRecipeFileList()
         private void UpdateRecipeFileList()
         {
         {
             XmlDocument doc = new XmlDocument();
             XmlDocument doc = new XmlDocument();
@@ -1366,59 +1325,59 @@ namespace Venus_MainPages.ViewModels
                 bodyStackPanel.Children.Add(deChuckGrid);
                 bodyStackPanel.Children.Add(deChuckGrid);
             }
             }
         }
         }
-        private void OnAddStep(int index)
-        {
-            if (CurrentRecipe != null)
-            {
-                RecipeStep recipeStep;
-                if (copyIndex == -1)
-                {
-                    recipeStep = new RecipeStep();
-                    switch (currentChamber)
-                    {
-                        case JetChamber.Venus:
-                            recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
-                            recipeStep.LstUnit.Add(new TCPUnit());
-                            recipeStep.LstUnit.Add(new BiasUnit());
-                            recipeStep.LstUnit.Add(new GasControlUnit());
-                            recipeStep.LstUnit.Add(new ESCHVUnit());
-                            recipeStep.LstUnit.Add(new ProcessKitUnit());
-                            break;
-                        case JetChamber.Kepler2300:
-                            recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
-                            recipeStep.LstUnit.Add(new TCPUnit());
-                            recipeStep.LstUnit.Add(new BiasUnit());
-                            recipeStep.LstUnit.Add(new GasControlUnit());
-                            recipeStep.LstUnit.Add(new ProcessKitUnit());
-                            break;
-
-                        case JetChamber.Kepler2200A:
-                            recipeStep.LstUnit.Add(new Kepler2200GasControlUnit());
-                            recipeStep.LstUnit.Add(new HeaterUnit());
-                            recipeStep.LstUnit.Add(new Kepler2200RFUnit());
-
-                            break;
-                    }
-                    CurrentRecipe.Steps.Insert(index - 1, recipeStep);
-
-                }
-                else
-                {
-                    var t = JsonConvert.SerializeObject(CurrentRecipe);
-                    recipeStep = Recipe.Load(t).Steps[copyIndex - 1];
-
-                    CurrentRecipe.Steps.Insert(index - 1, recipeStep);
-                }
-
-
-                RecipeStepToGridColumn(recipeStep, currentRecipeGrid, index, true);
-
-                for (int i = 1; i <= CurrentRecipe.Steps.Count; i++)
-                {
-                    CurrentRecipe.Steps[i - 1].StepNo = i;
-                }
-            }
-        }
+        ////private void OnAddStep(int index)
+        ////{
+        ////    if (CurrentRecipe != null)
+        ////    {
+        ////        RecipeStep recipeStep;
+        ////        if (copyIndex == -1)
+        ////        {
+        ////            recipeStep = new RecipeStep();
+        ////            switch (currentChamber)
+        ////            {
+        ////                case JetChamber.Venus:
+        ////                    recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
+        ////                    recipeStep.LstUnit.Add(new TCPUnit());
+        ////                    recipeStep.LstUnit.Add(new BiasUnit());
+        ////                    recipeStep.LstUnit.Add(new GasControlUnit());
+        ////                    recipeStep.LstUnit.Add(new ESCHVUnit());
+        ////                    recipeStep.LstUnit.Add(new ProcessKitUnit());
+        ////                    break;
+        ////                case JetChamber.Kepler2300:
+        ////                    recipeStep.LstUnit.Add(new PressureByPressureModeUnit());
+        ////                    recipeStep.LstUnit.Add(new TCPUnit());
+        ////                    recipeStep.LstUnit.Add(new BiasUnit());
+        ////                    recipeStep.LstUnit.Add(new GasControlUnit());
+        ////                    recipeStep.LstUnit.Add(new ProcessKitUnit());
+        ////                    break;
+
+        ////                case JetChamber.Kepler2200A:
+        ////                    recipeStep.LstUnit.Add(new Kepler2200GasControlUnit());
+        ////                    recipeStep.LstUnit.Add(new HeaterUnit());
+        ////                    recipeStep.LstUnit.Add(new Kepler2200RFUnit());
+
+        ////                    break;
+        ////            }
+        ////            CurrentRecipe.Steps.Insert(index - 1, recipeStep);
+
+        ////        }
+        ////        else
+        ////        {
+        ////            var t = JsonConvert.SerializeObject(CurrentRecipe);
+        ////            recipeStep = Recipe.Load(t).Steps[copyIndex - 1];
+
+        ////            CurrentRecipe.Steps.Insert(index - 1, recipeStep);
+        ////        }
+
+
+        ////        RecipeStepToGridColumn(recipeStep, currentRecipeGrid, index, true);
+
+        ////        for (int i = 1; i <= CurrentRecipe.Steps.Count; i++)
+        ////        {
+        ////            CurrentRecipe.Steps[i - 1].StepNo = i;
+        ////        }
+        ////    }
+        ////}
         private void OnDeleteStep(int index)
         private void OnDeleteStep(int index)
         {
         {
             if (CurrentRecipe != null && CurrentRecipe.Steps.Count > 1)
             if (CurrentRecipe != null && CurrentRecipe.Steps.Count > 1)
@@ -1433,7 +1392,6 @@ namespace Venus_MainPages.ViewModels
 
 
             }
             }
         }
         }
-
         private void OnRefresh()
         private void OnRefresh()
         {
         {
             if (CurrentRecipeName != "")
             if (CurrentRecipeName != "")
@@ -1441,8 +1399,7 @@ namespace Venus_MainPages.ViewModels
                 string xmlRecipeData = m_uiRecipeManager.LoadRecipe(ModuleName, CurrentRecipeName);
                 string xmlRecipeData = m_uiRecipeManager.LoadRecipe(ModuleName, CurrentRecipeName);
                 CurrentRecipe = Recipe.Load(xmlRecipeData);
                 CurrentRecipe = Recipe.Load(xmlRecipeData);
                 LoadRecipe(CurrentRecipe);
                 LoadRecipe(CurrentRecipe);
-            }
-           
+            }         
         }
         }
         #endregion
         #endregion
     }
     }

+ 1 - 1
Venus/Venus_MainPages/Views/OverKepler2200AView.xaml

@@ -1166,7 +1166,7 @@
                 <customControls:SplitButton Width="120" Height="30" Content="Abort"   Margin="50,0,30,0" Style="{StaticResource SplitButtonStyle}" Command="{Binding PMAbortCommnad}" Cursor="Hand"  Foreground="White" FontSize="18" Background="#009ad6">
                 <customControls:SplitButton Width="120" Height="30" Content="Abort"   Margin="50,0,30,0" Style="{StaticResource SplitButtonStyle}" Command="{Binding PMAbortCommnad}" Cursor="Hand"  Foreground="White" FontSize="18" Background="#009ad6">
                     <MenuItem Header="Stop Recipe" Cursor="Hand"                                          Command="{Binding AbortRecipeCommnad}" CommandParameter="0"/>
                     <MenuItem Header="Stop Recipe" Cursor="Hand"                                          Command="{Binding AbortRecipeCommnad}" CommandParameter="0"/>
                     <!--<MenuItem Header="Stop Recipe/Stop Dechuck Step" Cursor="Hand"                        Command="{Binding AbortRecipeCommnad}" CommandParameter="1"/>-->
                     <!--<MenuItem Header="Stop Recipe/Stop Dechuck Step" Cursor="Hand"                        Command="{Binding AbortRecipeCommnad}" CommandParameter="1"/>-->
-                    <MenuItem Header="Stop Recipe/Return Wafer To Foup" Cursor="Hand"   Command="{Binding AbortRecipeCommnad}" CommandParameter="2"/>
+                    <MenuItem Header="Stop Recipe=>Return Wafer To Foup" Cursor="Hand"   Command="{Binding AbortRecipeCommnad}" CommandParameter="2"/>
                 </customControls:SplitButton>
                 </customControls:SplitButton>
                 <RadioButton Content="OffLine"     Width="120" Height="28" Margin="0 0 5 0" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding IsAutoMode,Converter={StaticResource BoolToBool},Mode=TwoWay}" FontSize="15"/>
                 <RadioButton Content="OffLine"     Width="120" Height="28" Margin="0 0 5 0" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding IsAutoMode,Converter={StaticResource BoolToBool},Mode=TwoWay}" FontSize="15"/>
                 <RadioButton Content="OnLine"      Width="120" Height="28" Margin="0 0 30 0" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding IsAutoMode,Mode=TwoWay}" FontSize="15"/>
                 <RadioButton Content="OnLine"      Width="120" Height="28" Margin="0 0 30 0" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding IsAutoMode,Mode=TwoWay}" FontSize="15"/>

+ 1 - 1
Venus/Venus_MainPages/Views/OverKepler2300View.xaml

@@ -1242,7 +1242,7 @@
                 <customControls:SplitButton Width="120" Height="30" Content="Abort"   Margin="50,0,30,0" Style="{StaticResource SplitButtonStyle}" Command="{Binding PMAbortCommnad}" Cursor="Hand"  Foreground="White" FontSize="18" Background="#009ad6">
                 <customControls:SplitButton Width="120" Height="30" Content="Abort"   Margin="50,0,30,0" Style="{StaticResource SplitButtonStyle}" Command="{Binding PMAbortCommnad}" Cursor="Hand"  Foreground="White" FontSize="18" Background="#009ad6">
                     <MenuItem Header="Stop Recipe" Cursor="Hand"                                          Command="{Binding AbortRecipeCommnad}" CommandParameter="0"/>
                     <MenuItem Header="Stop Recipe" Cursor="Hand"                                          Command="{Binding AbortRecipeCommnad}" CommandParameter="0"/>
                     <!--<MenuItem Header="Stop Recipe/Stop Dechuck Step" Cursor="Hand"                        Command="{Binding AbortRecipeCommnad}" CommandParameter="1"/>-->
                     <!--<MenuItem Header="Stop Recipe/Stop Dechuck Step" Cursor="Hand"                        Command="{Binding AbortRecipeCommnad}" CommandParameter="1"/>-->
-                    <MenuItem Header="Stop Recipe/Return Wafer To Foup" Cursor="Hand"   Command="{Binding AbortRecipeCommnad}" CommandParameter="2"/>
+                    <MenuItem Header="Stop Recipe=>Return Wafer To Foup" Cursor="Hand"   Command="{Binding AbortRecipeCommnad}" CommandParameter="2"/>
                 </customControls:SplitButton>
                 </customControls:SplitButton>
                 <RadioButton Content="OffLine"     Width="120" Height="28" Margin="0 0 5 0" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding IsAutoMode,Converter={StaticResource BoolToBool},Mode=TwoWay}" FontSize="15" Command="{Binding OfflineCommand}"/>
                 <RadioButton Content="OffLine"     Width="120" Height="28" Margin="0 0 5 0" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding IsAutoMode,Converter={StaticResource BoolToBool},Mode=TwoWay}" FontSize="15" Command="{Binding OfflineCommand}"/>
                 <RadioButton Content="OnLine"      Width="120" Height="28" Margin="0 0 30 0" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding IsAutoMode,Mode=TwoWay}" FontSize="15"                                      Command="{Binding OnlineCommand}"/>
                 <RadioButton Content="OnLine"      Width="120" Height="28" Margin="0 0 30 0" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding IsAutoMode,Mode=TwoWay}" FontSize="15"                                      Command="{Binding OnlineCommand}"/>

+ 5 - 15
Venus/Venus_MainPages/Views/RecipeView.xaml

@@ -81,16 +81,6 @@
                             <i:InvokeCommandAction Command="{Binding MouseRightButtonDownCommand}" CommandParameter="{Binding ElementName=treeViewRcpList}"/>
                             <i:InvokeCommandAction Command="{Binding MouseRightButtonDownCommand}" CommandParameter="{Binding ElementName=treeViewRcpList}"/>
                         </i:EventTrigger>
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                     </i:Interaction.Triggers>
-                    <!--<TreeView.ItemContainerStyle>
-                        <Style TargetType="{x:Type TreeViewItem}">
-                            <Style.Resources>
-                                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="DodgerBlue"/>
-                                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="White"/>
-                                <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="DodgerBlue"/>
-                                <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="White"/>
-                            </Style.Resources>
-                        </Style>
-                    </TreeView.ItemContainerStyle>-->
                 </TreeView>
                 </TreeView>
             </Border>
             </Border>
         </Grid>
         </Grid>
@@ -102,11 +92,11 @@
             </Grid.RowDefinitions>
             </Grid.RowDefinitions>
             <StackPanel Grid.Row="0" Orientation="Horizontal">
             <StackPanel Grid.Row="0" Orientation="Horizontal">
                 <!--<customeControls:PathButton PathData="{StaticResource Icon_Save}"    Content="Save"           DefaultFillBrush="White"     Command="{Binding SaveRecipeCommand}"    Margin="30,4,22,0"        FontSize="16" Height="30"   Width="130"   VerticalContentAlignment="Center"  HorizontalAlignment="Right" VerticalAlignment="Top"/>-->
                 <!--<customeControls:PathButton PathData="{StaticResource Icon_Save}"    Content="Save"           DefaultFillBrush="White"     Command="{Binding SaveRecipeCommand}"    Margin="30,4,22,0"        FontSize="16" Height="30"   Width="130"   VerticalContentAlignment="Center"  HorizontalAlignment="Right" VerticalAlignment="Top"/>-->
-                <customeControls:SplitButton  Content="Abort"    Style="{StaticResource SplitButtonStyle}" Command="{Binding SaveRecipeCommand}" Cursor="Hand"  Foreground="White" Margin="30,4,22,0"        FontSize="16" Height="30"   Width="130">
-                    <MenuItem Header="Save as PMA" Cursor="Hand"   Command="{Binding AbortRecipeCommnad}" CommandParameter="0"/>
-                    <MenuItem Header="Save as PMB" Cursor="Hand"   Command="{Binding AbortRecipeCommnad}" CommandParameter="1"/>
-                    <MenuItem Header="Save as PMC" Cursor="Hand"   Command="{Binding AbortRecipeCommnad}" CommandParameter="2"/>
-                    <MenuItem Header="Save as PMD" Cursor="Hand"   Command="{Binding AbortRecipeCommnad}" CommandParameter="2"/>
+                <customeControls:SplitButton  Content="Save"    Style="{StaticResource SplitButtonStyle}" Command="{Binding SaveRecipeCommand}" Cursor="Hand"  Foreground="White" Margin="30,0,22,0"        FontSize="16" Height="30"   Width="130" Background="#009ad6">
+                    <MenuItem Header="Save To PMA" Cursor="Hand"   Command="{Binding SaveRecipeCommand}" CommandParameter="0"/>
+                    <MenuItem Header="Save To PMB" Cursor="Hand"   Command="{Binding SaveRecipeCommand}" CommandParameter="1"/>
+                    <MenuItem Header="Save To PMC" Cursor="Hand"   Command="{Binding SaveRecipeCommand}" CommandParameter="2"/>
+                    <MenuItem Header="Save To PMD" Cursor="Hand"   Command="{Binding SaveRecipeCommand}" CommandParameter="3"/>
                 </customeControls:SplitButton>
                 </customeControls:SplitButton>
                 
                 
                 <customeControls:PathButton PathData="{StaticResource Icon_Add}"     Content="Add Step"       DefaultFillBrush="White"     Command="{Binding AddStepCommand}"       Margin="30,4,22,0"        FontSize="16" Height="30"   Width="130"   VerticalContentAlignment="Center"  HorizontalAlignment="Right" VerticalAlignment="Top"/>
                 <customeControls:PathButton PathData="{StaticResource Icon_Add}"     Content="Add Step"       DefaultFillBrush="White"     Command="{Binding AddStepCommand}"       Margin="30,4,22,0"        FontSize="16" Height="30"   Width="130"   VerticalContentAlignment="Center"  HorizontalAlignment="Right" VerticalAlignment="Top"/>

+ 5 - 1
Venus/Venus_RT/Devices/JetKepler2200APM.cs

@@ -192,8 +192,12 @@ namespace Venus_RT.Devices
         public override MovementPosition LiftPinPosition
         public override MovementPosition LiftPinPosition
         {
         {
             get
             get
-            {
+            {              
                 MovementPosition pos = MovementPosition.Unknown;
                 MovementPosition pos = MovementPosition.Unknown;
+                if (_LiftPin == null)
+                {
+                   return MovementPosition.Down;
+                }
                 if (_LiftPin.ONFeedback && !_LiftPin.OFFFeedback)
                 if (_LiftPin.ONFeedback && !_LiftPin.OFFFeedback)
                 {
                 {
                     pos = MovementPosition.Up;
                     pos = MovementPosition.Up;

+ 1 - 1
Venus/Venus_RT/Modules/PMs/PMHomeRoutine.cs

@@ -43,7 +43,7 @@ namespace Venus_RT.Modules.PMs
         }
         }
 
 
         private bool IsHomed()
         private bool IsHomed()
-        {
+        {          
             return _chamber.IsSlitDoorClosed && _chamber.LiftPinPosition == Venus_Core.MovementPosition.Down && _chamber.PVN22ValveIsOpen;
             return _chamber.IsSlitDoorClosed && _chamber.LiftPinPosition == Venus_Core.MovementPosition.Down && _chamber.PVN22ValveIsOpen;
         }
         }
     }
     }

+ 68 - 0
Venus/Venus_RT/Modules/PMs/ProcessDefine.cs

@@ -8,6 +8,7 @@ using Venus_Core;
 using Aitex.Core.RT.SCCore;
 using Aitex.Core.RT.SCCore;
 using System.Reflection;
 using System.Reflection;
 using System.Diagnostics;
 using System.Diagnostics;
+using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
 //#pragma warning disable 0436
 //#pragma warning disable 0436
 
 
 namespace Venus_RT.Modules.PMs
 namespace Venus_RT.Modules.PMs
@@ -66,6 +67,14 @@ namespace Venus_RT.Modules.PMs
             startHelper     [$"{Module}.ProcessKitUnit"]              = (ProcessUnitBase unit, RecipeStep step) => ProcessKitUnit_Start(unit, step);
             startHelper     [$"{Module}.ProcessKitUnit"]              = (ProcessUnitBase unit, RecipeStep step) => ProcessKitUnit_Start(unit, step);
             checkerHelper   [$"{Module}.ProcessKitUnit"]              = (ProcessUnitBase unit, RecipeStep step) => ProcessKitUnit_Check(unit, step);
             checkerHelper   [$"{Module}.ProcessKitUnit"]              = (ProcessUnitBase unit, RecipeStep step) => ProcessKitUnit_Check(unit, step);
             endHelper       [$"{Module}.ProcessKitUnit"]              = (ProcessUnitBase unit, RecipeStep step) => ProcessKitUnit_End(unit, step);
             endHelper       [$"{Module}.ProcessKitUnit"]              = (ProcessUnitBase unit, RecipeStep step) => ProcessKitUnit_End(unit, step);
+
+            startHelper     [$"{Module}.Kepler2200GasControlUnit"]    = (ProcessUnitBase unit, RecipeStep step) => Kepler2200GasControlUnit_Start(unit, step);
+            checkerHelper   [$"{Module}.Kepler2200GasControlUnit"]    = (ProcessUnitBase unit, RecipeStep step) => Kepler2200GasControlUnit_Check(unit, step);
+            endHelper       [$"{Module}.Kepler2200GasControlUnit"]    = (ProcessUnitBase unit, RecipeStep step) => Kepler2200GasControlUnit_End(unit, step);
+
+            startHelper     [$"{Module}.HeaterUnit"]                  = (ProcessUnitBase unit, RecipeStep step) => HeaterUnit_Start(unit, step);
+            checkerHelper   [$"{Module}.HeaterUnit"]                  = (ProcessUnitBase unit, RecipeStep step) => HeaterUnit_Check(unit, step);
+            endHelper       [$"{Module}.HeaterUnit"]                  = (ProcessUnitBase unit, RecipeStep step) => HeaterUnit_End(unit, step);
         }
         }
 
 
         private RState PressureByPressureModeUnit_Start(ProcessUnitBase unit, RecipeStep step)
         private RState PressureByPressureModeUnit_Start(ProcessUnitBase unit, RecipeStep step)
@@ -461,6 +470,65 @@ namespace Venus_RT.Modules.PMs
         {
         {
         }
         }
 
 
+        private RState Kepler2200GasControlUnit_Start(ProcessUnitBase unit, RecipeStep step)
+        {
+            Chamber.OpenValve(ValveType.GasFinal, true);
+            var ProcessUnit = unit as Kepler2200GasControlUnit;
+            Chamber.FlowGas(0, ProcessUnit.Gas1);
+            if (ProcessUnit.Gas1 >= 1)
+            {
+                Chamber.OpenValve(ValveType.PV11, true);
+            }
+            Chamber.FlowGas(1, ProcessUnit.Gas2);
+            if (ProcessUnit.Gas2 >= 1)
+            {
+                Chamber.OpenValve(ValveType.PV21, true);
+            }
+            Chamber.FlowGas(2, ProcessUnit.Gas3);
+            if (ProcessUnit.Gas3 >= 1)
+            {
+                Chamber.OpenValve(ValveType.PV31, true);
+            }
+            Chamber.FlowGas(3, ProcessUnit.Gas4);
+            if (ProcessUnit.Gas4 >= 1)
+            {
+                Chamber.OpenValve(ValveType.PV41, true);
+            }
+            Chamber.FlowGas(4, ProcessUnit.Gas5);
+            Chamber.FlowGas(5, ProcessUnit.Gas6);
+
+            return RState.Running;
+        }
+
+        private RState Kepler2200GasControlUnit_Check(ProcessUnitBase unit, RecipeStep step)
+        {
+            return RState.Running;
+        }
+
+        private void Kepler2200GasControlUnit_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);
+        }
+
+        private RState HeaterUnit_Start(ProcessUnitBase unit, RecipeStep step)
+        {          
+            return RState.Running;
+        }
+
+        private RState HeaterUnit_Check(ProcessUnitBase unit, RecipeStep step)
+        {
+            return RState.Running;
+        }
+
+        private void HeaterUnit_End(ProcessUnitBase unit, RecipeStep step)
+        {
+            
+        }
         public bool LoadMethods(ProcessUnitBase unit)
         public bool LoadMethods(ProcessUnitBase unit)
         {
         {
             var className = $"{Module}.{unit.GetType().Name}";
             var className = $"{Module}.{unit.GetType().Name}";

+ 3 - 3
Venus/Venus_Themes/UserControls/RecipeNameInputDlg.xaml

@@ -11,9 +11,9 @@
     <StackPanel>
     <StackPanel>
         <TextBlock Text="请选择配方类型:" HorizontalAlignment="Left" FontSize="12" Margin="15" />
         <TextBlock Text="请选择配方类型:" HorizontalAlignment="Left" FontSize="12" Margin="15" />
         <StackPanel Orientation="Horizontal" Margin="5,0,0,0">
         <StackPanel Orientation="Horizontal" Margin="5,0,0,0">
-            <RadioButton Content="Chuck"      Margin="5,0,0,0" IsChecked="True" Checked="RadioButton_Checked"/>
-            <RadioButton Content="DeChuck"    Margin="5,0,0,0" Checked="RadioButton_Checked"/>
-            <RadioButton Content="Process"    Margin="5,0,0,0" Checked="RadioButton_Checked"/>
+            <RadioButton Content="Chuck"      Margin="5,0,0,0" Checked="RadioButton_Checked" x:Name="chuckRadioButton"/>
+            <RadioButton Content="DeChuck"    Margin="5,0,0,0" Checked="RadioButton_Checked" x:Name="dechuckRadioButton"/>
+            <RadioButton Content="Process"    Margin="5,0,0,0" Checked="RadioButton_Checked" IsChecked="True"/>
             <RadioButton Content="Clean"      Margin="5,0,0,0" Checked="RadioButton_Checked"/>
             <RadioButton Content="Clean"      Margin="5,0,0,0" Checked="RadioButton_Checked"/>
         </StackPanel>
         </StackPanel>
         <TextBlock Text="请输入配方名称:" HorizontalAlignment="Left" FontSize="12" Margin="15" x:Name="labelCaption"/>
         <TextBlock Text="请输入配方名称:" HorizontalAlignment="Left" FontSize="12" Margin="15" x:Name="labelCaption"/>

+ 6 - 13
Venus/Venus_Themes/UserControls/RecipeNameInputDlg.xaml.cs

@@ -1,18 +1,7 @@
 using System;
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using System.Text.RegularExpressions;
 using System.Text.RegularExpressions;
-using System.Threading.Tasks;
 using System.Windows;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
 
 
 namespace Venus_Themes.UserControls
 namespace Venus_Themes.UserControls
 {
 {
@@ -21,12 +10,17 @@ namespace Venus_Themes.UserControls
     /// </summary>
     /// </summary>
     public partial class RecipeNameInputDlg : Window
     public partial class RecipeNameInputDlg : Window
     {
     {
-        public RecipeNameInputDlg(string caption)
+        public RecipeNameInputDlg(string caption, bool hasHV)
         {
         {
             InitializeComponent();
             InitializeComponent();
             labelCaption.Text = caption;
             labelCaption.Text = caption;
             this.buttonOK.IsEnabled = false;
             this.buttonOK.IsEnabled = false;
             this.textBoxInput.Focus();
             this.textBoxInput.Focus();
+            if (!hasHV)
+            {
+                chuckRadioButton.Visibility = Visibility.Collapsed;
+                dechuckRadioButton.Visibility = Visibility.Collapsed;
+            }
         }
         }
         public RecipeNameInputDlg(string caption, string title)
         public RecipeNameInputDlg(string caption, string title)
         {
         {
@@ -55,7 +49,6 @@ namespace Venus_Themes.UserControls
             else
             else
             {
             {
                 this.buttonOK.IsEnabled = IsValidFileName(textBoxInput.Text);
                 this.buttonOK.IsEnabled = IsValidFileName(textBoxInput.Text);
-
             }
             }
         }
         }