Skip to content

Patch switching drive in MGWidget - #215

Merged
rocco8773 merged 18 commits into
mainfrom
patch_drive_switching_in_mgwidget
Jul 30, 2026
Merged

Patch switching drive in MGWidget#215
rocco8773 merged 18 commits into
mainfrom
patch_drive_switching_in_mgwidget

Conversation

@rocco8773

@rocco8773 rocco8773 commented Jul 28, 2026

Copy link
Copy Markdown
Member

Mechanics around the drive drop-down menu are not behaving as expected:

  1. An invalid drive configuration is still displaying a blue "ok" gear icon.
  2. Selecting a new drive in the drop-down menu causes the LostConnectionDialog to popup, which makes the drive change glitch.

This PR addresses both issues.


  • Added kwarg disconnect_signals to EventActor.terminate and all its sub-classes. The default value is False. This allows for actors who utilize signals to disconnect (or not) its signals during termination.
  • Updated Motor.terminate to always block signals when terminated, but only disconnect signals if disconnect_signals = True.
  • Added methods to MotorSignals:
    • set_blocking : block or unblock all SimpleSignal's
    • disconnect : disconnect specified callback from all SimpleSignal's
    • disconnect_all : disconnect all callbacks from all SimpleSignal's
  • In the configure GUI framework explicitly specify disconnect_signals for all uses of .terminate().
  • DriveBaseController have _drive_connection_established and _drive_connection_lost emit teh driveStatusChanged signal. This allows for connection lost and established to be communicated up to the MGWidget.
  • Re-worked DriveConfigOverlay._validate_drive() so the validate button will attempt to restart an axis if its TCP connection is NOT currently established. This was done, since before the only way to reestablish a motor connection was to edit the IP address field. Even if the current IP address is correct.
  • MGWidget : Created @Slot _handle_drive_status_changed which is connected to the driveStatusChanged signal. This is done so the GUI can be updated when a motor connection is lost or established, as well as communicating an update of the drive position in the display.
    • If a connection is lost, then the done button will be disabled and the gear icon will turn red (and have a tooltip indicating with IPs were lost).
  • MGWidget : Crated (and implemented) method _terminate_mg to handle terminating the attached motion group.
  • MGWidget : Updated _validate_drive to handle with a drive loses (or establishes) a TCP connection. Before it only handled if a drive was terminated. If a connection is lost, then the drive gear icon will turn back to read and have a tooltip indicating which axes were lost.

@rocco8773
rocco8773 marked this pull request as ready for review July 30, 2026 00:09
@rocco8773
rocco8773 merged commit b8cfe4b into main Jul 30, 2026
17 checks passed
@github-project-automation github-project-automation Bot moved this from Tasks to Done in BaPSF Motion Jul 30, 2026
@rocco8773
rocco8773 deleted the patch_drive_switching_in_mgwidget branch July 30, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant