Skip to content

Conversation

Alpaca233
Copy link
Collaborator

@Alpaca233 Alpaca233 commented Jun 17, 2025

Not tested with hardware yet.

This pull request introduces support for the VersaLase laser system, enhances hardware control capabilities, and refactors existing code for better modularity and clarity. Key changes include the addition of a new module for VersaLase laser integration, updates to configuration files, and adjustments to hardware initialization methods.

VersaLase Laser Integration:

  • software/control/lighting_versalase.py: Added a new module to handle VersaLase laser operations, including initialization, intensity control, shutter control, and laser channel management. This module uses the LaserSDK library to interact with the hardware.
  • software/control/gui_hcs.py: Updated the loadHardwareObjects method to initialize VersaLase lasers if USE_VORTRAN_LASER_USB_CONTROL is enabled. Added error handling for initialization failures.

Configuration Updates:

Refactoring:

  • software/control/gui_hcs.py and software/control/microscope.py: Replaced references to control.celesta with control.lighting_celesta for better modularity and consistency across light source integrations. [1] [2]

Documentation:

  • software/README.md: Added installation instructions for the VersaLase laser SDK, including steps to download, install, and clean up the SDK package.

@Alpaca233 Alpaca233 requested a review from Copilot June 17, 2025 09:08
Copy link
Contributor

@Copilot 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

This PR introduces support for a new laser system by adding a dedicated module for VersaLase laser integration, updating hardware initialization in the UI and microscope control layers, and adjusting configuration and documentation to support the new hardware.

  • New module (lighting_versalase.py) for VersaLase laser operations using LaserSDK
  • Updates in gui_hcs.py and microscope.py to initialize and integrate the new laser support
  • Configuration and documentation enhancements to guide installation and setup

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
software/control/microscope.py Refactored import and instantiation to use control.lighting_celesta
software/control/lighting_versalase.py Introduces laser integration with channel mapping and control methods
software/control/gui_hcs.py Adds initialization for VersaLase in hardware objects loading
software/control/_def.py Introduces new parameters for laser control (e.g., VORTRAN_SHUTTER_CONTROL_MODE)
software/configurations/configuration_Squid+_Kinetix_LDI_XLight_Xeryon.ini Adds new configuration parameter tube_lens_mm
software/README.md Adds instructions for installing the VersaLase laser SDK
Comments suppressed due to low confidence (3)

software/control/lighting_versalase.py:34

  • There is an inconsistency between the module/class name (VersaLase) and the error log text ('Vortran laser'). Standardize the naming across the module to avoid confusion.
self._log.error(f"Failed to initialize Vortran laser: {e}")

software/control/_def.py:617

  • The parameter name 'USE_VORTRAN_LASER_USB_CONTROL' uses 'Vortran', while the new laser module uses 'VersaLase'; consider standardizing the terminology in both configuration parameters and code to maintain clarity.
USE_VORTRAN_LASER_USB_CONTROL = False

software/control/lighting_versalase.py:49

  • The code maps a laser with wavelength 488 to channel 470 in addition to channel 488. Verify that mapping laser wavelengths to two channels is intentional and document the rationale in the code if so.
self.channel_mappings[470] = laser.id

mode: IntensityControlMode.Software or IntensityControlMode.External
"""
self._log.debug("Only software intensity control is supported for Vortran laser")
pass
Copy link

Copilot AI Jun 17, 2025

Choose a reason for hiding this comment

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

The set_intensity_control_mode method is not implemented and only contains a debug log and pass. Consider implementing the functionality or raising a NotImplementedError to clearly indicate that this mode is unsupported.

Suggested change
pass
raise NotImplementedError("Only software intensity control is supported for Vortran laser.")

Copilot uses AI. Check for mistakes.

@hongquanli
Copy link
Contributor

@Alpaca233 can you change lighting to illumination?

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