新建与生成步骤默认启用限时复检策略
This commit is contained in:
parent
3c998832d8
commit
3ace098f21
@ -780,7 +780,7 @@ public class RegionNode : EditorNode
|
||||
/// </summary>
|
||||
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); }
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user