只有当流程图执行异常时,才显示强调色
This commit is contained in:
@@ -205,7 +205,7 @@ namespace XplorePlane.ViewModels
|
||||
|
||||
if (string.IsNullOrWhiteSpace(operatorKey))
|
||||
{
|
||||
StatusMessage = "算子键不能为空";
|
||||
SetInfoStatus("算子键不能为空");
|
||||
_logger.Warn("AddOperator 失败:operatorKey 为空");
|
||||
return;
|
||||
}
|
||||
@@ -216,14 +216,14 @@ namespace XplorePlane.ViewModels
|
||||
|
||||
if (!available.Contains(operatorKey))
|
||||
{
|
||||
StatusMessage = $"算子 '{operatorKey}' 未注册";
|
||||
SetInfoStatus($"算子 '{operatorKey}' 未注册");
|
||||
_logger.Warn("AddOperator 失败:算子 {Key} 未注册", operatorKey);
|
||||
return;
|
||||
}
|
||||
|
||||
if (PipelineNodes.Count >= MaxPipelineLength)
|
||||
{
|
||||
StatusMessage = $"流水线节点数已达上限({MaxPipelineLength})";
|
||||
SetInfoStatus($"流水线节点数已达上限({MaxPipelineLength})");
|
||||
_logger.Warn("AddOperator 失败:节点数已达上限 {Max}", MaxPipelineLength);
|
||||
return;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ namespace XplorePlane.ViewModels
|
||||
SelectedNode = node;
|
||||
_logger.Info("节点已添加到 PipelineNodes:{Key} ({DisplayName}),当前节点数={Count}",
|
||||
operatorKey, displayName, PipelineNodes.Count);
|
||||
StatusMessage = $"已添加算子:{displayName}";
|
||||
SetInfoStatus($"已添加算子:{displayName}");
|
||||
TriggerDebouncedExecution();
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace XplorePlane.ViewModels
|
||||
RenumberNodes();
|
||||
SelectNeighborAfterRemoval(removedIndex);
|
||||
|
||||
StatusMessage = $"已移除算子:{node.DisplayName}";
|
||||
SetInfoStatus($"已移除算子:{node.DisplayName}");
|
||||
TriggerDebouncedExecution();
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ namespace XplorePlane.ViewModels
|
||||
PipelineNodes.Insert(newIndex, node);
|
||||
RenumberNodes();
|
||||
SelectedNode = node;
|
||||
StatusMessage = $"已调整算子顺序:{node.DisplayName}";
|
||||
SetInfoStatus($"已调整算子顺序:{node.DisplayName}");
|
||||
TriggerDebouncedExecution();
|
||||
}
|
||||
|
||||
@@ -301,9 +301,9 @@ namespace XplorePlane.ViewModels
|
||||
|
||||
node.IsEnabled = !node.IsEnabled;
|
||||
SelectedNode = node;
|
||||
StatusMessage = node.IsEnabled
|
||||
SetInfoStatus(node.IsEnabled
|
||||
? $"已启用算子:{node.DisplayName}"
|
||||
: $"已停用算子:{node.DisplayName}";
|
||||
: $"已停用算子:{node.DisplayName}");
|
||||
TriggerDebouncedExecution();
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ namespace XplorePlane.ViewModels
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
StatusMessage = $"加载图像失败:{ex.Message}";
|
||||
SetErrorStatus($"加载图像失败:{ex.Message}");
|
||||
_logger.Error(ex, "加载图像失败:{Path}", dialog.FileName);
|
||||
}
|
||||
}
|
||||
@@ -465,7 +465,7 @@ namespace XplorePlane.ViewModels
|
||||
|
||||
SourceImage = bitmap;
|
||||
PreviewImage = bitmap;
|
||||
StatusMessage = $"已加载图像:{Path.GetFileName(filePath)}";
|
||||
SetInfoStatus($"已加载图像:{Path.GetFileName(filePath)}");
|
||||
PublishManualImageLoaded(bitmap, filePath);
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ namespace XplorePlane.ViewModels
|
||||
|
||||
SourceImage = bitmap;
|
||||
PreviewImage = bitmap;
|
||||
StatusMessage = $"已加载图像:{Path.GetFileName(filePath)}";
|
||||
SetInfoStatus($"已加载图像:{Path.GetFileName(filePath)}");
|
||||
PublishManualImageLoaded(bitmap, filePath);
|
||||
|
||||
if (runPipeline)
|
||||
@@ -504,7 +504,7 @@ namespace XplorePlane.ViewModels
|
||||
|
||||
SourceImage = payload.Image;
|
||||
PreviewImage = payload.Image;
|
||||
StatusMessage = $"已加载图像:{payload.FileName}";
|
||||
SetInfoStatus($"已加载图像:{payload.FileName}");
|
||||
}
|
||||
|
||||
private void CancelExecution()
|
||||
@@ -535,14 +535,14 @@ namespace XplorePlane.ViewModels
|
||||
PreviewImage = null;
|
||||
_currentFilePath = null;
|
||||
PipelineFileDisplayName = DefaultPipelineFileDisplayName;
|
||||
StatusMessage = "已新建流水线";
|
||||
SetInfoStatus("已新建流水线");
|
||||
}
|
||||
|
||||
private async Task SavePipelineAsync()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(PipelineName) || PipelineName.Length > 100)
|
||||
{
|
||||
StatusMessage = "流水线名称不能为空且长度不超过 100 个字符";
|
||||
SetInfoStatus("流水线名称不能为空且长度不超过 100 个字符");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ namespace XplorePlane.ViewModels
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(PipelineName) || PipelineName.Length > 100)
|
||||
{
|
||||
StatusMessage = "流水线名称不能为空且长度不超过 100 个字符";
|
||||
SetInfoStatus("流水线名称不能为空且长度不超过 100 个字符");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -586,11 +586,11 @@ namespace XplorePlane.ViewModels
|
||||
var model = BuildPipelineModel();
|
||||
await _persistenceService.SaveAsync(model, filePath);
|
||||
PipelineFileDisplayName = FormatPipelinePath(filePath);
|
||||
StatusMessage = $"流水线已保存:{Path.GetFileName(filePath)}";
|
||||
SetInfoStatus($"流水线已保存:{Path.GetFileName(filePath)}");
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
StatusMessage = $"保存失败:{ex.Message}";
|
||||
SetErrorStatus($"保存失败:{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -604,11 +604,11 @@ namespace XplorePlane.ViewModels
|
||||
File.Delete(_currentFilePath);
|
||||
|
||||
NewPipeline();
|
||||
StatusMessage = "流水线已删除";
|
||||
SetInfoStatus("流水线已删除");
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
StatusMessage = $"删除失败:{ex.Message}";
|
||||
SetErrorStatus($"删除失败:{ex.Message}");
|
||||
}
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
@@ -659,12 +659,12 @@ namespace XplorePlane.ViewModels
|
||||
}
|
||||
|
||||
_logger.Info("流水线已加载:{Name},节点数={Count}", model.Name, PipelineNodes.Count);
|
||||
StatusMessage = $"已加载流水线:{model.Name}({PipelineNodes.Count} 个节点)";
|
||||
SetInfoStatus($"已加载流水线:{model.Name}({PipelineNodes.Count} 个节点)");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Warn("加载流水线失败:{Error}", ex.Message);
|
||||
StatusMessage = $"加载失败:{ex.Message}";
|
||||
SetErrorStatus($"加载失败:{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -289,8 +289,7 @@
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsValueValid}" Value="False">
|
||||
<Setter Property="BorderBrush" Value="Red" />
|
||||
<Setter Property="Background" Value="#FFF0F0" />
|
||||
<Setter Property="BorderBrush" Value="#D9534F" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
Reference in New Issue
Block a user