|
@@ -381,7 +381,7 @@ namespace FurnaceUI.Views.Recipes
|
|
|
|
|
|
|
|
|
|
|
|
- private void InitializeDefault()
|
|
|
+ private void InitializeDefault(bool isLoadOtherData = true)
|
|
|
{
|
|
|
var chamberType = QueryDataClient.Instance.Service.GetConfig("System.Recipe.SupportedChamberType");
|
|
|
ChamberType.Clear();
|
|
@@ -420,18 +420,22 @@ namespace FurnaceUI.Views.Recipes
|
|
|
}
|
|
|
//if (ProcessTypeFileList[0].FileListByProcessType.Count > 0)
|
|
|
// CurrentFileNode = ProcessTypeFileList[0].FileListByProcessType[ProcessTypeFileList[0].FileListByProcessType.Count - 1];
|
|
|
- SelectRecipeTypeName = processType + " Recipe";
|
|
|
- UpdateRecipeFormat();
|
|
|
- if (CurrentFileNode != null && CurrentFileNode.IsFile)
|
|
|
+ if (isLoadOtherData)
|
|
|
{
|
|
|
- if (CurrentRecipe != null)
|
|
|
+ SelectRecipeTypeName = processType + " Recipe";
|
|
|
+ UpdateRecipeFormat();
|
|
|
+ if (CurrentFileNode != null && CurrentFileNode.IsFile)
|
|
|
{
|
|
|
- CurrentRecipe.PrefixPath = CurrentFileNode.PrefixPath;
|
|
|
- CurrentRecipe.Name = CurrentFileNode.FullPath;
|
|
|
+ if (CurrentRecipe != null)
|
|
|
+ {
|
|
|
+ CurrentRecipe.PrefixPath = CurrentFileNode.PrefixPath;
|
|
|
+ CurrentRecipe.Name = CurrentFileNode.FullPath;
|
|
|
+ }
|
|
|
+ //this.LoadData(CurrentFileNode.PrefixPath, CurrentFileNode.FullPath);
|
|
|
}
|
|
|
- //this.LoadData(CurrentFileNode.PrefixPath, CurrentFileNode.FullPath);
|
|
|
+ GetRecipeType();
|
|
|
}
|
|
|
- GetRecipeType();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void GetRecipeType()
|
|
@@ -550,6 +554,14 @@ namespace FurnaceUI.Views.Recipes
|
|
|
// this.Save(this.CurrentRecipe, false);
|
|
|
}
|
|
|
}
|
|
|
+ if (node != null && node.IsFile)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ InitializeDefault(false);
|
|
|
+ }
|
|
|
if (node != null && !node.IsFile)
|
|
|
{
|
|
|
ProcessTypeFileList[0].FileListByProcessType.ForEachDo(a =>
|
|
@@ -938,7 +950,7 @@ namespace FurnaceUI.Views.Recipes
|
|
|
string recipeName = dialog.FileName.Trim();
|
|
|
string filepath = dialog.FilePath;
|
|
|
string description = dialog.Comment;
|
|
|
-
|
|
|
+
|
|
|
|
|
|
string prefix;
|
|
|
if (filepath.Contains("\\"))
|
|
@@ -954,7 +966,7 @@ namespace FurnaceUI.Views.Recipes
|
|
|
prefix = GetPrefix(CurrentFileNode.PrefixPath, CurrentFileNode);
|
|
|
}
|
|
|
}
|
|
|
- if (RecipeFileList!=null&&RecipeFileList.Find(a => a.Name == recipeName.ToLower()) != null)
|
|
|
+ if (RecipeFileList != null && RecipeFileList.Find(a => a.Name == recipeName.ToLower()) != null)
|
|
|
{
|
|
|
DialogBox.ShowWarning($"Can not create {recipeName}, Recipe with the same name already exist.");
|
|
|
return;
|