Explorar o código

1 add dummy rinse time check with linked dep recipe

chenzk hai 3 semanas
pai
achega
751e38538e

+ 2 - 14
Framework/Common/RecipeCenter/DqdrRecipe.cs

@@ -26,17 +26,16 @@ namespace MECF.Framework.Common.RecipeCenter
 
         private int _reclaimSpeed;
         private int _reclaimTime;
-        private double _reclaimZoffset;
         private int _rinseSpeed;
         private int _rinseTime;
-        private double _rinseZoffset;
+
         private int _drySpeed;
         private int _dryTime;
         private double _dryZoffset;
         private bool _rinseBeforeEntryEnable;
         private int _intervalRinseSpeed;
         private int _intervalRinseTime;
-        private double _intervalRinseZoffset;
+
         #endregion
 
         #region 属性
@@ -75,19 +74,11 @@ namespace MECF.Framework.Common.RecipeCenter
 
         [JsonProperty]
         public int ReclaimTime { get { return _reclaimTime; } set { _reclaimTime = value; InvokePropertyChanged(nameof(ReclaimTime)); } }
-
-        [JsonProperty]
-        public double ReclaimZoffset { get { return _reclaimZoffset; } set { _reclaimZoffset = value; InvokePropertyChanged(nameof(ReclaimZoffset)); } }
-
         [JsonProperty]
         public int RinseSpeed { get { return _rinseSpeed; } set { _rinseSpeed = value; InvokePropertyChanged(nameof(RinseSpeed)); } }
 
         [JsonProperty]
         public int RinseTime { get { return _rinseTime; } set { _rinseTime = value; InvokePropertyChanged(nameof(RinseTime)); } }
-
-        [JsonProperty]
-        public double RinseZoffset { get { return _rinseZoffset; } set { _rinseZoffset = value; InvokePropertyChanged(nameof(RinseZoffset)); } }
-
         [JsonProperty]
         public int DrySpeed { get { return _drySpeed; } set { _drySpeed = value; InvokePropertyChanged(nameof(DrySpeed)); } }
 
@@ -105,9 +96,6 @@ namespace MECF.Framework.Common.RecipeCenter
 
         [JsonProperty]
         public int IntervalRinseTime { get { return _intervalRinseTime; } set { _intervalRinseTime = value; InvokePropertyChanged(nameof(IntervalRinseTime)); } }
-
-        [JsonProperty]
-        public double IntervalRinseZoffset { get { return _intervalRinseZoffset; } set { _intervalRinseZoffset = value; InvokePropertyChanged(nameof(IntervalRinseZoffset)); } }
         #endregion
     }
 }

+ 75 - 8
PunkHPX8_MainPages/ViewModels/DqdrRecipeViewModel.cs

@@ -1,6 +1,7 @@
 using Aitex.Core.UI.MVVM;
 using Aitex.Core.Utilities;
 using MECF.Framework.Common.DataCenter;
+using MECF.Framework.Common.Equipment;
 using MECF.Framework.Common.RecipeCenter;
 using MECF.Framework.Common.Utilities;
 using Prism.Mvvm;
@@ -23,6 +24,7 @@ namespace PunkHPX8_MainPages.ViewModels
         private const string ENGINEERING = "Engineering";
 
         private const string DQDR = "dqdr";
+        private const string DEP = "dep";
         #endregion
 
         #region 内部变量
@@ -39,13 +41,17 @@ namespace PunkHPX8_MainPages.ViewModels
         /// </summary>
         private ObservableCollection<RecipeNode> _recipeNodes;
         /// <summary>
+        /// DepRecipe节点集合
+        /// </summary>
+        private ObservableCollection<RecipeNode> _depRecipeNodes;
+        /// <summary>
         /// Plating Cell List
         /// </summary>
-        private ObservableCollection<string> _platingCellList;
+        private ObservableCollection<string> _platingCellList = new ObservableCollection<string>();
         /// <summary>
         /// DepRecipe Name List
         /// </summary>
-        private ObservableCollection<string> _depRecipeNameList;
+        private ObservableCollection<string> _depRecipeNameList = new ObservableCollection<string>();
         /// <summary>
         /// uiRecipeManager
         /// </summary>
@@ -82,6 +88,11 @@ namespace PunkHPX8_MainPages.ViewModels
             get { return _recipeNodes; }
             set { SetProperty(ref _recipeNodes, value); }
         }
+        public ObservableCollection<RecipeNode> DepRecipeNodes
+        {
+            get { return _depRecipeNodes; }
+            set { SetProperty(ref _depRecipeNodes, value); }
+        }
         public ObservableCollection<string> PlatingCellList
         {
             get { return _platingCellList; }
@@ -160,6 +171,7 @@ namespace PunkHPX8_MainPages.ViewModels
         public ICommand SaveRecipeCommand { get; private set; }
         [IgnorePropertyChange]
         public ICommand SaveAsRecipeCommand { get; private set; }
+        public ICommand LinkedDepRecipeChangeCommand { get; private set; }
 
         #endregion
         /// <summary>
@@ -172,9 +184,12 @@ namespace PunkHPX8_MainPages.ViewModels
             EditCommand = new DelegateCommand<object>(EditAction);
             SaveRecipeCommand = new DelegateCommand<object>(SaveAction);
             SaveAsRecipeCommand = new DelegateCommand<object>(SaveAsAction);
+            LinkedDepRecipeChangeCommand = new DelegateCommand<object>(LinkedDepRecipeChangeAction);
           
             InitializeProprtyValidResultDictionary();
 
+            InitializePlatingCellNameList();
+
         }
         /// <summary>
         /// 初始化属性数据检验结果字典
