Explorar el Código

layoutRecipe slotcheck

jiangjy hace 1 semana
padre
commit
715d439f3e
Se han modificado 1 ficheros con 45 adiciones y 4 borrados
  1. 45 4
      Furnace/FurnaceUI/Views/Recipes/RecipeLayoutViewModel.cs

+ 45 - 4
Furnace/FurnaceUI/Views/Recipes/RecipeLayoutViewModel.cs

@@ -11,6 +11,7 @@ using MECF.Framework.UI.Client.CenterViews.Editors.Sequence;
 using MECF.Framework.UI.Client.ClientBase;
 using OpenSEMI.ClientBase;
 using OpenSEMI.ClientBase.Command;
+using RecipeEditorLib.RecipeModel.Params;
 using SciChart.Core.Extensions;
 using System;
 using System.Collections.Generic;
@@ -403,7 +404,7 @@ namespace FurnaceUI.Views.Recipes
                 // var recipes = _recipeProvider.GetXmlRecipeList(prefix);
                 type.FileListByProcessType = RecipeSequenceTreeBuilder.GetFileNodeParameterList(prefix);// RecipeSequenceTreeBuilder.BuildFileNode(prefix, "", false, recipes)[0].Files;
                 ProcessTypeFileList.Add(type);
-                if (type.FileListByProcessType?.Count > 0&&!type.FileListByProcessType.Any(r=>r.IsSelected))//default 
+                if (type.FileListByProcessType?.Count > 0 && !type.FileListByProcessType.Any(r => r.IsSelected))//default 
                 {
                     type.FileListByProcessType.First().IsSelected = true;
                 }
@@ -928,7 +929,7 @@ namespace FurnaceUI.Views.Recipes
             string recipeName = dialog.FileName.Trim();
             string filepath = dialog.FilePath;
             string description = dialog.Comment;
-         
+
 
             string prefix;
             if (filepath.Contains("\\"))
@@ -1653,11 +1654,51 @@ namespace FurnaceUI.Views.Recipes
             }
             else
             {
-                RecipeLayoutEditViewModel sdSettingViewModel = new RecipeLayoutEditViewModel(CurrentRecipe.PrefixPath, CurrentFileNode.FullPath, _columnBuilder, CurrentFileNode.Permission);
-                return (windowManager as WindowManager)?.ShowDialogWithTitle(sdSettingViewModel, null, "Layout Setting") == true;
+                try
+                {
+                    var permission = "PM1";
+                    var waferNumberAll = (int)QueryDataClient.Instance.Service.GetConfig("Boat.SlotCount");
+                    var layoutRecipe = new RecipeDataLayout();
+
+                    layoutRecipe.PrefixPath = CurrentRecipe.PrefixPath;
+                    layoutRecipe.Name = CurrentFileNode.FullPath;
+
+                    layoutRecipe.RecipePermission = permission;
+                    var recipeContent = _recipeProvider.LoadRecipe(layoutRecipe.PrefixPath, layoutRecipe.Name);
+
+                    if (string.IsNullOrEmpty(recipeContent))
+                    {
+                        System.Windows.MessageBox.Show($"{layoutRecipe.PrefixPath}\\{layoutRecipe.Name} is empty, please confirm the file is valid.");
+                        return false;
+                    }
+                    layoutRecipe.RecipeChamberType = "OriginChamber";
+                    layoutRecipe.InitData(layoutRecipe.PrefixPath, layoutRecipe.Name, recipeContent, _columnBuilder.Configs, permission);
+
+                    if (layoutRecipe.ExpertSteps != null && layoutRecipe.ExpertSteps.Count > 0 && layoutRecipe.ExpertSteps[0].Items != null && layoutRecipe.ExpertSteps[0].Items.Count != waferNumberAll)
+                    {
+                        DialogBox.ShowWarning($"layoutRecipe slot:{layoutRecipe.ExpertSteps[0].Items.Count} not match boatSlotConfig:{waferNumberAll}");
+                        return false;
+                    }
+                    else
+                    {
+                        RecipeLayoutEditViewModel sdSettingViewModel = new RecipeLayoutEditViewModel(CurrentRecipe.PrefixPath, CurrentFileNode.FullPath, _columnBuilder, CurrentFileNode.Permission);
+                        return (windowManager as WindowManager)?.ShowDialogWithTitle(sdSettingViewModel, null, "Layout Setting") == true;
+
+                    }
+
+
+                }
+                catch (Exception ex)
+                {
+
+                    RecipeLayoutEditViewModel sdSettingViewModel = new RecipeLayoutEditViewModel(CurrentRecipe.PrefixPath, CurrentFileNode.FullPath, _columnBuilder, CurrentFileNode.Permission);
+                    return (windowManager as WindowManager)?.ShowDialogWithTitle(sdSettingViewModel, null, "Layout Setting") == true;
+                }
+
             }
         }
 
+
     }