瀏覽代碼

1.优化跑片动画
2.添加recipe 保存功能

lixiang 1 年之前
父節點
當前提交
62feaac5e7

+ 18 - 18
Venus/Venus_Core/ProcessUnitDefine.cs

@@ -173,24 +173,24 @@ namespace Venus_Core
         public int Gas7Target { get; set; } 
         public int Gas8Target { get; set; }
         public int FlowRatie { get; set; }
-        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 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; }
 
     }
 

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

@@ -59,8 +59,8 @@ 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="Return Wafer", Invoke="ReturnWafer"},
-            //new MenuElement(){ Name="-", IsSeparator = true},
             //new MenuElement(){ Name="Return Wafer", Invoke="ReturnWafer"}
         };
 

+ 11 - 1
Venus/Venus_MainPages/ViewModels/OperationOverViewModel.cs

@@ -1118,23 +1118,33 @@ namespace Venus_MainPages.ViewModels
 
         private async Task ChangePosition(WaferRobotTAction waferRobotTAction)
         {
+            int delay = 500;
             if (waferRobotTAction == WaferRobotTAction.LP1)
             {
                 CurrentRobotPosition = RobotPosition.Left;
+                await Task.Delay(delay);
             }
             else if (waferRobotTAction == WaferRobotTAction.LP3)
             {
                 CurrentRobotPosition = RobotPosition.Right;
+                await Task.Delay(delay);
             }
             else if (waferRobotTAction == WaferRobotTAction.LP2)
             {
                 CurrentRobotPosition = RobotPosition.Middle;
+                await Task.Delay(delay);
             }
             else
             {
                 CurrentRobotPosition = RobotPosition.Origin;
+                await Task.Delay(delay);
             }
-            await Task.Delay(600);
+            //await Task.Delay(100);
+            //else if (waferRobotTAction == WaferRobotTAction.LLA && CurrentRobotPosition != RobotPosition.Origin)
+            //{
+            //    CurrentRobotPosition = RobotPosition.Origin;
+            //    await Task.Delay(600);
+            //}
         }
         #endregion
     }

+ 134 - 1
Venus/Venus_MainPages/ViewModels/RecipeViewModel.cs

@@ -66,6 +66,12 @@ namespace Venus_MainPages.ViewModels
         private JetChamber currentChamber;
         private bool isInstalledEPD;
         private bool m_IsFrozen;
+        private bool m_PMAIsInstalled;
+        private bool m_PMBIsInstalled;
+        private bool m_PMCIsInstalled;
+        private bool m_PMDIsInstalled;
+
+        private List<string> moduleList = new List<string> ();
         #endregion
 
         #region  属性
@@ -93,6 +99,26 @@ namespace Venus_MainPages.ViewModels
             get { return m_IsFrozen; }
             set { SetProperty(ref m_IsFrozen, value); }
         }
+        public bool PMAIsInstalled
+        {
+            get { return m_PMAIsInstalled; }
+            set { SetProperty(ref m_PMAIsInstalled, value); }
+        }
+        public bool PMBIsInstalled
+        {
+            get { return m_PMBIsInstalled; }
+            set { SetProperty(ref m_PMBIsInstalled, value); }
+        }
+        public bool PMCIsInstalled
+        {
+            get { return m_PMCIsInstalled; }
+            set { SetProperty(ref m_PMCIsInstalled, value); }
+        }
+        public bool PMDIsInstalled
+        {
+            get { return m_PMDIsInstalled; }
+            set { SetProperty(ref m_PMDIsInstalled, value); }
+        }
         #endregion
 
         #region 命令
@@ -109,6 +135,10 @@ namespace Venus_MainPages.ViewModels
         public DelegateCommand SaveRecipeCommand =>
             _SaveRecipeCommand ?? (_SaveRecipeCommand = new DelegateCommand(OnSaveRecipe));
 
+        private DelegateCommand<object> _SaveToRecipeCommand;
+        public DelegateCommand<object> SaveToRecipeCommand =>
+            _SaveToRecipeCommand ?? (_SaveToRecipeCommand = new DelegateCommand<object>(OnSaveToRecipe));
+
         private DelegateCommand _AddStepCommand;
         public DelegateCommand AddStepCommand =>
             _AddStepCommand ?? (_AddStepCommand = new DelegateCommand(OnAddStep));
@@ -203,6 +233,87 @@ namespace Venus_MainPages.ViewModels
             SaveRecipe(CurrentRecipeName, RecipeUnity.RecipeToString(CurrentRecipe));
             LoadHeadWrapPanel(headWrapPanel, CurrentRecipe);
         }
