Skip to content

Restore the camera test-mode toggle PR #532 disconnected#543

Merged
brickbots merged 1 commit into
mainfrom
restore-camera-test-mode
Jul 19, 2026
Merged

Restore the camera test-mode toggle PR #532 disconnected#543
brickbots merged 1 commit into
mainfrom
restore-camera-test-mode

Conversation

@brickbots

Copy link
Copy Markdown
Owner

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 (debugtest_mode_on) in camera_interface.py, but:

  1. moved its initialization inside the capture loop, resetting it to False every frame, and
  2. deleted the command handler that flipped it when the UI sends "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)

  • initialize test_mode_on = False once, before the loop
  • reinstate if command == "debug": test_mode_on = not test_mode_on in the command handler

The test-mode branch itself — loading test_images/pifinder_debug_02.png, including #532's set_sqm_radiometer_sample(None) guard — was intact and is unchanged.

Verification (headless end-to-end run of this change)

  • Before activation, the Focus preview cycles the debug camera's three frames (bright starfield / dark starfield / starless)
  • After Tools → Test Mode, both Focus and Align (Day) stay pinned to pifinder_debug_02.png across repeated captures, and the solver plate-solves it (live RA/Dec)
  • ruff check / ruff format --check clean; pytest -m smoke: 5 passed

🤖 Generated with Claude Code

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
brickbots marked this pull request as ready for review July 19, 2026 18:56
@brickbots
brickbots merged commit 5ef6a1b into main Jul 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant