123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- 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<ProcessTypeFileItem> _processTypeFileList;
- public ObservableCollection<ProcessTypeFileItem> ProcessTypeFileList { get=> _processTypeFileList;
- set
- {
- _processTypeFileList = value;
- NotifyOfPropertyChange("ProcessTypeFileList");
- }
- }
- public ObservableCollection<string> ChamberType { get; set; }
- public ObservableCollection<FileNode> 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<string>() { "Default" };
- }
- else
- {
- ChamberType = new ObservableCollection<string>(((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<ProcessTypeFileItem> typeFileList = new ObservableCollection<ProcessTypeFileItem>();
- 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();
- }
- }
- }
|