From 3ace098f21b2ad6959575b958d2c6607d1389100 Mon Sep 17 00:00:00 2001 From: tfarcraw <123211521@163.com> Date: Thu, 19 Nov 2026 01:29:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E4=B8=8E=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=AD=A5=E9=AA=A4=E9=BB=98=E8=AE=A4=E5=90=AF=E7=94=A8=E9=99=90?= =?UTF-8?q?=E6=97=B6=E5=A4=8D=E6=A3=80=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs | 2 +- .../SopAgent/SopDraftVerification.cs | 2 +- tests/VideoFlowTest.Smoke/Program.cs | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs b/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs index b53ac7b..d7679c5 100644 --- a/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs +++ b/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs @@ -780,7 +780,7 @@ public class RegionNode : EditorNode /// public class StepNode : EditorNode { - private int _aiCheckWindowMs, _aiMaxChecks = 3, _aiCheckSettleMs = 350; + private int _aiCheckWindowMs = 10000, _aiMaxChecks = 3, _aiCheckSettleMs = 350; public int AiCheckWindowMs { get => _aiCheckWindowMs; set { if (SetProperty(ref _aiCheckWindowMs, value)) RaisePropertyChanged(nameof(AiContinueAfterWindow)); } } public bool AiContinueAfterWindow { get => AiCheckWindowMs > 0; set { if (value != AiContinueAfterWindow) AiCheckWindowMs = value ? 10000 : 0; } } public int AiMaxChecks { get => _aiMaxChecks; set => SetProperty(ref _aiMaxChecks, value); } diff --git a/src/SopHelper.CrossPlatform.Engine/SopAgent/SopDraftVerification.cs b/src/SopHelper.CrossPlatform.Engine/SopAgent/SopDraftVerification.cs index 3f43644..1daac5f 100644 --- a/src/SopHelper.CrossPlatform.Engine/SopAgent/SopDraftVerification.cs +++ b/src/SopHelper.CrossPlatform.Engine/SopAgent/SopDraftVerification.cs @@ -35,7 +35,7 @@ public static class SopDraftConfigBuilder config.Sop.Steps = draft.Steps.Select((step, index) => { var previous = config.Sop.Steps.ElementAtOrDefault(index); - var ai = previous?.AiConfirmation ?? new(); + var ai = previous?.AiConfirmation ?? new() { CheckWindowMs = 10000 }; ai.ImageMode = step.ImageMode ?? (previous is null ? VisionImageMode.FixedRegion : ai.ImageMode); ai.ImageRegion = step.ImageRegion ?? (previous is null ? (step.Method == ConditionMethod.HandMove ? step.ToRegion : step.Region) : ai.ImageRegion); return new StepDef { Id = index + 1, Name = step.Name, Description = step.Description, Timeout = previous?.Timeout ?? 0, diff --git a/tests/VideoFlowTest.Smoke/Program.cs b/tests/VideoFlowTest.Smoke/Program.cs index 6dbe65f..0a86f80 100644 --- a/tests/VideoFlowTest.Smoke/Program.cs +++ b/tests/VideoFlowTest.Smoke/Program.cs @@ -47,6 +47,8 @@ internal static class Program private static void CheckSequenceEditor() { + Check(new StepNode().AiCheckWindowMs == 10000 && new StepNode().AiMaxChecks == 3, + "新建步骤默认使用10秒限时复检,最多3次"); var config = new SopConfig(); config.Sop.Steps.Add(new() { Id = 1, Description = "状态变化", AiConfirmation = new() { EvidenceMode = VisionEvidenceMode.Sequence, ObservationMinMs = 1800, ObservationMaxFrames = 13, ObservationSampleMs = 300,