重构 Autocal 采集页:单一队列与控制器驱动的主按钮

选点、对准、加载与录像分散在两个面板,状态靠隐藏相位判断。现改由不依赖 Qt 的采集控制器驱动,并加入录像选项、汇总平铺副本、保持到时自动结束、会话结束回到空闲,以及无设备时的模拟采集。已运行 Autocal 非 Qt 测试并通过范围内门禁;界面测试待 Windows 复核,未做实机验收。
This commit is contained in:
ykcheungab
2026-10-18 16:04:32 +08:00
parent 85d0b396e3
commit 06e06126ca
44 changed files with 7769 additions and 2218 deletions
+18 -10
View File
@@ -32,11 +32,19 @@ def _finish_simulated_campaign(campaign) -> None:
def _acquired_hashes(root) -> dict[str, str]:
"""Hashes of the recorded evidence only: derived results are not evidence."""
"""Hashes of the recorded evidence only: export artifacts are not evidence.
The published summary lives in ``derived/`` and its readable mirror in
``summary/``; both are written by the export, so neither is part of the
acquisition and neither may appear in this comparison.
"""
return {
str(path.relative_to(root)): hashlib.sha256(path.read_bytes()).hexdigest()
for path in root.rglob("*")
if path.is_file() and "derived" not in path.parts and path.name != POINTER_NAME
if path.is_file()
and "derived" not in path.parts
and "summary" not in path.parts
and path.name != POINTER_NAME
}
@@ -78,8 +86,8 @@ def test_a_failed_export_is_reported_and_can_be_retried(
_pump(panel)
assert not (root / POINTER_NAME).exists()
assert "disk full" in panel.result_label.text()
assert panel.trial.status == "idle" # the acquisition result is untouched
assert "disk full" in panel.message.text()
assert panel._directory() == "" # the acquisition result is untouched
monkeypatch.undo()
assert panel.publish_summary_for(root)
@@ -127,16 +135,16 @@ def test_a_published_candidate_is_republished_when_the_review_is_saved(qt_app, t
def test_the_multipoint_end_of_campaign_starts_the_export(make_window, tmp_path):
window = make_window()
panel = window.calibration_panel
multipoint = panel.multipoint
multipoint.campaign.add_site("P1", 0, 0, 1, [5.0], 1, 1, max_force_n=20)
directory = multipoint.campaign.start(
campaign = panel.campaign
campaign.add_site("P1", 0, 0, 1, [5.0], 1, 1, max_force_n=20)
directory = campaign.start(
tmp_path, sensor_model="finger", sensor_sn="SN1",
coordinate_frame="sensor", max_force_n=20, simulate=True,
)
_finish_simulated_campaign(multipoint.campaign)
assert multipoint.campaign.phase == "done"
_finish_simulated_campaign(campaign)
assert campaign.phase == "done"
multipoint._poll()
panel._poll()
_pump(panel)
assert (directory / POINTER_NAME).is_file()