Skip to content

feat(live): disable the trigger-fps control in Continuous mode#586

Open
hongquanli wants to merge 1 commit into
masterfrom
fix/live-continuous-fps-affordance
Open

feat(live): disable the trigger-fps control in Continuous mode#586
hongquanli wants to merge 1 commit into
masterfrom
fix/live-continuous-fps-affordance

Conversation

@hongquanli

Copy link
Copy Markdown
Contributor

Summary

In Continuous trigger mode the camera free-runs at its own internal rate and LiveController.set_trigger_fps() is a no-op — but the live-view fps spinbox stayed editable, silently doing nothing. This makes the control honest.

Change

  • LiveController.trigger_fps_is_active() — new single source of truth for when the trigger-fps setting actually paces acquisition (Software, or Hardware driven by the internal timer). set_trigger_fps() now calls it instead of duplicating the guard.
  • LiveControlWidget — disables entry_triggerFPS with an explanatory tooltip when fps is inert (Continuous), syncing on trigger-mode change and at construction.

Structural rather than a bolted-on if continuous: guard: the widget asks the controller "is fps active?" so the enabled-state can never drift from what set_trigger_fps actually honors.

Scope

  • Does not change behavior in Software/Hardware modes.
  • Does not cap the camera's internal free-run rate in Continuous live — that (wiring an fps control to camera.set_frame_rate without forcing fast readout) is a separate, larger follow-up, tracked in AI-docs.
  • NapariLiveWidget's trigger dropdown is a pre-existing stub (on_trigger_mode_changed only prints) — untouched here.

Testing

tests/control/test_live_trigger_fps.py (headless, method-stealing stub pattern — no QApplication/napari, so it's not blocked by the GL segfault that makes test_HighContentScreeningGui.py local-only):

  • controller trigger_fps_is_active per mode + set_trigger_fps gating (applies in Software, no-op in Continuous)
  • widget enables control + empty tooltip when active; disables + explanatory tooltip when inert

5 passed in ~0.9s. Also smoke-verified against a real simulated LiveController (Software applies fps, Continuous is a no-op, Hardware active with internal timer).

Verification note: the literal greyed-out appearance in the running GUI wasn't verified in-sandbox (headless GL can't build the full napari GUI); it follows directly from setEnabled(False) on the real spinbox. Worth a quick eyeball in the running app.

🤖 Generated with Claude Code

In CONTINUOUS trigger mode the camera free-runs at its own internal rate and
LiveController.set_trigger_fps is inert, but the live-view fps spinbox stayed
editable — silently doing nothing. Make the control honest instead of lying:

- Add LiveController.trigger_fps_is_active() as the single source of truth for
  when the fps setting actually paces acquisition; set_trigger_fps now uses it
  (dedupes the guard rather than special-casing).
- LiveControlWidget disables entry_triggerFPS (with an explanatory tooltip) when
  fps is inert, syncing on trigger-mode change and at construction.

Does NOT change what the box does in Software/Hardware modes. Actually capping
the camera's internal free-run rate in Continuous live is a separate follow-up.

Tests (headless, method-stealing stub pattern, no QApplication): controller
active/inert by mode + set_trigger_fps gating; widget enable/disable + tooltip.

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