Skip to content

Comments

Updates to floco recovery and more#416

Open
vshekar wants to merge 12 commits intoNSLS2:masterfrom
vshekar:updates-to-floco-recovery
Open

Updates to floco recovery and more#416
vshekar wants to merge 12 commits intoNSLS2:masterfrom
vshekar:updates-to-floco-recovery

Conversation

@vshekar
Copy link
Collaborator

@vshekar vshekar commented Dec 30, 2025

The main changes include a major refactor and expansion of the recovery logic, new GUI signals and callbacks for real-time updates, and improved communication of system state changes to the client. Below are the most important changes grouped by theme:

Recovery Procedure Enhancements:

  • Refactored and expanded the run_recovery_procedure in daq_macros.py to include more granular steps, improved error handling, and detailed logging with color-coded terminal output. Added new checks (e.g., gonio status), and separated stop/continue operation logic with more descriptive steps. Also, introduced new robot and gripper recovery methods in embl_robot.py for the floco workflow. [1] [2] [3] [4]
  • Renamed flocoStopOperations and flocoContinueOperations to floco_stop_operations and floco_continue_operations in daq_lib.py.

Backend–Frontend Synchronization & Communication:

  • Added JSON-based messaging from backend (daq_macros.py) to frontend GUI for key state changes (e.g., robot online, mount enabled), and extended popupServerMessage in gui/control_main.py to parse and react to these commands, updating GUI checkboxes and widgets accordingly. [1] [2] [3]
  • Introduced new control functions for toggling queue collection and unmount cold checks, and exposed them to the main DAQ command list. [1] [2]

GUI Real-Time Feedback and Usability Improvements:

  • Added new Qt signals and callbacks in gui/control_main.py to react to governor state and dewar plate position changes, updating the camera view and status bar widgets in real time. Status bar styling and initialization were improved for clarity. [1] [2] [3] [4]
  • Updated staff screen dialog checkboxes to use .clicked instead of .stateChanged for more reliable interaction, and improved their initialization logic.

Camera and Video Improvements:

  • Modified camera thread initialization to explicitly set video resolution for hutch cameras, improving performance and consistency in the sample tab.

Minor Fixes and Refactoring:

  • Updated references and docstrings throughout the codebase to reflect new function names and improved clarity. [1] [2]

Copy link

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 pull request refactors the DAQ control and recovery system to improve error handling, GUI-server synchronization, and code maintainability. The changes introduce specialized recovery procedures for floco operations, a new checkbox toggle pattern for GUI controls, enhanced status monitoring with real-time updates, and improved logging with color-coded output.

  • Enhanced recovery procedures with detailed logging, additional validation checks, and specialized floco-specific robot recovery functions
  • Refactored GUI checkbox callbacks to use a centralized toggle handler that communicates with the server instead of directly modifying configuration
  • Implemented server-to-GUI broadcast system for synchronizing robot, mount, beam check, and queue collect states via JSON messages

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
robot_lib.py Adds wrapper functions for specialized floco recovery and gripper drying operations
gui/dialog/staff_screen.py Refactors checkbox callbacks to use generic toggle handler and server communication pattern
gui/control_main.py Implements server command processing, adds status widgets for queue collect and dewar plate position, and connects new signals for state changes
embl_robot.py Introduces specialized recovery methods that raise exceptions on fatal errors for improved error propagation
daq_main_common.py Expands the server function whitelist to include new toggle functions for various system states
daq_macros.py Enhances recovery procedure with color-coded logging, additional validation checks, and GUI broadcast messages for state synchronization
daq_lib.py Renames functions to snake_case convention (floco_stop_operations, floco_continue_operations)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

vshekar and others added 7 commits December 30, 2025 17:07
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.

Comments suppressed due to low confidence (2)

gui/dialog/staff_screen.py:297

  • This callback now receives a boolean value (True/False) from the clicked signal, not QtCore.Qt.Checked/Unchecked enum values. The condition should be changed to if state: and else: to match the boolean input, similar to the enableMountCheckCB implementation.
    def set_energy_check_cb(self, state):
        if state == QtCore.Qt.Checked:
            setBlConfig(SET_ENERGY_CHECK, 1)
            logger.debug(f"{SET_ENERGY_CHECK} on")
        else:
            setBlConfig(SET_ENERGY_CHECK, 0)
            logger.debug(f"{SET_ENERGY_CHECK} off")

gui/dialog/staff_screen.py:310

  • This callback now receives a boolean value (True/False) from the clicked signal, not QtCore.Qt.Checked/Unchecked enum values. The condition should be changed to if state: and else: to match the boolean input.
    def topViewOnCheckCB(self, state):
        if state == QtCore.Qt.Checked:
            setBlConfig(TOP_VIEW_CHECK, 1)
        else:
            setBlConfig(TOP_VIEW_CHECK, 0)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vshekar vshekar requested a review from JunAishima December 31, 2025 20:38
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.

1 participant