using MECF.Framework.Common.DataCenter; using MECF.Framework.UI.Client.CenterViews.Editors.Recipe; using MECF.Framework.UI.Client.CenterViews.Editors.Sequence; using MECF.Framework.UI.Client.ClientBase; using OpenSEMI.ClientBase; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using FurnaceUI.Models; namespace FurnaceUI.Views.Editors { public class SelectedSubRecipeViewModel : FurnaceUIViewModelBase { public bool IsSave { get; set; } = false; public FileNode SelectedNode { get; set; } private ObservableCollection _processTypeFileList; public ObservableCollection ProcessTypeFileList { get=> _processTypeFileList; set { _processTypeFileList = value; NotifyOfPropertyChange("ProcessTypeFileList"); } } public ObservableCollection ChamberType { get; set; } public ObservableCollection FileListByProcessType { get; set; } public int ChamberTypeIndexSelection { get; set; } private RecipeProvider _recipeProvider = new RecipeProvider(); protected override void OnInitialize() { base.OnInitialize(); var chamberType = QueryDataClient.Instance.Service.GetConfig("System.Recipe.SupportedChamberType"); if (chamberType == null) { ChamberType = new ObservableCollection() { "Default" }; } else { ChamberType = new ObservableCollection(((string)(chamberType)).Split(',')); } ChamberTypeIndexSelection = 0; //Etch:Process,Clean,Chuck,Dechuck;CVD:Process,Clean; var processType = QueryDataClient.Instance.Service.GetConfig("System.Recipe.Layout"); if (processType == null) { processType = "Recipe"; } ObservableCollection typeFileList = new ObservableCollection(); string[] recipeProcessType = ((string)processType).Split(','); for (int i = 0; i < recipeProcessType.Length; i++) { var prefix = $"{ChamberType[ChamberTypeIndexSelection]}\\{recipeProcessType[i]}"; var recipes = _recipeProvider.GetXmlRecipeList(prefix); FileListByProcessType = RecipeSequenceTreeBuilder.BuildFileNode(prefix, "", false, recipes)[0].Files; } } public void SelectedSubRecipeSave() { IsSave = true; (GetView() as Window).Close(); } public void SelectedSubRecipeCancel() { IsSave = false; (GetView() as Window).Close(); } public void TreeSelectChanged(FileNode node) { SelectedNode = node; //CurrentFileNode = node; //NotifyOfPropertyChange(nameof(IsCurrentNodeFile)); //NotifyOfPropertyChange(nameof(IsCurrentNodePath)); //if (node != null && node.IsFile) //{ // this.LoadData(node.PrefixPath, node.FullPath); //} //else //{ // this.ClearData(); // this.editMode = EditMode.None; //} //this.UpdateView(); } } }