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,