Present replay 3D with the cursor and open Analyze on a remembered video
Replay left the 3D pane on the rest mesh or a sparse overlay, and Analyze skipped the setup dialog unless the file was re-picked. Live Run no longer starts a chain on a video path. Verified with Studio tests for flush, overlay mask, Analyze open, live-video refusal, and locales.
This commit is contained in:
@@ -494,9 +494,12 @@ class _Host:
|
||||
raise AssertionError("the test did not provide an analysis service")
|
||||
return self.service_factory(recording, cancelled, on_progress)
|
||||
|
||||
def bare_video_workspace(self, video):
|
||||
def bare_video_workspace(self, video, **kwargs):
|
||||
return None
|
||||
|
||||
def recording_analysis_overrides(self, recording):
|
||||
return False
|
||||
|
||||
|
||||
class _RecordingReader:
|
||||
"""The recording reader as the engine and the controller use it."""
|
||||
@@ -816,7 +819,7 @@ def test_a_seek_equals_playing_forward_to_the_same_frame(session):
|
||||
|
||||
|
||||
def test_the_3d_pane_is_fed_the_same_frame_the_canvas_draws(session):
|
||||
"""One cursor, two figures: the packet's id, flow and mask are the frame's own."""
|
||||
"""One cursor, two figures: the packet's id, flow, depth and mask are the frame's own."""
|
||||
frame = session.frame_at(session.time_of(LAST_FRAME_ID - 2))
|
||||
assert frame is not None
|
||||
packet = session.packet(frame)
|
||||
@@ -828,10 +831,49 @@ def test_the_3d_pane_is_fed_the_same_frame_the_canvas_draws(session):
|
||||
)
|
||||
assert np.array_equal(np.asarray(packet.valid_mask), np.asarray(frame.valid_mask))
|
||||
assert packet.flow_valid is True and packet.flow_frame_id == int(frame.frame_id)
|
||||
assert bool(packet.depth_valid) is bool(frame.has_depth)
|
||||
if frame.has_depth:
|
||||
assert np.array_equal(np.asarray(packet.depth), np.asarray(frame.depth))
|
||||
assert packet.depth_frame_id == int(frame.frame_id)
|
||||
else:
|
||||
assert packet.depth is None and packet.depth_frame_id is None
|
||||
assert packet.forces_valid is False, "a result stores no force, so none may be claimed"
|
||||
assert float(packet.mono_t) == pytest.approx(frame.t_rel_s)
|
||||
|
||||
|
||||
def test_paint_policy_matches_the_2d_painter_threshold(session, box_session):
|
||||
"""3D overlays use ``paint_policy``: finger keeps the display floor, box keeps 2 px."""
|
||||
from orisys_app_shared.acquisition.arrows import sdk_box_policy
|
||||
from orisys_app_shared.scene3d.visual_policy import VisualPolicy
|
||||
|
||||
finger = session.paint_policy()
|
||||
assert finger.flow_on_px == pytest.approx(session.display_policy.flow_on_px)
|
||||
assert int(finger.flow_grid_spacing) == int(
|
||||
session.stored_policy().get("flow_grid_spacing", session.policy.flow_grid_spacing)
|
||||
)
|
||||
|
||||
# Keep the stored grid; only the activity threshold moves.
|
||||
adopted = session.display_policy
|
||||
assert session.serve_policy(
|
||||
VisualPolicy(
|
||||
flow_on_px=0.9,
|
||||
flow_off_px=0.6,
|
||||
flow_grid_spacing=adopted.flow_grid_spacing,
|
||||
flow_arrow_scale=adopted.flow_arrow_scale,
|
||||
flow_edge_margin=adopted.flow_edge_margin,
|
||||
flow_length_margin=adopted.flow_length_margin,
|
||||
max_arrows=adopted.max_arrows,
|
||||
)
|
||||
)
|
||||
assert session.paint_policy().flow_on_px == pytest.approx(0.9)
|
||||
|
||||
painter = sdk_box_policy()
|
||||
box = box_session.paint_policy()
|
||||
assert box.flow_on_px == pytest.approx(painter.flow_on_px)
|
||||
assert box.flow_off_px == pytest.approx(painter.flow_off_px)
|
||||
assert int(box.flow_grid_spacing) == int(painter.flow_grid_spacing)
|
||||
|
||||
|
||||
# --------------------------------------------------------------- display settings
|
||||
def test_a_display_change_is_a_read_and_writes_no_result(pass_root, session):
|
||||
"""The result key is blind to display settings, so a change must not write.
|
||||
@@ -1450,7 +1492,7 @@ def test_the_nothing_to_draw_line_names_the_action_that_produces_a_result():
|
||||
seen[locale] = text
|
||||
# The action that produces a result is named: the pass runs on open, and the
|
||||
# toolbar action re-runs it.
|
||||
assert "由视频重算" in text or "Recompute from the video" in text, text
|
||||
assert "分析视频" in text or "Analyze video" in text, text
|
||||
assert (
|
||||
"分析" in text or "analysis result" in text
|
||||
), f"{locale} does not say a result is what is missing: {text}"
|
||||
|
||||
Reference in New Issue
Block a user