Browse Source

右击wafer报错bug修复

lixiang 1 year ago
parent
commit
7c5d66a96d

+ 2 - 0
Venus/Framework/Common/RecipeCenter/IRecipeService.cs

@@ -33,6 +33,8 @@ namespace MECF.Framework.Common.RecipeCenter
 
         [OperationContract]
         bool SaveAsRecipe(ModuleName chamId, string recipeName, string recipeContent);
+        [OperationContract]
+        bool SaveAsRecipe2(ModuleName chamId,string type, string recipeName, string recipeContent);
 
         [OperationContract]
         bool SaveRecipe(ModuleName chamId, string recipeName, string recipeContent);

+ 45 - 26
Venus/Framework/Common/RecipeCenter/RecipeFileManager.cs

@@ -596,6 +596,17 @@ namespace Aitex.Core.RT.RecipeCenter
             return SaveRecipe(chamId, recipeName, recipeContent, true, true);
         }
 
+        public bool SaveAsRecipe2(string chamId,string type, string recipeName, string recipeContent)
+        {
+            var path = GenerateRecipeFilePath(chamId, recipeName);
+            //if (File.Exists(path))
+            //{
+            //    WarningDialog(string.Format(Resources.RecipeFileManager_SaveAsRecipe_RecipeFile0savefailed, recipeName));
+            //    return false;
+            //}
+            return SaveRecipe2(chamId,type, recipeName, recipeContent, true, true);
+        }
+
         /// <summary>
         /// save recipe content
         /// </summary>
@@ -605,17 +616,6 @@ namespace Aitex.Core.RT.RecipeCenter
         /// <returns></returns>
         public bool SaveRecipe(string chamId, string recipeName, string recipeContent, bool clearBarcode, bool notifyUI)
         {
-            //validate recipe format when saving a recipe file
-            //var reasons1 = new List<string>();
-            //var reasons2 = new List<string>();
-            //ValidateRecipe(chamId, recipeName, recipeContent, out reasons1);
-            //CheckRecipe(chamId, recipeContent, out reasons2);
-            //reasons1.AddRange(reasons2);
-            //if (reasons1.Count > 0)
-            //{
-            //    EventDialog(string.Format( Resources.RecipeFileManager_SaveRecipe_SaveRecipeContentError, recipeName), reasons1);
-            //}
-
             bool ret = true;
             try
             {
@@ -630,22 +630,42 @@ namespace Aitex.Core.RT.RecipeCenter
                 
                 File.WriteAllText(path, RecipeUnity.ConvertJsonString(recipeContent), Encoding.UTF8);
 
-                //XmlDocument xml = new XmlDocument();
-                //xml.LoadXml(recipeContent);
+            }
+            catch (Exception ex)
+            {
+                LOG.WriteExeption("保存recipe file 出错", ex);
+
+                if (notifyUI)
+                {
+                    WarningDialog(string.Format(Resources.RecipeFileManager_SaveRecipe_RecipeFile0SaveFailed, recipeName));
+                }
+                ret = false;
+            }
+            return ret;
+        }
+        /// <summary>
+        /// save recipe content
+        /// </summary>
+        /// <param name="chamId"></param>
+        /// <param name="recipeName"></param>
+        /// <param name="recipeContent"></param>
+        /// <returns></returns>
+        public bool SaveRecipe2(string chamId,string type, string recipeName, string recipeContent, bool clearBarcode, bool notifyUI)
+        {
+            bool ret = true;
+            try
+            {
+                var path = GenerateRecipeFilePath(chamId, recipeName);
+
+                if (!_rcpContext.EnableEdit(path))
+                    return false;
 
-                //XmlTextWriter writer = new XmlTextWriter(path, null);
-                //writer.Formatting = Formatting.Indented;
-                //xml.Save(writer);
-                //writer.Close();
+                FileInfo fi = new FileInfo(path);
+                if (!fi.Directory.Exists)
+                    fi.Directory.Create();
+
+                File.WriteAllText(path, RecipeUnity.ConvertJsonString(recipeContent), Encoding.UTF8);
 
-                //if (notifyUI)
-                //{
-                //    InfoDialog(string.Format(Resources.RecipeFileManager_SaveRecipe_RecipeFile0SaveCompleted, recipeName));
-                //}
-                //else
-                //{
-                //    EV.PostMessage("System", EventEnum.GeneralInfo, string.Format(Resources.RecipeFileManager_SaveRecipe_RecipeFile0SaveCompleted, recipeName));
-                //}
             }
             catch (Exception ex)
             {
@@ -660,7 +680,6 @@ namespace Aitex.Core.RT.RecipeCenter
             return ret;
         }
 
-
         /// <summary>
         /// move recipe file
         /// </summary>

+ 15 - 1
Venus/Framework/Common/RecipeCenter/RecipeService.cs

@@ -109,6 +109,7 @@ namespace MECF.Framework.Common.RecipeCenter
             LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Modify and save {0} Recipe: {1}", chamId, recipeName));
             return RecipeFileManager.Instance.SaveRecipe(chamId.ToString(), recipeName, recipeContent, false, false);
         }
