feat(live): disable the trigger-fps control in Continuous mode#586
Open
hongquanli wants to merge 1 commit into
Open
feat(live): disable the trigger-fps control in Continuous mode#586hongquanli wants to merge 1 commit into
hongquanli wants to merge 1 commit into
Conversation
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>
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
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— disablesentry_triggerFPSwith 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 whatset_trigger_fpsactually honors.Scope
camera.set_frame_ratewithout 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_changedonlyprints) — 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 makestest_HighContentScreeningGui.pylocal-only):trigger_fps_is_activeper mode +set_trigger_fpsgating (applies in Software, no-op in Continuous)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