从UIClient项目中移除重复的RecipeEditorView及其ViewModel。

从SicUI RecipeEditorViewModel中移除ProcessTypeFileItem类定义。
在UIClient中增加ProcessTypeFileItem类定义。
修正Sequence编辑界面中新增Sequence后,新的Sequence没有出现在左侧文件列表中的问题。
This commit is contained in:
DESKTOP-GPE37UV\THINKAPD 2023-04-01 13:02:27 +08:00
parent 237dba47f7
commit 12abe2e84e
12 changed files with 175 additions and 3858 deletions

1
.gitignore vendored
View File

@ -51,3 +51,4 @@ FrameworkLocal/RTCore/obj/
FrameworkLocal/RTCore/bin/
FrameworkLocal/RTEquipmentLibrary/bin/
.vs/
.idea/

View File

@ -5,6 +5,7 @@ using System.Linq;
using Aitex.Core.RT.Log;
using MECF.Framework.Common.Account.Extends;
using MECF.Framework.Common.DataCenter;
using MECF.Framework.UI.Client.CenterViews.Editors;
using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;
using MECF.Framework.UI.Client.ClientBase;
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel;

View File

@ -0,0 +1,112 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using MECF.Framework.Common.CommonData;
using MECF.Framework.UI.Client.CenterViews.Editors.Sequence;
namespace MECF.Framework.UI.Client.CenterViews.Editors
{
public class ProcessTypeFileItem : NotifiableItem
{
/// <summary>
/// 工艺文件类型。
/// </summary>
[Flags]
public enum ProcessFileTypes
{
Process = 0x1 << 0,
Routine = 0x1 << 1,
Clean = 0x1 << 2
}
#region Variablers
private ObservableCollection<FileNode> _filterFileListByProcessType;
#endregion
#region Constructors
public ProcessTypeFileItem()
{
FileListByProcessType = new ObservableCollection<FileNode>();
FilterFileListByProcessType = new ObservableCollection<FileNode>();
}
public ProcessTypeFileItem(ProcessFileTypes processType) : this()
{
ProcessType = processType.ToString();
}
#endregion
#region Properties
public string ProcessType { get; set; }
public ObservableCollection<FileNode> FileListByProcessType { get; set; }
public ObservableCollection<FileNode> FilterFileListByProcessType
{
get => _filterFileListByProcessType;
set
{
_filterFileListByProcessType = value;
InvokePropertyChanged(nameof(FilterFileListByProcessType));
}
}
#endregion
#region Methods
/// <summary>
/// 根据指定的工艺文件类型获取工艺文件前缀。
/// </summary>
/// <param name="fileTypes"></param>
/// <returns></returns>
public static string GetProcessFilesPrefix(string fileTypes)
{
if (string.IsNullOrEmpty(fileTypes))
return string.Empty;
switch (fileTypes.ToLower())
{
case "process":
return GetProcessFilesPrefix(ProcessFileTypes.Process);
case "routine":
return GetProcessFilesPrefix(ProcessFileTypes.Routine);
case "clean":
return GetProcessFilesPrefix(ProcessFileTypes.Clean);
default:
return string.Empty;
}
}
/// <summary>
/// 根据指定的工艺文件类型获取工艺文件前缀。
/// </summary>
/// <param name="fileTypes"></param>
/// <returns></returns>
public static string GetProcessFilesPrefix(ProcessFileTypes fileTypes)
{
switch (fileTypes)
{
case ProcessFileTypes.Process:
return "Sic\\Process";
case ProcessFileTypes.Routine:
return "Sic\\Routine";
case ProcessFileTypes.Clean:
return "Sic\\Clean";
default:
return string.Empty;
}
}
#endregion
}
}

View File