+       
 
         /// <summary>
         /// move recipe content
@@ -138,7 +139,20 @@ namespace MECF.Framework.Common.RecipeCenter
             LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Modify and save as {0} recipe {1}", chamId, recipeName));
             return RecipeFileManager.Instance.SaveAsRecipe(chamId.ToString(), recipeName, recipeContent);
         }
-
+        /// <summary>
+        /// save recipe content
+        /// </summary>
+        /// <param name="chamId"></param>
+        /// <param name="recipeName"></param>
+        /// <param name="recipeContent"></param>
+        /// <returns></returns>
+        public bool SaveAsRecipe2(ModuleName chamId,string type, string recipeName, string recipeContent)
+        {
+            if (CheckSoftwareExpired())
+                return false;
+            LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Modify and save as {0} recipe {1}", chamId, recipeName));
+            return RecipeFileManager.Instance.SaveAsRecipe2(chamId.ToString(),type, recipeName, recipeContent);
+        }
         /// <summary>
         /// create a new recipe folder
         /// </summary>

+ 6 - 1
Venus/Framework/Common/RecipeCenter/RecipeServiceClient.cs

@@ -82,7 +82,12 @@ namespace MECF.Framework.Common.RecipeCenter
             Invoke(svc => { result = svc.SaveAsRecipe(chamId, recipeName, recipeContent); });
             return result;   
         }
-
+        public bool SaveAsRecipe2(ModuleName chamId,string type, string recipeName, string recipeContent)
+        {
+            bool result = false;
+            Invoke(svc => { result = svc.SaveAsRecipe2(chamId,type, recipeName, recipeContent); });
+            return result;
+        }
         public bool SaveRecipe(ModuleName chamId, string recipeName, string recipeContent)
         {
             bool result = false;

+ 25 - 0
Venus/Venus_Core/Recipe.cs

@@ -64,6 +64,31 @@ namespace Venus_Core
         Value,
         Percent
     }
