Merge branch 'develop' into 整理机台兼容内容

This commit is contained in:
hanqiangqiang 2023-12-08 10:43:58 +08:00
commit 936f9fffa3
7 changed files with 52 additions and 23 deletions

View File

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

View File

@ -1458,7 +1458,7 @@ namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
return false; return false;
} }
if (CurrentRecipe.Validate() == false) if (recipe.Validate() == false)
{ {
var mbr = DialogBox.ShowDialog( var mbr = DialogBox.ShowDialog(
DialogButton.Yes | DialogButton.No, DialogButton.Yes | DialogButton.No,
@ -1472,7 +1472,7 @@ namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
recipe.Revisor = BaseApp.Instance.UserContext.LoginName; recipe.Revisor = BaseApp.Instance.UserContext.LoginName;
recipe.ReviseTime = DateTime.Now; recipe.ReviseTime = DateTime.Now;
if (!CurrentRecipe.GetXmlString(out var recipeXmlString, out var reason)) if (!recipe.GetXmlString(out var recipeXmlString, out var reason))
{ {
DialogBox.ShowError($"Unable to generate recipe content, {reason}"); DialogBox.ShowError($"Unable to generate recipe content, {reason}");
return false; return false;

View File

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

View File

@ -9,9 +9,12 @@
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:micro="clr-namespace:Caliburn.Micro" xmlns:micro="clr-namespace:Caliburn.Micro"
xmlns:sequence="clr-namespace:MECF.Framework.UI.Client.CenterViews.Editors.Sequence"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="1900" d:DesignWidth="1900"
mc:Ignorable="d"> mc:Ignorable="d"
d:Background="LightSteelBlue"
d:DataContext="{d:DesignInstance Type=sequence:SequenceViewModel, IsDesignTimeCreatable=False}">
<UserControl.Resources> <UserControl.Resources>
@ -160,7 +163,6 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<controls:TextBoxEx <controls:TextBoxEx
Width="Auto" Width="Auto"
FontSize="14"
IsReadOnly="True" IsReadOnly="True"
Text="{Binding FileName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Text="{Binding FileName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
TextSaved="True" TextSaved="True"
@ -168,12 +170,12 @@
Visibility="{Binding Visible}" /> Visibility="{Binding Visible}" />
<Button <Button
Grid.Column="1" Grid.Column="1"
Width="30" Width="25"
Height="20" Height="23"
Margin="5,0,0,0" Margin="3,0,0,0"
Content="..." Content="..."
FontSize="20" FontSize="10"
Foreground="White" Focusable="False"
Visibility="{Binding Visible}"> Visibility="{Binding Visible}">
<i:Interaction.Triggers> <i:Interaction.Triggers>
<i:EventTrigger EventName="Click"> <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)); dialog.Files = new ObservableCollection<FileNode>(RecipeSequenceTreeBuilder.GetFiles("", lstFiles));
@ -777,16 +777,17 @@ namespace MECF.Framework.UI.Client.CenterViews.Editors.Sequence
{ {
param.Value = dialog.DialogResult; param.Value = dialog.DialogResult;
var path = param.Value; /*var path = param.Value;
var index = path.LastIndexOf("\\"); var index = path.LastIndexOf("\\", StringComparison.Ordinal);
if (index > -1) 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 else
{ {
param.FileName = path; param.FileName = path;
} }*/
} }
} }

View File

@ -5,6 +5,25 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params
public class PathFileParam : ParamBaseWithGenericValue<string> 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 public override string Value
{ {
get => _value; get => _value;
@ -19,14 +38,17 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params
} }
else else
{ {
// Remove the prefix "Sic\xxx\", and leave the folder name of the recipe/seq file.
var index = _value.LastIndexOf("\\", StringComparison.Ordinal); var index = _value.LastIndexOf("\\", StringComparison.Ordinal);
FileName = index > -1 ? _value.Substring(index + 1) : _value; FileName = index > -1 ? _value.Replace($"{PrefixWithSysName}\\", "") : _value;
} }
IsSaved = false; IsSaved = false;
} }
} }
public string PrefixWithSysName => $"{SYS_NAME}\\{PrefixPath}";
private string _fileName; private string _fileName;
public string FileName public string FileName
{ {

View File

@ -389,9 +389,9 @@
<Setter Property="Foreground" Value="{DynamicResource FG_White}" /> <Setter Property="Foreground" Value="{DynamicResource FG_White}" />
<Setter Property="HorizontalContentAlignment" Value="Center" /> <Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="6,3" /> <Setter Property="Padding" Value="1,1" />
<Setter Property="MinWidth" Value="40" /> <Setter Property="MinWidth" Value="20" />
<Setter Property="MinHeight" Value="20" /> <Setter Property="MinHeight" Value="10" />
<Setter Property="SnapsToDevicePixels" Value="True" /> <Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Border.CornerRadius" Value="4" /> <Setter Property="Border.CornerRadius" Value="4" />
<Setter Property="Template"> <Setter Property="Template">