@@ -183,16 +198,16 @@ namespace PunkHPX8_MainPages.ViewModels
         {
             PropertyValidResultDic["ReclaimSpeed"] = false;
             PropertyValidResultDic["ReclaimTime"] = false;
-            PropertyValidResultDic["ReclaimZoffset"] = false;
+
             PropertyValidResultDic["RinseSpeed"] = false;
             PropertyValidResultDic["RinseTime"] = false;
-            PropertyValidResultDic["RinseZoffset"] = false;
+
             PropertyValidResultDic["DrySpeed"] = false;
             PropertyValidResultDic["DryTime"] = false;
-            PropertyValidResultDic["DryZoffset"] = false;
+
             PropertyValidResultDic["IntervalRinseSpeed"] = false;
             PropertyValidResultDic["IntervalRinseTime"] = false;
-            PropertyValidResultDic["IntervalRinseZoffset"] = false;
+
 
         }
         /// <summary>
@@ -201,8 +216,11 @@ namespace PunkHPX8_MainPages.ViewModels
         public void LoadRecipeData()
         {
             RecipeNodes = _uiRecipeManager.GetRecipesByType(DQDR);
+            DepRecipeNodes = _uiRecipeManager.GetRecipesByType(DEP);
             _recipeNodeDic.Clear();
             InitializeDictionary(RecipeNodes);
+            InitializeDepRecipeList();
+
         }
         /// <summary>
         /// 初始化字典
@@ -222,7 +240,32 @@ namespace PunkHPX8_MainPages.ViewModels
                 }
             }
         }
-
+        /// <summary>
+        /// 初始化DEP recipe名字列表
+        /// </summary>
+        private void InitializeDepRecipeList()
+        {
+            DepRecipeNameList.Clear();
+            if (DepRecipeNodes != null && DepRecipeNodes.Count > 0)
+            {
+                foreach (var item in DepRecipeNodes[0].Children)
+                {
+                    DepRecipeNameList.Add(item.FileName);
+                }
+            }
+            
+        }
+        /// <summary>
+        /// 初始化platingcell list
+        /// </summary>
+        private void InitializePlatingCellNameList()
+        {
+            PlatingCellList.Clear();
+            PlatingCellList.Add(ModuleName.PlatingCell1.ToString());
+            PlatingCellList.Add(ModuleName.PlatingCell2.ToString());
+            PlatingCellList.Add(ModuleName.PlatingCell2.ToString());
+            PlatingCellList.Add(ModuleName.PlatingCell4.ToString());
+        }
         /// <summary>
         /// 操作
         /// </summary>
@@ -270,7 +313,6 @@ namespace PunkHPX8_MainPages.ViewModels
                 Enable = false;
             }
         }
-
         #region Action
         /// <summary>
         /// 创建
@@ -299,6 +341,31 @@ namespace PunkHPX8_MainPages.ViewModels
             _isEdit = false;
         }
         /// <summary>
+        /// 确认当前dummy rinse recipe与关联的dep recipe的时间是否相等
+        /// </summary>
+        /// <param name="dqdr"></param>
+        /// <param name="depRecipe"></param>
+        /// <returns></returns>
+        private void LinkedDepRecipeChangeAction(object param)
+        {
+            Recipe.IsIdentical = false;
+            string linkedDepRecipeName = Recipe.LinkedDepRecipeName;
+            string fullName = DepRecipeNodes[0].Children.FirstOrDefault(node => node.FileName == linkedDepRecipeName)?.RecipeFullFileName;
+            DepRecipe deprecipe = _uiRecipeManager.LoadRecipe<DepRecipe>(fullName);
+            if (deprecipe != null)
+            {
+                if (deprecipe.ReclaimTime == Recipe.ReclaimTime
+                    && deprecipe.RinseTime == Recipe.RinseTime
+                    && deprecipe.DryTime == Recipe.DryTime
+                    && deprecipe.RinseBeforeEntryEnable == Recipe.RinseBeforeEntryEnable
+                    && deprecipe.IntervalRinseTime == Recipe.IntervalRinseTime)
+                {
+                    Recipe.IsIdentical = true;
+                }
+            }
+
+        }
+        /// <summary>
         /// 保存
         /// </summary>
         /// <param name="param"></param>

+ 7 - 2
PunkHPX8_MainPages/Views/DqdrRecipeView.xaml

@@ -84,11 +84,16 @@
         </Grid>
         <GroupBox Header="Link To Plating Cell Dep Recipe" IsEnabled="{Binding Enable}"   Grid.Row="2" Grid.Column="2" Width="600" Margin="0,0,120,0" >
             <ComboBox Height="30" Margin="10,0,10,0" ItemsSource="{Binding DepRecipeNameList}" SelectedItem="{Binding Recipe.LinkedDepRecipeName, Mode=TwoWay}">
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="SelectionChanged">
+                        <i:InvokeCommandAction Command="{Binding LinkedDepRecipeChangeCommand}"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
             </ComboBox>
         </GroupBox>
         <GroupBox Header="Time Check" Grid.Row="2" Grid.Column="3" Width="200" Margin="0,10,450,10">
-            <Label Height="30" Width="180" VerticalAlignment="Center" HorizontalAlignment="Left" Background="Gray" 
-                                      HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Grid.Column="1" Margin="6,0,0,0">
+            <Label Height="30" Width="180" VerticalAlignment="Center" HorizontalAlignment="Left" Background="White" 
+                                      HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Grid.Column="1" Margin="6,0,0,0" FontSize="16">
                 <Label.Style>
                     <Style TargetType="Label">
                         <Setter Property="Content" Value="Different" />