Skip to content

Patch Re-Validation when MGWidget returns an overlay configuration - #216

Merged
rocco8773 merged 9 commits into
mainfrom
patch_mgwidget_overlay_re-validation
Aug 3, 2026
Merged

Patch Re-Validation when MGWidget returns an overlay configuration#216
rocco8773 merged 9 commits into
mainfrom
patch_mgwidget_overlay_re-validation

Conversation

@rocco8773

@rocco8773 rocco8773 commented Aug 3, 2026

Copy link
Copy Markdown
Member

Yhoshua was experiencing a bug where the MGWidget would not fully enable itself after configurating a motion builder. I [@rocco8773] have not been able to duplicate this one my Windows 10 development setup. The Motion PC is a Windows 11 setup.

However, I did notice that when returning from a drive configuration we were being seeded into an infinite signal loop (see below)

|-> MGWidget._handle_drive_overlay()
|   |-> MGWidget._change_drive
|   |-> MGWidget._refresh_drive_control
|   |
|   |   |-> |-> MGWidget.configChanged.emit()
|   |   |   |   |-> MGWidget._config_changed_handler()
|   |   |   |   |-> MGWidget._update_drive_control_widget()
|   |-> |   |   |-> MGWidget._refresh_drive_control()
|   |   |   |   |-> DriveControlWidget.link_motion_group()
|   |   |   |   |-> DriveControlWidget.update_controller_displays()
|   |   |   |   |-> DriveBaseController.update_all_displays()
|   |   |   |   |-> DriveBaseController.driveStatusChanged.emit()
|   |   |   |   |-> DriveControlWidget._handle_controller_drive_status_changed()
|   |   |   |   |-> DriveControlWidget.driveStatusChanged.emit()
|   |   |   |   |-> MGWidget._handle_drive_status_changed()
|   |   |   |   |-> MGWidget.configChanged.emit()
|   |   |<- | <-|   # If the drive is valid and the done button is not enabled.

Since I could not reproduce Yhoshua's error case, I can not confirm is signal-loop was causing it. However, it does have the potential to do so.

To mitigate this infinite signal loop two things were done:

  1. DriveControlWidget.update_controller_displays() was given the block kwarg to block any signals from DriveBaseController. Thus, preventing the DriveBaseController.driveStatusChanged signal from being emitted. This is only done when update_controller_display() is called from withing DriveControlWidget.link_motion_group().
  2. When linking a motion group that is already linked, then link_motion_group() will just return. Also, breaking the signal-loop.

  • Replace several is None conditionals with isinstance().
  • Update a few if-clause so there is no cases with pass.
  • DriveBaseController.link_motion_group : unlink motion group and return if the given motion group is invalid.
  • DriveControlWidget.update_controller_displays() : add kwarg block so we can block DriveBaseController signals.
  • DriveControlWidget.link_motion_group() use block when executing update_controller_displays().

@rocco8773 rocco8773 changed the title Patch Re- Patch Re-Validation when MGWidget returns an overlay configuration Aug 3, 2026
@rocco8773
rocco8773 marked this pull request as ready for review August 3, 2026 23:00
@rocco8773
rocco8773 merged commit 9641ae8 into main Aug 3, 2026
17 checks passed
@github-project-automation github-project-automation Bot moved this from Tasks to Done in BaPSF Motion Aug 3, 2026
@rocco8773
rocco8773 deleted the patch_mgwidget_overlay_re-validation branch August 3, 2026 23:00
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