Skip to content

Daytime (manual) alignment screen (#455)#456

Open
brickbots wants to merge 2 commits into
mainfrom
worktree-daytime-alignment-455
Open

Daytime (manual) alignment screen (#455)#456
brickbots wants to merge 2 commits into
mainfrom
worktree-daytime-alignment-455

Conversation

@brickbots

Copy link
Copy Markdown
Owner

Closes #455.

Adds a no-solve alignment path for daylight setup. The user points the scope at a distant object centred in the eyepiece, finds where the rigidly-mounted camera sees it, and marks that pixel by eye — writing it straight to target_pixel, the same destination the solve-based UIAlign / align_on_radec reaches (shared_state.set_target_pixel() + config["target_pixel"], stored as (Y, X) in the 512px native frame).

What's here

UIAlignDaytime (ui/align_daytime.py), wired as "Align (Day)" right after "Align" in the Start menu (stateful, preload). Like the solve-based screen it starts inactiveSQUARE begins the process. Then:

  • Coarse: up to 3 rounds of 2×2 quadrant picks using keypad corners (7 TL, 9 TR, 1 BL, 3 BR — TKL layout), each round shrinking the region to the legibility floor (~16px cells on the 128 panel, ~22px on 176).
  • Fine: the first arrow press (or the 3rd round) switches to 1-display-pixel nudging.
  • SQUARE saves and exits; 0 cancels. +/- override exposure; long-press marking menu offers Center and Exp Auto.

Supporting changes

  • ui/camera_render.py — shared crop/zoom/resize helper factored out of UIPreview (Focus screen behaviour preserved, pixel-identical). Daytime renders the frame full-brightness grayscale (no red night-vision mask — dark adaptation is irrelevant in daylight).
  • camera_interface.py / camera_pi.py — new set_exp:native drives picamera2's native auto-exposure for daylight, with a fixed short-exposure fallback on backends without it (debug/none). set_camera_config now clears AeEnable on Pi so manual exposure (exp_up/exp_dn/set_exp:<us>) always overrides native AE. Exposure is saved on entry and restored on exit (active/inactive).
  • Docs — quick-start "Daytime alignment" section + 2 screenshots; CONTEXT.md glossary terms (Daytime vs Solve-based alignment; keypad layout) from the design session.
  • i18n — new UI strings wrapped in _(); Babel extract/update/compile run.
  • Teststests/test_align_daytime.py: quadrant subdivision, display→native (Y, X) conversion at 128/176, and the camera-render helper.

Verification

  • New unit tests + the UI smoke harness (incl. the all-modules coverage guard) pass; ruff check clean; mypy clean on the new files (not mypy-ignored).
  • Ran the headless app: confirmed grayscale rendering and all states (inactive → quadrant grid → shrunk region → fine crosshair), plus a deterministic isolation test proving the full key flow writes target_pixel = (Y, X) to shared_state + config and restores the prior exposure on exit.

Reviewer notes

  • The bulk of the .po diff is location-comment refresh — the catalogs hadn't been re-extracted since 2026-05-24, so running the documented nox -s babel pipeline updated #: line references across the whole file. The only content additions are the daytime-align UI strings (left as Babel's #, fuzzy → English fallback for translators to review).
  • There is pre-existing ruff format drift in menu_structure.py (IMU-settings comments, ~line 1090) left untouched to keep this diff focused; nox -s format auto-fixes it.

🤖 Generated with Claude Code

brickbots and others added 2 commits June 6, 2026 20:25
Adds a no-solve alignment path for daylight setup. The user points the
scope at a distant object centred in the eyepiece, finds where the
rigidly-mounted camera sees it, and marks that pixel by eye -- writing it
straight to `target_pixel`, the same destination the solve-based
`UIAlign`/`align_on_radec` reaches.

New `UIAlignDaytime` (ui/align_daytime.py), placed as "Align (Day)" right
after "Align" in the Start menu. Like the solve-based screen it starts
inactive: SQUARE begins, then up to three rounds of 2x2 quadrant picks
(keypad corners 7/9/1/3) narrow the marker, the first arrow press switches
to one-pixel fine adjustment, SQUARE saves (writes target_pixel as (Y,X)
in 512 native space) and 0 cancels. The long-press marking menu offers
"Center" and "Exp Auto".

Supporting changes:
- ui/camera_render.py: shared crop/zoom/resize helper factored out of
  UIPreview (Focus screen behaviour unchanged); daytime align renders the
  frame full-brightness grayscale (no red night-vision mask).
- camera_interface.py / camera_pi.py: new `set_exp:native` command drives
  the camera's native auto-exposure for daylight, with a fixed
  short-exposure fallback on backends without it (debug/none).
  set_camera_config now clears AeEnable on Pi so manual exposure
  (exp_up/exp_dn/set_exp:<us>) always overrides native AE. Exposure is
  saved on entry and restored on exit (active/inactive).
- docs: quick-start "Daytime alignment" section + screenshots; CONTEXT.md
  glossary terms (Daytime vs Solve-based alignment; keypad layout) from the
  design session.
- i18n: new UI strings wrapped and the Babel extract/update/compile
  pipeline run (the bulk of the .po diff is location-comment refresh -- the
  catalogs had not been re-extracted since 2026-05-24).
- tests: unit coverage for quadrant math, the display->native (Y,X)
  conversion at 128/176, and the camera-render helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the synthetic debug-camera screenshots with real daytime captures
(rooftop/floodlight scene), upscaled 2x crisp with no amber/brightness
recolor so they stay true to the white daytime view. The quadrant step now
shows the region narrowing across multiple rounds: the full 2x2 grid, then
two further picks side by side, plus a fine-mode crosshair shot. Text
adjusted to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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