Restore the camera test-mode toggle PR #532 disconnected#543
Merged
Conversation
PR #532 renamed the camera loop's test-mode flag (debug -> test_mode_on) but moved its initialization inside the capture loop, resetting it to False every frame, and dropped the command handler that flipped it when the UI sends "debug" on the camera queue (Tools > Test Mode, and console key 0). Test mode therefore did nothing: the camera kept publishing real captures instead of the disk test image. Hoist the initialization back above the loop and reinstate the "debug" command toggle. The test-mode branch itself (including #532's set_sqm_radiometer_sample(None) guard) is unchanged. Verified headlessly: before activation the Focus preview cycles the debug camera's three frames (including the starless one); after Tools > Test Mode it stays pinned to test_images/pifinder_debug_02.png on both the Focus and Align (Day) screens, and the solver solves it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
brickbots
marked this pull request as ready for review
July 19, 2026 18:56
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.
Summary
Follow-up to #542 (whose squash merge took only the solver revert): PR #532 also disconnected the camera test mode. With test mode "enabled", the camera kept publishing real captures instead of the disk test image on the Focus and Align (Day) screens.
The bug
#532 renamed the capture loop's test-mode flag (
debug→test_mode_on) incamera_interface.py, but:Falseevery frame, and"debug"on the camera queue — the only thing Tools → Test Mode (callbacks.activate_debug) and console key 0 do to the camera.So the toggle had no effect and real captures were always used.
The fix (4 lines)
test_mode_on = Falseonce, before the loopif command == "debug": test_mode_on = not test_mode_onin the command handlerThe test-mode branch itself — loading
test_images/pifinder_debug_02.png, including #532'sset_sqm_radiometer_sample(None)guard — was intact and is unchanged.Verification (headless end-to-end run of this change)
pifinder_debug_02.pngacross repeated captures, and the solver plate-solves it (live RA/Dec)ruff check/ruff format --checkclean;pytest -m smoke: 5 passed🤖 Generated with Claude Code