Skip to content

feat: live view click-to-move fix and Ctrl+Scroll Z navigation#532

Open
Alpaca233 wants to merge 1 commit intomasterfrom
feat/live-view-navigation
Open

feat: live view click-to-move fix and Ctrl+Scroll Z navigation#532
Alpaca233 wants to merge 1 commit intomasterfrom
feat/live-view-navigation

Conversation

@Alpaca233
Copy link
Copy Markdown
Collaborator

Summary

  • Centralize displayed-image pixel size in a new Microscope.get_image_pixel_size_um() helper and use it from move_from_click_image. X is now issued non-blocking immediately followed by a blocking Y so both axes finish before the call returns. Adds an info-level log line that names every factor (lens, binned_um, binning, pixel_size_um, mm delta) so the next distance regression can be diagnosed from a single click.
  • Adds Ctrl+Scroll → 1 µm Z step and Ctrl+Shift+Scroll → 20 µm Z step on the ImageDisplayWindow live view via a Qt event filter. Plain scroll continues to zoom (event is not consumed). Z scroll is gated on the click-to-move checkbox (which toggleAcquisitionStart already forces off during acquisition) and the stage-busy flag, and clamped to SOFTWARE_POS_LIMIT.Z bounds.
  • New step constants LIVE_VIEW_Z_STEP_UM = 1 and LIVE_VIEW_Z_STEP_FAST_UM = 20 in _def.py.

Out of scope: the napari live view widget. True simultaneous XY motion (firmware has no combined-move command).

Test plan

  • New unit tests for Microscope.get_image_pixel_size_um() (returns product, returns None when either factor is missing).
  • New unit tests for ImageDisplayWindow.eventFilter (Ctrl/Ctrl+Shift wheel emits ±1 / ±20 µm; zero notch consumed without emit; plain scroll passes through unchanged).
  • Black format check passes.
  • Full test suite passes (excluding pre-existing failures in tests/control/core/test_zarr_writer.py that are present on master).
  • Manual on hardware: double-click recenters correctly across cameras (capture the new click_to_move: info log if distance is still off so we can identify the wrong factor).
  • Manual on hardware: Ctrl+Scroll moves Z by 1 µm/notch, Ctrl+Shift+Scroll by 20 µm/notch; clamps at 0/6000 µm with a debug log.
  • Manual on hardware: Z scroll is inert during acquisition and while the stage is busy.

🤖 Generated with Claude Code

Centralize displayed-image pixel size in Microscope.get_image_pixel_size_um()
and use it from move_from_click_image. Issue X non-blocking then Y blocking so
both finish before returning. Add an info-level log line that names every
factor (lens, binned_um, binning, pixel_size_um, mm delta) for diagnosing
distance regressions live.

Add Ctrl+Scroll → 1 µm Z step and Ctrl+Shift+Scroll → 20 µm Z step on the
ImageDisplayWindow live view. Plain scroll continues to zoom. Z scroll is
gated on the click-to-move checkbox (which toggleAcquisitionStart already
forces off during acquisition) and the stage-busy flag, and clamped to
SOFTWARE_POS_LIMIT.Z bounds.

Co-Authored-By: Claude Opus 4.7 (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