接入 Autocal 实时相机及帧时间显示
视频和相机共用 Finger worker,并保留采集时间、源帧编号及媒体时间。通过界面、采集链和真实视频验证。
This commit is contained in:
@@ -71,9 +71,33 @@ def test_sensor_tab_is_live_panel_and_paths_are_saved(make_window, tmp_dir):
|
||||
assert window.workspace.page("sensor") is window.finger_source_panel
|
||||
window.finger_source_panel.video_path.setText(str(tmp_dir / "input.mp4"))
|
||||
window.finger_source_panel.config_ref.setText(str(tmp_dir / "sensor.json"))
|
||||
window.finger_source_panel.source_kind.setCurrentIndex(1)
|
||||
window.finger_source_panel.camera_index.setValue(3)
|
||||
window._persist_prefs()
|
||||
assert window.prefs["finger_video_path"].endswith("input.mp4")
|
||||
assert window.prefs["finger_config_ref"].endswith("sensor.json")
|
||||
assert window.prefs["finger_source_kind"] == "camera"
|
||||
assert window.prefs["finger_camera_index"] == 3
|
||||
|
||||
|
||||
def test_live_camera_uses_integer_source_and_same_worker(qt_app, tmp_dir, monkeypatch):
|
||||
from orisys_autocal.ui import finger_source_panel
|
||||
|
||||
monkeypatch.setattr(
|
||||
finger_source_panel, "FingerAcquisitionWorker", FakeFingerWorker
|
||||
)
|
||||
config = tmp_dir / "sensor.json"
|
||||
config.write_text("{}", encoding="utf-8")
|
||||
panel = finger_source_panel.FingerSourcePanel(
|
||||
config_ref=str(config), source_kind="camera", camera_index=3
|
||||
)
|
||||
panel.start_button.click()
|
||||
assert panel.worker.started == (3, str(config))
|
||||
assert not panel.camera_index.isEnabled()
|
||||
panel.stop_button.click()
|
||||
panel._poll()
|
||||
assert panel.camera_index.isEnabled()
|
||||
panel.shutdown()
|
||||
|
||||
|
||||
def test_missing_input_is_visible_and_does_not_start_worker(qt_app, monkeypatch):
|
||||
|
||||
Reference in New Issue
Block a user