+    public class VenusTolerance
+    { 
+    
+    }
+    public class Kepler2300Tolerance
+    {
+        public bool EnableTolerance { get; set; }
+        public ToleranceMode ToleranceMode { get; set; }
+        public int Gas1ToleranceValue { get; set; }
+        public int Gas1TolerancePercent { get; set; }
+        public int Gas2ToleranceValue { get; set; }
+        public int Gas2TolerancePercent { get; set; }
+        public int Gas3ToleranceValue { get; set; }
+        public int Gas3TolerancePercent { get; set; }
+        public int Gas4ToleranceValue { get; set; }
+        public int Gas4TolerancePercent { get; set; }
+        public int Gas5ToleranceValue { get; set; }
+        public int Gas5TolerancePercent { get; set; }
+        public int Gas6ToleranceValue { get; set; }
+        public int Gas6TolerancePercent { get; set; }
+        public int Gas7ToleranceValue { get; set; }
+        public int Gas7TolerancePercent { get; set; }
+        public int Gas8ToleranceValue { get; set; }
+        public int Gas8TolerancePercent { get; set; }
+    }
     public class RecipeHead : INotifyPropertyChanged
     {
         private string m_name;

+ 4 - 0
Venus/Venus_MainPages/PMS/UiRecipeManager.cs

@@ -31,6 +31,10 @@ namespace Venus_MainPages.PMs
         {
             return RecipeClient.Instance.Service.SaveAsRecipe(ModuleNameString.ToEnum(chamId), recipeName, recipeContent);
         }
+        public bool SaveAsRecipe2(string chamId,string type, string recipeName, string recipeContent)
+        {
+            return RecipeClient.Instance.Service.SaveAsRecipe2(ModuleNameString.ToEnum(chamId),type, recipeName, recipeContent);
+        }
 
         public bool SaveRecipe(string chamId, string recipeName, string recipeContent)
         {

+ 1 - 1
Venus/Venus_MainPages/Unity/ContextMenuManager.cs

@@ -59,7 +59,7 @@ namespace Venus_MainPages.Unity
         private readonly List<MenuElement> _SlotMenuElements = new List<MenuElement>() {
             new MenuElement(){ Name="Create Wafer", Invoke="CreateWafer"},
             new MenuElement(){ Name="Delete Wafer", Invoke="DeleteWafer"},
-            new MenuElement(){ Name="-", IsSeparator = true},
+            //new MenuElement(){ Name="-", IsSeparator = true},
             new MenuElement(){ Name="Return Wafer", Invoke="ReturnWafer"},
             //new MenuElement(){ Name="Return Wafer", Invoke="ReturnWafer"}
         };

+ 20 - 8
Venus/Venus_MainPages/ViewModels/RecipeViewModel.cs

@@ -27,6 +27,7 @@ using Venus_MainPages.PMs;
 using Venus_MainPages.Unity;
 using Venus_MainPages.Views;
 using Venus_Themes.UserControls;
+using Venus_Unity;
 using WPF.Themes.UserControls;
 using RecipeStep = Venus_Core.RecipeStep;
 
@@ -72,6 +73,8 @@ namespace Venus_MainPages.ViewModels
         private bool m_PMDIsInstalled;
 
         private List<string> moduleList = new List<string> ();
+        TreeViewFileItem selectedItem;
+
         #endregion
 
         #region  属性
@@ -150,14 +153,15 @@ namespace Venus_MainPages.ViewModels
         private DelegateCommand _RefreshCommand;
         public DelegateCommand RefreshCommand =>
             _RefreshCommand ?? (_RefreshCommand = new DelegateCommand(OnRefresh));
-        TreeViewFileItem selectedItem;
-
+        private DelegateCommand _ToleranceCommand;
+        public DelegateCommand ToleranceCommand =>
+            _ToleranceCommand ?? (_ToleranceCommand = new DelegateCommand(OnTolerance));
         #endregion
 
 
         #region 命令方法
-      
-      
+
+
         private void OnAddStep()
         {
             if (CurrentRecipe != null)
@@ -274,7 +278,7 @@ namespace Venus_MainPages.ViewModels
                     if (newName != "")
                     {
                         var targetChamber = (JetChamber)Enum.Parse(typeof(JetChamber), QueryDataClient.Instance.Service.GetConfig($"{x}.ChamberType").ToString());
-                        if (currentChamber != targetChamber)
+                        if (currentChamber != targetChamber || x== ModuleName)
                         {
                             continue;
                         }
@@ -541,6 +545,10 @@ namespace Venus_MainPages.ViewModels
         {
             return m_uiRecipeManager.SaveAsRecipe(ModuleName, recipeName, recipeContent);
         }
+        public bool SaveAsRecipe2(string recipeName,string type, string recipeContent)
+        {
+            return m_uiRecipeManager.SaveAsRecipe2(ModuleName,type, recipeName, recipeContent);
+        }
         public string GetXmlRecipeList()
         {
             return m_uiRecipeManager.GetXmlRecipeList(ModuleName, true) ?? "";
@@ -1380,9 +1388,6 @@ namespace Venus_MainPages.ViewModels
                     k++;
                 }
             }
-
-
-
         }
         private void EPDButton_Click(object sender, RoutedEventArgs e)
         {
@@ -1534,6 +1539,13 @@ namespace Venus_MainPages.ViewModels
                 LoadRecipe(CurrentRecipe);
             }         
         }
+        private void OnTolerance()
+        { 
+            List<Kepler2300Tolerance> kepler2300Tolerances = new List<Kepler2300Tolerance>();
+            kepler2300Tolerances.Add(new Kepler2300Tolerance());
+            kepler2300Tolerances.Add(new Kepler2300Tolerance());
+            var str= SerializeHelper.Instance.ObjectToJsonString<List<Kepler2300Tolerance>>(kepler2300Tolerances);
+        }
         #endregion
     }
 }