+        private void OnSaveToRecipe(object obj)
+        {
+            if (CurrentRecipe == null)
+            {
+                return;
+            }
+
+            //JetChamber jetChamber = JetChamber.None;
+            string moduleName = "";
+            switch (obj.ToString())
+            {
+                case "0":
+                    moduleName = "PMA";
+                    break;
+                case "1":
+                    moduleName = "PMB";
+                    break; 
+                case "2":
+                    moduleName = "PMC";
+                    break; 
+                case "3":
+                    moduleName = "PMD";
+                    break; 
+                case "4":
+                    moduleName = "ALL";
+                    break;
+              
+            }
+            if (moduleName == "")
+            {
+                return;
+            }
+            if (moduleName == "ALL")
+            {
+                var newName = Interaction.InputBox(" ", $"Save  Recipe To All", CurrentRecipeName, -1, -1);
+
+                foreach (var x in moduleList)
+                {
+                    if (newName != "")
+                    {
+                        var targetChamber = (JetChamber)Enum.Parse(typeof(JetChamber), QueryDataClient.Instance.Service.GetConfig($"{x}.ChamberType").ToString());
+                        if (currentChamber != targetChamber)
+                        {
+                            continue;
+                        }
+                        var newRecipe = CurrentRecipe;
+                        newRecipe.Header.Name = newName;
+                        newRecipe.Header.CreateTime = DateTime.Now.ToString();
+                        var newrecipePath = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", x, newName + ".rcp");
+                        File.WriteAllText(newrecipePath, RecipeUnity.RecipeToString(newRecipe));
+                        UpdateRecipeFileList();
+                    }
+                }
+                //moduleList.ForEach(x => 
+                //{
+                    
+                //});
+            }
+            else
+            {
+                var targetChamber = (JetChamber)Enum.Parse(typeof(JetChamber), QueryDataClient.Instance.Service.GetConfig($"{moduleName}.ChamberType").ToString());
+                if (currentChamber != targetChamber)
+                {
+                    WPFMessageBox.ShowError($"Recipe can not from {currentChamber.ToString()} copy to {targetChamber.ToString()}");
+                    return;
+                }
+
+                var newName = Interaction.InputBox(" ", $"Save  Recipe To {moduleName}", CurrentRecipeName, -1, -1);
+                if (newName != "")
+                {
+
+                    var newRecipe = CurrentRecipe;
+                    newRecipe.Header.Name = newName;
+                    newRecipe.Header.CreateTime = DateTime.Now.ToString();
+                    var newrecipePath = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", moduleName, newName + ".rcp");
+                    File.WriteAllText(newrecipePath, RecipeUnity.RecipeToString(newRecipe));
+                    UpdateRecipeFileList();
+                }
+            }
+           
+        }
         private void OnLoaded(Object myrecipeView)
         {
             if (firstLoad == true)
@@ -237,9 +348,31 @@ namespace Venus_MainPages.ViewModels
                         break;
                     }
                 }
-                
+                string allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString();
+                if (allModules.Contains("PMA"))
+                {
+                    PMAIsInstalled = true;
+                    moduleList.Add("PMA");
+                }
+                if (allModules.Contains("PMB"))
+                {
+                    PMBIsInstalled = true;
+                    moduleList.Add("PMB");
+                }
+                if (allModules.Contains("PMC"))
+                {
+                    PMCIsInstalled = true;
+                    moduleList.Add("PMC");
+                }
+                if (allModules.Contains("PMD"))
+                {
+                    PMDIsInstalled = true;
+                    moduleList.Add("PMD");
+                }
 
             }
+            UpdateRecipeFileList();
+
         }
 
         private void TreeViewRcpList_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)

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

@@ -93,10 +93,11 @@
             <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: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"/>
+                    <MenuItem Header="Save To PMA" Cursor="Hand"   Command="{Binding SaveToRecipeCommand}" CommandParameter="0" Visibility="{Binding PMAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
+                    <MenuItem Header="Save To PMB" Cursor="Hand"   Command="{Binding SaveToRecipeCommand}" CommandParameter="1" Visibility="{Binding PMBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
+                    <MenuItem Header="Save To PMC" Cursor="Hand"   Command="{Binding SaveToRecipeCommand}" CommandParameter="2" Visibility="{Binding PMCIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
+                    <MenuItem Header="Save To PMD" Cursor="Hand"   Command="{Binding SaveToRecipeCommand}" CommandParameter="3" Visibility="{Binding PMDIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
+                    <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"/>