From 9dc2036ffa16dc5e2d0881b2e8063e4af50f7ce8 Mon Sep 17 00:00:00 2001
From: tfarcraw <123211521@163.com>
Date: Thu, 19 Nov 2026 13:54:13 +0800
Subject: [PATCH] =?UTF-8?q?=E6=AD=A5=E9=AA=A4=E9=A1=B5=E6=94=B9=E4=B8=BA15?=
=?UTF-8?q?=E6=AF=9435=E6=AF=9450=E5=B8=83=E5=B1=80=E5=B9=B6=E9=87=8D?=
=?UTF-8?q?=E6=8E=92=E5=8F=82=E6=95=B0=E6=B6=88=E9=99=A4=E6=A8=AA=E5=90=91?=
=?UTF-8?q?=E6=BB=9A=E5=8A=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../VVMs/RecipeEditor/RecipeEditor.axaml | 262 ++++++++----------
tests/VideoFlowTest.Smoke/Program.cs | 12 +
2 files changed, 123 insertions(+), 151 deletions(-)
diff --git a/src/SopHelper.Avalonia/VVMs/RecipeEditor/RecipeEditor.axaml b/src/SopHelper.Avalonia/VVMs/RecipeEditor/RecipeEditor.axaml
index f79a317..d5e884d 100644
--- a/src/SopHelper.Avalonia/VVMs/RecipeEditor/RecipeEditor.axaml
+++ b/src/SopHelper.Avalonia/VVMs/RecipeEditor/RecipeEditor.axaml
@@ -11,21 +11,25 @@
-
-
-
-
-
-
-
+
+
-
-
-
-
+
+
+
+
+
+
+
@@ -52,17 +56,14 @@
-
-
-
-
-
-
+
+
+
-
+
@@ -107,179 +108,138 @@
-
-
-
+
+
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/tests/VideoFlowTest.Smoke/Program.cs b/tests/VideoFlowTest.Smoke/Program.cs
index 64f1b7a..03a7fb4 100644
--- a/tests/VideoFlowTest.Smoke/Program.cs
+++ b/tests/VideoFlowTest.Smoke/Program.cs
@@ -165,6 +165,11 @@ internal static class Program
var view = new RecipeEditor { DataContext = vm };
var window = new Window { Content = view, Width = 1040, Height = 760 }; window.Show(); window.UpdateLayout();
var stepVideo = view.FindControl("StepVideoViewport")!;
+ var parameters = view.FindControl("StepParameters")!;
+ Check(parameters.Bounds.Width > window.Bounds.Width * .30 && parameters.Bounds.Width < window.Bounds.Width * .37
+ && parameters.Extent.Width <= parameters.Viewport.Width + 1,
+ "Parameters occupy 35 percent and fit without horizontal scrolling");
+
Check(stepVideo.Bounds.Width >= window.Bounds.Width * .44 && stepVideo.Bounds.Width <= window.Bounds.Width * .53,
"Step video occupies half the available editor width");
@@ -266,6 +271,13 @@ internal static class Program
"Video and frame detection continue while AI is still pending");
Until(() => playback.IsAtEnd);
Check(!fake.Result.Task.IsCompleted && !test.IsCompleted && ids.Last() > ids.First(), "Video reaches EOF without waiting for AI or reporting premature success");
+ // EOF可能发生在首次送检后不足500ms,明确等待请求过期后再模拟迟到结果。
+ var remainingDeadline = RealtimeDecisionPolicy.DeadlineMs - RealtimeDecisionPolicy.Elapsed(fake.Request!.StartedTimestamp);
+ if (remainingDeadline > 0)
+ {
+ using var deadlineWait = new CancellationTokenSource(TimeSpan.FromMilliseconds(remainingDeadline + 30));
+ Dispatcher.UIThread.MainLoop(deadlineWait.Token);
+ }
fake.Result.SetResult(new(true, .99, "盒内可见零件"));
Pump(test.FinishPendingDecisionAsync());
Check(!test.IsCompleted, "Late background result after EOF cannot bypass the 500ms deadline");