fix: XLight/Cicero filter wheel integration#497
Conversation
1675569 to
fe02c5f
Compare
There was a problem hiding this comment.
Pull request overview
Improves CrestOptics X-Light / Cicero spinning-disk integration by aligning UI and live control behavior with the actual hardware capabilities and by making serial timing/logging more robust.
Changes:
- Updates the spinning disk widget to only create/connect emission/dichroic wheel controls when the connected hardware reports those capabilities.
- Switches LiveController emission filter control to use
emission_filter_positionfrom the active channel configuration (removing the old wavelength→position mapping). - Uses
sleep_time_for_wheelfor XLight wheel serial read delays and improves serial response mismatch logging; addsXLIGHT_EMISSION_FILTER_POSITIONSconfig.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| software/control/widgets.py | Conditionally creates/connects emission/dichroic dropdowns based on XLight capability flags; uses configurable emission wheel position count. |
| software/control/serial_peripherals.py | Improves serial mismatch logging; changes XLight wheel command read delays to use sleep_time_for_wheel; changes default for disable_emission_filter_wheel. |
| software/control/microscope.py | Adjusts XLight instantiation formatting (no behavioral change beyond updated XLight defaults). |
| software/control/core/live_controller.py | Uses currentConfiguration.emission_filter_position directly for XLight emission wheel selection. |
| software/control/_def.py | Removes obsolete wavelength→position mapping and adds XLIGHT_EMISSION_FILTER_POSITIONS. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| if validate: | ||
| current_pos = self.serial_connection.write_and_check( | ||
| "B" + position_to_write + "\r", "B" + position_to_read, read_delay=0.01 | ||
| "B" + position_to_write + "\r", "B" + position_to_read, read_delay=self.sleep_time_for_wheel | ||
| ) |
There was a problem hiding this comment.
set_emission_filter() still hard-codes valid positions to 1–8, but the UI now uses XLIGHT_EMISSION_FILTER_POSITIONS (and _def.py documents 5 positions for Cicero). This means a misconfigured emission_filter_position > XLIGHT_EMISSION_FILTER_POSITIONS will pass validation and be sent to hardware, likely causing timeouts/misbehavior on 5-position devices. Consider validating against XLIGHT_EMISSION_FILTER_POSITIONS (or a device-specific max detected at runtime) and updating the error message accordingly so invalid configs fail fast.
- Use emission_filter_position directly from channel config instead of broken wavelength-to-position mapping - Only create emission/dichroic dropdown widgets when hardware supports them - Use sleep_time_for_wheel for serial communication delays - Add XLIGHT_EMISSION_FILTER_POSITIONS config (5 for Cicero, 8 for V3) - Improve serial response mismatch logging Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fe02c5f to
ad8eb51
Compare
Summary
emission_filter_positiondirectly from channel config instead of broken wavelength-to-position mappingsleep_time_for_wheelfor serial communication delays (fixes timeout errors)XLIGHT_EMISSION_FILTER_POSITIONSconfig (5 for Cicero, 8 for XLight V3)Test plan
🤖 Generated with Claude Code