From 2197f740cbd3e6b1a7abf0e86bffed043aa3c163 Mon Sep 17 00:00:00 2001 From: tfarcraw <123211521@163.com> Date: Tue, 10 Nov 2026 18:05:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A5=E9=AA=A4=E7=BC=96=E8=BE=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=BB=98=E8=AE=A4=E5=BC=80=E5=90=AF=E7=9A=84=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E5=9B=BE=E4=BF=9D=E5=AD=98=E5=92=8C=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VVMs/RecipeEditor/EditorNodes.cs | 18 ++++ .../VVMs/RecipeEditor/RecipeEditor.axaml | 9 ++ .../VVMs/RecipeEditor/RecipeEditor.axaml.cs | 16 ++++ .../VVMs/SopPage/SopPageViewModel.cs | 44 +++++++++- .../Sop/SopConfig.cs | 6 ++ tests/Avalonia.Smoke/Program.cs | 87 +++++++++++++++++++ 6 files changed, 179 insertions(+), 1 deletion(-) diff --git a/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs b/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs index b483291..0f37f12 100644 --- a/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs +++ b/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs @@ -423,6 +423,8 @@ public class RecipeNode : EditorNode Description = step.Description, Timeout = step.Timeout, StandardDurationMs = step.StandardDurationMs, + SaveCompletionImage = step.SaveCompletionImage, + CompletionImageDirectory = step.CompletionImageDirectory, }; foreach (var item in step.MustKeep) stepNode.MustKeep.Items.Add(new TextItem { Text = item, RemoveCommand = stepNode.MustKeep.RemoveCommand }); @@ -477,6 +479,8 @@ public class RecipeNode : EditorNode Description = step.Description, Timeout = step.Timeout, StandardDurationMs = step.StandardDurationMs, + SaveCompletionImage = step.SaveCompletionImage, + CompletionImageDirectory = step.CompletionImageDirectory, }; def.MustKeep.AddRange(step.MustKeep.Items.Select(i => i.Text).Where(s => !string.IsNullOrWhiteSpace(s))); @@ -773,6 +777,8 @@ public class StepNode : EditorNode private string _description = ""; private int _timeout; private int _standardDurationMs; + private bool _saveCompletionImage = true; + private string _completionImageDirectory = ""; // 即使 YAML 没有 detection,也保留可编辑对象,供界面写入新选择的方法。 private ConditionNode? _detection = new(); @@ -811,6 +817,18 @@ public class StepNode : EditorNode set { SetProperty(ref _standardDurationMs, value); } } + public bool SaveCompletionImage + { + get => _saveCompletionImage; + set => SetProperty(ref _saveCompletionImage, value); + } + + public string CompletionImageDirectory + { + get => _completionImageDirectory; + set => SetProperty(ref _completionImageDirectory, value); + } + /// 判定条件(method 留空 = 本步不写 detection 节点) public ConditionNode? Detection { diff --git a/src/SopHelper.Avalonia/VVMs/RecipeEditor/RecipeEditor.axaml b/src/SopHelper.Avalonia/VVMs/RecipeEditor/RecipeEditor.axaml index 17a25fa..93d1f37 100644 --- a/src/SopHelper.Avalonia/VVMs/RecipeEditor/RecipeEditor.axaml +++ b/src/SopHelper.Avalonia/VVMs/RecipeEditor/RecipeEditor.axaml @@ -148,6 +148,15 @@ + + + + + +