Skip to content

fix: fall back to per-iris defaults when channel has no confocal_hardware_settings#537

Merged
Alpaca233 merged 1 commit into
masterfrom
fix/xlight-iris-default-fallback
May 10, 2026
Merged

fix: fall back to per-iris defaults when channel has no confocal_hardware_settings#537
Alpaca233 merged 1 commit into
masterfrom
fix/xlight-iris-default-fallback

Conversation

@Alpaca233
Copy link
Copy Markdown
Collaborator

Summary

  • SpinningDiskConfocalWidget.update_iris_from_config used slider.minimum() (i.e. 0) as the fallback when a channel's confocal_hardware_settings.illumination_iris / emission_iris was None, causing the iris UI to read 0 whenever the field was unset.
  • Switch the fallback to XLIGHT_ILLUMINATION_IRIS_DEFAULT / XLIGHT_EMISSION_IRIS_DEFAULT (both 100) so the UI matches the default that default_config_generator.build_confocal_settings_from_config already writes for fresh profiles.

Why this matters

The fresh-config path in default_config_generator.py already populates iris fields with 100 when confocal_config.yaml is missing. But channels whose confocal_hardware_settings ends up None (legacy/migrated configs, profiles generated with include_confocal=False, etc.) hit this UI fallback and showed 0 — even though hardware defaults to fully open. This made it look like the iris was always defaulting to 0 on systems without a confocal config file.

Test plan

  • Launch GUI with a profile whose channel YAMLs have confocal_hardware_settings: null and verify the iris sliders read 100 (not 0) on channel selection.
  • Launch GUI with a profile whose channel YAMLs have explicit illumination_iris / emission_iris values and confirm those values still display correctly (no regression).
  • black --config pyproject.toml --check .

🤖 Generated with Claude Code

…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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_config to fall back to XLIGHT_ILLUMINATION_IRIS_DEFAULT / XLIGHT_EMISSION_IRIS_DEFAULT rather than slider.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.

@Alpaca233 Alpaca233 merged commit beaf48c into master May 10, 2026
7 checks passed
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.

2 participants