@ -1,53 +0,0 @@
using OpenSEMI.Controls.Controls;
using System.Windows.Controls;
using MECF.Framework.UI.Client.RecipeEditorLib.DGExtension.CustomColumn;
namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
{
/// <summary>
/// Interaction logic for RecipePM1View.xaml
/// </summary>
public partial class RecipeEditorView : UserControl
{
public RecipeEditorView()
{
InitializeComponent();
}
EditorDataGridTemplateColumnBase _PreColumn = null;
private void dgCustom_CurrentCellChanged(object sender, System.EventArgs e)
{
var datagrid = sender as XDataGrid;
if (datagrid == null) return;
var column = datagrid.CurrentColumn as EditorDataGridTemplateColumnBase;
if (column == null) return;
if (_PreColumn == datagrid.CurrentColumn) return;
if (_PreColumn != null)
{
_PreColumn.IsColumnSelected = false;
foreach (var item in datagrid.Items)
{
var list = item as System.Collections.ObjectModel.ObservableCollection<RecipeEditorLib.RecipeModel.Params.Param>;
if (list == null) continue;
foreach (var p in list)
{
if (p.Name == _PreColumn.ControlName) p.IsColumnSelected = false;
}
}
}
column.IsColumnSelected = true;
_PreColumn = column;
//var jj = datagrid.Items as System.Collections.ObjectModel.ObservableCollection<RecipeEditorLib.RecipeModel.Params.Param>;
foreach (var item in datagrid.Items)
{
var list = item as System.Collections.ObjectModel.ObservableCollection<RecipeEditorLib.RecipeModel.Params.Param>;
if (list == null) continue;
foreach (var p in list)
{
if (p.Name == column.ControlName) p.IsColumnSelected = true;
}
}
}
}
}

View File