+ 6 - 4
Venus/Venus_MainPages/Views/RecipeView.xaml

@@ -8,7 +8,7 @@
              prism:ViewModelLocator.AutoWireViewModel="True"
              xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
              xmlns:customeControls="clr-namespace:Venus_Themes.CustomControls;assembly=Venus_Themes"
-             d:DesignHeight="450" d:DesignWidth="800" Name="recipeView">
+             d:DesignHeight="450" d:DesignWidth="1200" Name="recipeView">
     <UserControl.Resources>
         <Style TargetType="{x:Type CheckBox}">
             <Setter Property="Background" Value="White" />
@@ -100,9 +100,11 @@
                     <MenuItem Header="Save To All" Cursor="Hand"   Command="{Binding SaveToRecipeCommand}" CommandParameter="4"/>
                 </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_Delete}"  Content="Del Step"       DefaultFillBrush="White"     Command="{Binding DeleteStepCommand}"    Margin="30,4,22,0"        FontSize="16" Height="30"   Width="130"   VerticalContentAlignment="Center"  HorizontalAlignment="Right" VerticalAlignment="Top"/>
-                <customeControls:PathButton PathData="{StaticResource Icon_Refresh}"  Content="Refresh"        DefaultFillBrush="White"     Command="{Binding RefreshCommand}"      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"/>
+                <customeControls:PathButton PathData="{StaticResource Icon_Delete}"    Content="Del Step"       DefaultFillBrush="White"     Command="{Binding DeleteStepCommand}"    Margin="30,4,22,0"        FontSize="16" Height="30"   Width="130"   VerticalContentAlignment="Center"  HorizontalAlignment="Right" VerticalAlignment="Top"/>
+                <customeControls:PathButton PathData="{StaticResource Icon_Refresh}"   Content="Refresh"        DefaultFillBrush="White"     Command="{Binding RefreshCommand}"       Margin="30,4,22,0"        FontSize="16" Height="30"   Width="130"   VerticalContentAlignment="Center"  HorizontalAlignment="Right" VerticalAlignment="Top"/>
+                <customeControls:PathButton PathData="{StaticResource Icon_Tolerance}" Content="Tolerance"      DefaultFillBrush="White"     Command="{Binding ToleranceCommand}"       Margin="30,4,22,0"        FontSize="16" Height="30"   Width="130"   VerticalContentAlignment="Center"  HorizontalAlignment="Right" VerticalAlignment="Top"/>
+
                 <RadioButton Content="Unfrozen"   FontSize="15"   Width="120" Height="30" Margin="30,0,10,0"  Style="{StaticResource Button_RadioButton}" IsChecked="{Binding IsFrozen,Converter={StaticResource BoolToBool},Mode=TwoWay}"/>
                 <RadioButton Content="Frozen"     FontSize="15"   Width="120" Height="30" Margin="0,0,30,0" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding IsFrozen,Mode=TwoWay}"/>
             </StackPanel>

File diff suppressed because it is too large
+ 1 - 1
Venus/Venus_Themes/Themes/Generic.xaml