#0024 修复浮动工具箱
This commit is contained in:
@@ -141,22 +141,30 @@ namespace XplorePlane.ViewModels
|
||||
|
||||
private void AddOperator(string operatorKey)
|
||||
{
|
||||
Serilog.Log.Debug("AddOperator 被调用,operatorKey={OperatorKey}", operatorKey);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(operatorKey))
|
||||
{
|
||||
StatusMessage = "算子键不能为空";
|
||||
Serilog.Log.Warning("AddOperator 失败:operatorKey 为空");
|
||||
return;
|
||||
}
|
||||
|
||||
var available = _imageProcessingService.GetAvailableProcessors();
|
||||
Serilog.Log.Debug("可用算子数量:{Count},包含 {Key}:{Contains}",
|
||||
available.Count(), operatorKey, available.Contains(operatorKey));
|
||||
|
||||
if (!available.Contains(operatorKey))
|
||||
{
|
||||
StatusMessage = $"算子 '{operatorKey}' 未注册";
|
||||
Serilog.Log.Warning("AddOperator 失败:算子 {Key} 未注册", operatorKey);
|
||||
return;
|
||||
}
|
||||
|
||||
if (PipelineNodes.Count >= MaxPipelineLength)
|
||||
{
|
||||
StatusMessage = $"流水线节点数已达上限({MaxPipelineLength})";
|
||||
Serilog.Log.Warning("AddOperator 失败:节点数已达上限 {Max}", MaxPipelineLength);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -167,6 +175,8 @@ namespace XplorePlane.ViewModels
|
||||
};
|
||||
LoadNodeParameters(node);
|
||||
PipelineNodes.Add(node);
|
||||
Serilog.Log.Information("节点已添加到 PipelineNodes:{Key} ({DisplayName}),当前节点数={Count}",
|
||||
operatorKey, displayName, PipelineNodes.Count);
|
||||
StatusMessage = $"已添加算子:{displayName}";
|
||||
TriggerDebouncedExecution();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user