12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;
- using MECF.Framework.UI.Client.CenterViews.Editors.Sequence;
- using System.Collections.ObjectModel;
- using FurnaceUI.Client;
- using FurnaceUI.Models;
- namespace FurnaceUI.Views.Recipes
- {
- public class ProcessRecipeViewModel : FurnaceUIViewModelBase
- {
- public ObservableCollection<ProcessTypeFileItem> ProcessTypeFileList { get; set; } = new ObservableCollection<ProcessTypeFileItem>();
- public string FilePath { get; set; } = "";
- private RecipeProvider _recipeProvider = new RecipeProvider();
- public ProcessRecipeViewModel()
- {
- var type = new ProcessTypeFileItem();
- type.ProcessType = "Process";
- var prefix = $"Furnace\\Process";
- var recipes = _recipeProvider.GetXmlRecipeList(prefix);
- type.FileListByProcessType = RecipeSequenceTreeBuilder.BuildFileNode(prefix, "", false, recipes)[0].Files;
- ProcessTypeFileList.Add(type);
- }
- public void TreeSelectChanged(FileNode node)
- {
- if (node != null && node.IsFile)
- {
- FilePath = $" {node.PrefixPath}\\{node.FullPath}";
- }
- }
- public void SwitchPage(string page)
- {
- switch (page)
- {
- case "RecipeEdit":
- ClientApp.Instance.SwitchPage("Recipe", "recipeEdit", null);
- break;
- //case "SelfCheck":
- // ClientApp.Instance.SwitchPage("status", "selfCheck", null);
- // break;
- //case "Gas":
- // ClientApp.Instance.SwitchPage("status", "gas", null);
- //break;
- }
- }
- }
- }
|