修复图像算子工具箱的图标与流程图界面保持一致
This commit is contained in:
@@ -44,6 +44,18 @@ namespace XplorePlane.Tests.Pipeline
|
|||||||
Assert.Equal(0, vm.PipelineNodes[0].Order);
|
Assert.Equal(0, vm.PipelineNodes[0].Order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void AddOperator_KnownKey_SetsIconPath()
|
||||||
|
{
|
||||||
|
_mockImageSvc.Setup(s => s.GetAvailableProcessors()).Returns(new[] { "ShockFilter" });
|
||||||
|
|
||||||
|
var vm = CreateVm();
|
||||||
|
vm.AddOperatorCommand.Execute("ShockFilter");
|
||||||
|
|
||||||
|
Assert.Single(vm.PipelineNodes);
|
||||||
|
Assert.Equal("⚡", vm.PipelineNodes[0].IconPath);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void AddOperator_InvalidKey_NodeNotAdded()
|
public void AddOperator_InvalidKey_NodeNotAdded()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,21 +37,7 @@ namespace XplorePlane.ViewModels
|
|||||||
private readonly IImageProcessingService _imageProcessingService;
|
private readonly IImageProcessingService _imageProcessingService;
|
||||||
private string _searchText = string.Empty;
|
private string _searchText = string.Empty;
|
||||||
|
|
||||||
// 算子 Key -> (分类名, 分类图标, 算子图标) 映射
|
// UI 元数据(分类 + 图标)由 OperatorUiMetadata 统一提供,保持工具箱与流水线图标一致
|
||||||
private static readonly Dictionary<string, (string Category, string CatIcon, string OpIcon)> CategoryMap = new()
|
|
||||||
{
|
|
||||||
["GaussianBlur"] = ("滤波与平滑", "🔵", "🌀"),
|
|
||||||
["GaussianBlur16"] = ("滤波与平滑", "🔵", "🌀"),
|
|
||||||
["BandPassFilter"] = ("滤波与平滑", "🔵", "📶"),
|
|
||||||
["ShockFilter"] = ("滤波与平滑", "🔵", "⚡"),
|
|
||||||
["Contrast"] = ("增强与校正", "🟡", "🔆"),
|
|
||||||
["Gamma"] = ("增强与校正", "🟡", "🌗"),
|
|
||||||
["FlatFieldCorrection16"] = ("增强与校正", "🟡", "📐"),
|
|
||||||
["Threshold"] = ("分割与阈值", "🟢", "📊"),
|
|
||||||
["Division"] = ("分割与阈值", "🟢", "➗"),
|
|
||||||
["Morphology"] = ("形态学与轮廓", "🔴", "🔲"),
|
|
||||||
["Contour"] = ("形态学与轮廓", "🔴", "✏️"),
|
|
||||||
};
|
|
||||||
|
|
||||||
public OperatorToolboxViewModel(IImageProcessingService imageProcessingService)
|
public OperatorToolboxViewModel(IImageProcessingService imageProcessingService)
|
||||||
{
|
{
|
||||||
@@ -82,10 +68,8 @@ namespace XplorePlane.ViewModels
|
|||||||
foreach (var key in _imageProcessingService.GetAvailableProcessors())
|
foreach (var key in _imageProcessingService.GetAvailableProcessors())
|
||||||
{
|
{
|
||||||
var displayName = _imageProcessingService.GetProcessorDisplayName(key);
|
var displayName = _imageProcessingService.GetProcessorDisplayName(key);
|
||||||
var (category, catIcon, opIcon) = CategoryMap.TryGetValue(key, out var info)
|
var (category, categoryIcon, operatorIcon) = OperatorUiMetadata.Get(key);
|
||||||
? info
|
AvailableOperators.Add(new OperatorDescriptor(key, displayName ?? key, operatorIcon, category, categoryIcon));
|
||||||
: ("其他", "⚙", "⚙");
|
|
||||||
AvailableOperators.Add(new OperatorDescriptor(key, displayName ?? key, opIcon, category, catIcon));
|
|
||||||
}
|
}
|
||||||
ApplyFilter();
|
ApplyFilter();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,7 +183,8 @@ namespace XplorePlane.ViewModels
|
|||||||
}
|
}
|
||||||
|
|
||||||
var displayName = _imageProcessingService.GetProcessorDisplayName(operatorKey) ?? operatorKey;
|
var displayName = _imageProcessingService.GetProcessorDisplayName(operatorKey) ?? operatorKey;
|
||||||
var node = new PipelineNodeViewModel(operatorKey, displayName)
|
var icon = OperatorUiMetadata.GetOperatorIcon(operatorKey);
|
||||||
|
var node = new PipelineNodeViewModel(operatorKey, displayName, icon)
|
||||||
{
|
{
|
||||||
Order = PipelineNodes.Count
|
Order = PipelineNodes.Count
|
||||||
};
|
};
|
||||||
@@ -442,7 +443,8 @@ namespace XplorePlane.ViewModels
|
|||||||
{
|
{
|
||||||
var displayName = _imageProcessingService.GetProcessorDisplayName(nodeModel.OperatorKey)
|
var displayName = _imageProcessingService.GetProcessorDisplayName(nodeModel.OperatorKey)
|
||||||
?? nodeModel.OperatorKey;
|
?? nodeModel.OperatorKey;
|
||||||
var node = new PipelineNodeViewModel(nodeModel.OperatorKey, displayName)
|
var icon = OperatorUiMetadata.GetOperatorIcon(nodeModel.OperatorKey);
|
||||||
|
var node = new PipelineNodeViewModel(nodeModel.OperatorKey, displayName, icon)
|
||||||
{
|
{
|
||||||
Order = nodeModel.Order,
|
Order = nodeModel.Order,
|
||||||
IsEnabled = nodeModel.IsEnabled
|
IsEnabled = nodeModel.IsEnabled
|
||||||
|
|||||||
@@ -164,7 +164,7 @@
|
|||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontSize="13"
|
FontSize="13"
|
||||||
Text="⚙" />
|
Text="{Binding IconPath}" />
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- 算子名称 -->
|
<!-- 算子名称 -->
|
||||||
|
|||||||
@@ -164,7 +164,7 @@
|
|||||||
<ProjectReference Include="..\XP.Camera\XP.Camera.csproj" />
|
<ProjectReference Include="..\XP.Camera\XP.Camera.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
<Exec Command="xcopy $(SolutionDir)ExternalLibraries\*.* $(TargetDir) /d /y" />
|
<Exec Command="xcopy "$(MSBuildProjectDirectory)\..\ExternalLibraries\*.*" "$(TargetDir)" /d /y" />
|
||||||
<Exec Command="xcopy $(SolutionDir)ExternalLibraries\Models $(TargetDir)Models\ /d /y /i" />
|
<Exec Command="xcopy "$(MSBuildProjectDirectory)\..\ExternalLibraries\Models" "$(TargetDir)Models\" /d /y /i" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
+21
-5
@@ -46,16 +46,14 @@
|
|||||||
1、各窗体间数据流的传递,全局数据结构的设计(包括一个基本的说明文档)√
|
1、各窗体间数据流的传递,全局数据结构的设计(包括一个基本的说明文档)√
|
||||||
2、将telerik 升级到 2024.1.408.310;调整界面和主题;引入 硬件层依赖 √
|
2、将telerik 升级到 2024.1.408.310;调整界面和主题;引入 硬件层依赖 √
|
||||||
3、图像算子流程文件,保存文件后缀 .imw, image process workflow 缩写 √
|
3、图像算子流程文件,保存文件后缀 .imw, image process workflow 缩写 √
|
||||||
4、CNC保存文件后缀为.xp, 表示 XplorePlane CNC file 的缩写
|
4、CNC保存文件后缀为.xp, 表示 XplorePlane CNC file 的缩写 √
|
||||||
5、硬件层射线源控件的初步集成(采用库层面的自定义控件方式) √
|
5、硬件层射线源控件的初步集成(采用库层面的自定义控件方式) √
|
||||||
PrismBootstrapper 的执行顺序是:RegisterTypes() → ConfigureModuleCatalog() → InitializeModules() → CreateShell()
|
PrismBootstrapper 的执行顺序是:RegisterTypes() → ConfigureModuleCatalog() → InitializeModules() → CreateShell()
|
||||||
|
|
||||||
|
|
||||||
|
2026.4.16
|
||||||
|
|
||||||
2026.3.27
|
|
||||||
----------------------
|
----------------------
|
||||||
CNC及矩阵功能的设计与实现,包含以下功能:
|
CNC及矩阵功能的设计与评审,包含以下功能: √
|
||||||
1、CNC功能设计与实现,包含以下功能:
|
1、CNC功能设计与实现,包含以下功能:
|
||||||
a. CNC状态的定义和管理
|
a. CNC状态的定义和管理
|
||||||
b. CNC界面设计与实现
|
b. CNC界面设计与实现
|
||||||
@@ -66,6 +64,24 @@ CNC及矩阵功能的设计与实现,包含以下功能:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2026.4.20
|
||||||
|
----------------------
|
||||||
|
1、图像算子工具箱的图标 √
|
||||||
|
2、最新的图像算子集成
|
||||||
|
3、修复流程图编辑器,并屏蔽
|
||||||
|
4、主页面加载图像的功能
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user