优化Sequence编辑器。

Recipe选择栏位显示包含文件夹名称的完整路径,
优化Recipe选择按钮,修正三个点没有显示的问题。
优化PathFileParam对象,剔除FileName属性中的“Sic\Process"前缀,而不是在SequenceViewModel中。
修正Reload Sequence时,Recipe文件名中会显示“Sic\Process\”前缀的问题。
This commit is contained in:
auvkk 2023-12-06 18:42:42 +08:00
parent 4946707523
commit 664b4d9423
5 changed files with 47 additions and 18 deletions

View File

@ -838,6 +838,7 @@
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Resource Include="resources\barcode.png" />
<Resource Include="resources\blue.png" />

View File

@ -65,7 +65,12 @@ namespace MECF.Framework.UI.Client.CenterViews.Editors.Sequence
}
else if (col is PositionColumn)
{
posParam = new PositionParam() { Name = col.ControlName, Options = ((PositionColumn)col).Options, IsEnabled = !col.IsReadOnly };
posParam = new PositionParam()
{
Name = col.ControlName,
Options = ((PositionColumn)col).Options,
IsEnabled = !col.IsReadOnly
};
param = posParam;
posValue = value;
}
@ -81,13 +86,11 @@ namespace MECF.Framework.UI.Client.CenterViews.Editors.Sequence
value = value.Substring(path.Length + 1);
}
param = new PathFileParam()
param = new PathFileParam(col.ControlName, !col.IsReadOnly, ((RecipeSelectColumn)col).RecipeProcessType)
{
Name = col.ControlName,
Value = value,
IsEnabled = !col.IsReadOnly,
PrefixPath = ((RecipeSelectColumn)col).RecipeProcessType
};
}
else if (col is MultipleSelectColumn)
{

View File

@ -9,9 +9,12 @@
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:micro="clr-namespace:Caliburn.Micro"
xmlns:sequence="clr-namespace:MECF.Framework.UI.Client.CenterViews.Editors.Sequence"
d:DesignHeight="450"
d:DesignWidth="1900"
mc:Ignorable="d">
mc:Ignorable="d"
d:Background="LightSteelBlue"
d:DataContext="{d:DesignInstance Type=sequence:SequenceViewModel, IsDesignTimeCreatable=False}">
<UserControl.Resources>
@ -160,7 +163,6 @@
</Grid.ColumnDefinitions>
<controls:TextBoxEx
Width="Auto"
FontSize="14"
IsReadOnly="True"
Text="{Binding FileName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
TextSaved="True"
@ -168,12 +170,12 @@
Visibility="{Binding Visible}" />
<Button
Grid.Column="1"
Width="30"
Height="20"
Margin="5,0,0,0"
Width="25"
Height="23"
Margin="3,0,0,0"
Content="..."
FontSize="20"
Foreground="White"
FontSize="10"
Focusable="False"
Visibility="{Binding Visible}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">

View File

@ -767,7 +767,7 @@ namespace MECF.Framework.UI.Client.CenterViews.Editors.Sequence
}
}
var lstFiles = RecipeClient.Instance.Service.GetRecipesByPath($"Sic\\{param.PrefixPath}", false).ToList();
var lstFiles = RecipeClient.Instance.Service.GetRecipesByPath(param.PrefixWithSysName, false).ToList();
dialog.Files = new ObservableCollection<FileNode>(RecipeSequenceTreeBuilder.GetFiles("", lstFiles));
@ -777,16 +777,17 @@ namespace MECF.Framework.UI.Client.CenterViews.Editors.Sequence
{
param.Value = dialog.DialogResult;
var path = param.Value;
var index = path.LastIndexOf("\\");
/*var path = param.Value;
var index = path.LastIndexOf("\\", StringComparison.Ordinal);
if (index > -1)
{
param.FileName = path.Substring(index + 1);
// Remove the prefix "Sic\Process\" and show folder name in recipe selection text box.
param.FileName = seqFullPrefix.Replace($"{seqFullPrefix}\\", "");
}
else
{
param.FileName = path;
}
}*/
}
}

View File

@ -5,6 +5,25 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params
public class PathFileParam : ParamBaseWithGenericValue<string>
{
//TODO 系统所有的配方文件保存在“Sic\xxx\”路径下,"Sic"前缀可以通过系统配置设置,此处为了省事写死。
private const string SYS_NAME = "Sic";
#region Constructors
public PathFileParam()
{
}
public PathFileParam(string name, bool isEnabled, string prefixPath)
{
Name = name;
IsEnabled = isEnabled;
PrefixPath = prefixPath;
}
#endregion
public override string Value
{
get => _value;
@ -19,14 +38,17 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params
}
else
{
// Remove the prefix "Sic\xxx\", and leave the folder name of the recipe/seq file.
var index = _value.LastIndexOf("\\", StringComparison.Ordinal);
FileName = index > -1 ? _value.Substring(index + 1) : _value;
FileName = index > -1 ? _value.Replace($"{PrefixWithSysName}\\", "") : _value;
}
IsSaved = false;
}
}
public string PrefixWithSysName => $"{SYS_NAME}\\{PrefixPath}";
private string _fileName;
public string FileName
{