fix: fall back to per-iris defaults when channel has no confocal_hardware_settings#537
Merged
Merged
Conversation
…ware_settings SpinningDiskConfocalWidget.update_iris_from_config used slider.minimum() (i.e. 0) when a channel's confocal_hardware_settings.illumination_iris / emission_iris was None. That made the iris UI read 0 in setups where the field is unset (e.g. legacy/migrated channels, or channels generated with include_confocal=False). Use XLIGHT_ILLUMINATION_IRIS_DEFAULT / XLIGHT_EMISSION_IRIS_DEFAULT instead so the UI matches the default the config generator already writes for fresh profiles. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the SpinningDiskConfocalWidget iris UI fallback behavior so that when a channel lacks confocal_hardware_settings (or the iris fields are None), the UI displays the XLight per-iris defaults (100) instead of the slider minimum (0). This aligns the UI with the defaults already used when generating fresh confocal configs.
Changes:
- Update
SpinningDiskConfocalWidget.update_iris_from_configto fall back toXLIGHT_ILLUMINATION_IRIS_DEFAULT/XLIGHT_EMISSION_IRIS_DEFAULTrather thanslider.minimum(). - Thread the default values through the existing per-iris loop to keep the logic centralized.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
SpinningDiskConfocalWidget.update_iris_from_configusedslider.minimum()(i.e.0) as the fallback when a channel'sconfocal_hardware_settings.illumination_iris/emission_iriswasNone, causing the iris UI to read0whenever the field was unset.XLIGHT_ILLUMINATION_IRIS_DEFAULT/XLIGHT_EMISSION_IRIS_DEFAULT(both100) so the UI matches the default thatdefault_config_generator.build_confocal_settings_from_configalready writes for fresh profiles.Why this matters
The fresh-config path in
default_config_generator.pyalready populates iris fields with100whenconfocal_config.yamlis missing. But channels whoseconfocal_hardware_settingsends upNone(legacy/migrated configs, profiles generated withinclude_confocal=False, etc.) hit this UI fallback and showed0— even though hardware defaults to fully open. This made it look like the iris was always defaulting to0on systems without a confocal config file.Test plan
confocal_hardware_settings: nulland verify the iris sliders read100(not0) on channel selection.illumination_iris/emission_irisvalues and confirm those values still display correctly (no regression).black --config pyproject.toml --check .🤖 Generated with Claude Code