fix(gui): rehearse the video that is loaded, not a second one - #143
Open
gbradham wants to merge 1 commit into
Open
fix(gui): rehearse the video that is loaded, not a second one#143gbradham wants to merge 1 commit into
gbradham wants to merge 1 commit into
Conversation
"Rehearse from video..." always opened its own file picker and ignored whatever the camera panel already had open. Asked what video a rehearsal plays, the honest answer was "a different one, if you are not careful" -- and nothing on screen would have shown it. The scrub bar, the preview and any zones drawn over them would all be describing a clip the pump was not playing. It now plays the loaded video when there is one, and only prompts when there is not. A file chosen at the prompt is loaded into the panel properly rather than handed to the pump alone, so one video is open and everything refers to it. The button says which: "Rehearse session12.mp4" rather than "Rehearse from video...". The first is an answer, the second is a question, and next to a loaded clip the question was the whole problem. It leaves the label alone mid-run, where the button reads "Stop rehearsal" and is the only way to stop hardware that is being driven. Also consolidates the hand-built CameraPanel the behavior tests construct into one helper. Those two tests have now broken three times because _on_behavior_ready gained an attribute they did not know to set; the list of what a panel needs belongs in one place.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Asked what video a rehearsal plays, the honest answer was "a different one, if you're not careful."
Rehearse from video…always opened its own file picker and ignored whatever the camera panel already had open. So you could load a clip, draw zones over it, scrub through it — and then rehearse something else entirely, with the scrub bar, preview and zones all describing a clip the pump wasn't playing. Nothing on screen would have shown the mismatch.The fix
Plays the loaded video when there is one; prompts only when there isn't. A file chosen at that prompt is loaded into the panel properly rather than handed to the pump alone, so there is one open video and everything refers to it.
The button says which:
Rehearse from video…Rehearse session12.mp4The first is a question, the second is an answer — and next to an already-loaded clip, the question was the whole problem. The label is left alone mid-run, where the button reads Stop rehearsal and is the only way to stop hardware that's being driven.
Also: the third break of the same two tests
test_behavior_input_editor.pyhand-builds aCameraPanelfield by field, because the real__init__starts threads and opens cameras. Those two tests have now broken three times because_on_behavior_readygained an attribute they didn't know to set — the vocabulary bus, then the rehearse button, now the video source.The list of what a panel needs is consolidated into one
_ready_panel()helper, so the next addition is one edit rather than one per test. That is the actual defect; patching the assertions again would have guaranteed a fourth time.Tests — 7 new
Plays the loaded video; prompts only when nothing is loaded; a chosen file is loaded into the panel too; a file that won't load isn't rehearsed; the button names the video; it asks when nothing is loaded; and the label is left alone mid-rehearsal.
Verification
PYTHONPATH=src QT_QPA_PLATFORM=offscreen pytest tests/— 3655 passed, 4 skipped, ruff and black clean.