@ -1,33 +1,83 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows.Controls;
using System.Linq;
using System.Xml;
using Aitex.Core.UI.View.Common;
using Caliburn.Micro.Core;
namespace MECF.Framework.UI.Client.CenterViews.Editors.Sequence
{
public class FileNode : PropertyChangedBase
{
#region Variables
private string _name = string.Empty;
#endregion
#region Constructors
public FileNode()
{
this.Files = new ObservableCollection<FileNode>();
this.IsFile = false;
}
private string name = string.Empty;
#endregion
#region Properties
public string Name
{
get { return name; }
set { name = value; NotifyOfPropertyChange("Name"); }
get { return _name; }
set { _name = value; NotifyOfPropertyChange("Name"); }
}
public string FullPath { get; set; }
public FileNode Parent { get; set; }
public ObservableCollection<FileNode> Files { get; set; }
public bool IsFile { get; set; }
public string PrefixPath { get; set; }
public bool IsSelected { get; set; }
public bool IsExpanded { get; set; }
#endregion
#region Methods
/// <summary>
/// 将数中的节点转换为节点数组。
/// </summary>
/// <param name="terminalOnly">是否仅枚举最末端节点。</param>
/// <para>更新子节点的Selected属性时需要同时更新中间节点的属性更新父节点时只评估终端节点的Selected属性。</para>
/// <returns></returns>
private List<FileNode> Flatten(bool terminalOnly)
{
if (Files == null || Files.Count <= 0)
return new List<FileNode>(new[] { this });
var lst = Files.SelectMany(x => x.Flatten(terminalOnly)).ToList();
if (!terminalOnly)
lst.Add(this);
return lst;
}
/// <summary>
/// 选择指定的节点。
/// </summary>
/// <param name="fullPath"></param>
public void Select(string fullPath)
{
var flattenList = Flatten(true);
flattenList.ForEach(x => { x.IsSelected = x.FullPath == fullPath; });
Refresh();
}
#endregion
}
public class RecipeSequenceTreeBuilder

View File

@ -255,6 +255,7 @@
<DependentUpon>PurgeDialogView.xaml</DependentUpon>
</Compile>
<Compile Include="CenterViews\Dialogs\PurgeDialogViewModel.cs" />
<Compile Include="CenterViews\Editors\ProcessTypeFileItem.cs" />
<Compile Include="CenterViews\Editors\RecipeConfig\RecipeConfigView.xaml.cs">
<DependentUpon>RecipeConfigView.xaml</DependentUpon>
</Compile>
@ -758,10 +759,6 @@
<Compile Include="RecipeEditorLib\RecipeModel\Params\StringParam.cs" />
<Compile Include="RecipeEditorLib\RecipeModel\RecipeFormatBuilder.cs" />
<Compile Include="RecipeEditorLib\RecipeModel\RecipeData.cs" />
<Compile Include="CenterViews\Editors\Recipe\RecipeEditorView.xaml.cs">
<DependentUpon>RecipeEditorView.xaml</DependentUpon>
</Compile>
<Compile Include="CenterViews\Editors\Recipe\RecipeEditorViewModel.cs" />
<Compile Include="RecipeEditorLib\RecipeModel\RecipeProvider.cs" />
<Compile Include="RecipeEditorLib\RecipeModel\RecipeGlobalDefs.cs" />
<Compile Include="RecipeEditorLib\RecipeModel\RecipeStep.cs" />
@ -1034,10 +1031,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="CenterViews\Editors\Recipe\RecipeEditorView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Ctrlib\Controls\PanelLocker.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

View File

@ -20,6 +20,7 @@ using SicUI.Controls;
using SicUI.Client;
using System.Windows.Media;
using Aitex.Core.RT.IOCore;
using MECF.Framework.UI.Client.CenterViews.Editors;
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel;
namespace SicUI.Models.PMs

View File

@ -16,6 +16,7 @@ using Caliburn.Micro.Core;
using System.Windows.Media;
using SicUI.Client;
using System.Windows.Threading;
using MECF.Framework.UI.Client.CenterViews.Editors;
using MECF.Framework.UI.Client.RecipeEditorLib.DGExtension.CustomColumn;
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel;
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params;

View File

@ -1,7 +1,6 @@
using Aitex.Core.RT.Log;
using Caliburn.Micro;
using Caliburn.Micro.Core;
using MECF.Framework.Common.CommonData;
using MECF.Framework.Common.DataCenter;
using MECF.Framework.UI.Client.CenterViews.Editors;
using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;
@ -22,8 +21,6 @@ using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Threading;
using Aitex.Core.Util;
using MECF.Framework.Common.OperationCenter;
using MECF.Framework.UI.Client.CenterViews.Configs.Roles;
using MECF.Framework.UI.Client.RecipeEditorLib.DGExtension;
using MECF.Framework.UI.Client.RecipeEditorLib.DGExtension.CustomColumn;
@ -37,40 +34,6 @@ using Sicentury.Core.Collections;
namespace SicUI.Models.RecipeEditors
{
public class ProcessTypeFileItem : NotifiableItem
{
public string ProcessType { get; set; }
public ObservableCollection<FileNode> FileListByProcessType { get; set; }
private ObservableCollection<FileNode> filterFileListByProcessType;
public ObservableCollection<FileNode> FilterFileListByProcessType
{
get => filterFileListByProcessType;
set
{
filterFileListByProcessType = value;
InvokePropertyChanged(nameof(FilterFileListByProcessType));
}
}
public ProcessTypeFileItem()
{
FileListByProcessType = new ObservableCollection<FileNode>();
FilterFileListByProcessType = new ObservableCollection<FileNode>();
}
}
public class ChamberTypeItem : NotifiableItem
{
public string ChamberType { get; set; }
public ObservableCollection<ProcessTypeFileItem> FileListByChamberType { get; set; }
public ChamberTypeItem()
{
FileListByChamberType = new ObservableCollection<ProcessTypeFileItem>();
}
}
public class RecipeEditorViewModel : UiViewModelBase, IHandle<UserMode> //BaseModel
{

View File

@ -11,6 +11,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MECF.Framework.UI.Client.CenterViews.Editors;
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel;
namespace SicUI.Models.RecipeEditors
@ -65,12 +66,12 @@ namespace SicUI.Models.RecipeEditors
//这里只需要Routine,不需要Recipe
var processType = "Routine";
var ProcessTypeFileList = new ObservableCollection<MECF.Framework.UI.Client.CenterViews.Editors.Recipe.ProcessTypeFileItem>();
var ProcessTypeFileList = new ObservableCollection<ProcessTypeFileItem>();
string[] recipeProcessType = ((string)processType).Split(',');
for (int i = 0; i < recipeProcessType.Length; i++)
{
var type = new MECF.Framework.UI.Client.CenterViews.Editors.Recipe.ProcessTypeFileItem();
var type = new ProcessTypeFileItem();
type.ProcessType = recipeProcessType[i];
var prefix = $"Sic\\{recipeProcessType[i]}";
var recipes = recipeProvider.GetXmlRecipeList(prefix);