Skip to content

microscope mode selection: do it directly, and only use signals for ui updates #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2025

Conversation

ianohara
Copy link
Collaborator

This is not a totally complete "decouple the ui" PR, but is a stepping stone to get there. Before, we used MultiPointWorker.signal_current_configuration -> MultiPointController.signal_current_configuration -> LiveControlWidget.set_microscope_mode -> dropdown text change signal -> update mode from name -> LiveController.set_microscope_mode to update the hardware settings for each acquisition frame. This was a lot of qt machinery to work through!

Instead, this directly calls LiveController.set_microscope_mode and separately signals updating the ui. And the LiveControlWidget is changed so that it calls LiveController.set_microscope_mode only when a new user selected value is triggered (and otherwise, only updates the ui).

This would be better without the BlockingQueuedConnection, but if we do that then the main event loop is not processing events (even with me using QtThread.yieldCurrentThread and QtThread.usleep - I am missing something here!). Note that QtApplication.processEvents only processes the current thread's events, so that doesn't help us.

Tested by: Running some local acquisitions, unit tests, and still needs HW testing.

@ianohara ianohara force-pushed the ian/illum-ui-async branch 3 times, most recently from 6713f7d to 077c995 Compare May 27, 2025 01:10
@ianohara ianohara changed the base branch from master to ian/timing-tool May 27, 2025 01:12
@ianohara ianohara force-pushed the ian/illum-ui-async branch from 077c995 to 434e76f Compare May 31, 2025 17:45
@ianohara ianohara force-pushed the ian/illum-ui-async branch from 434e76f to 8c269ae Compare May 31, 2025 22:19
@ianohara ianohara changed the base branch from ian/timing-tool to master May 31, 2025 22:19
@ianohara ianohara merged commit c5eb6f0 into master May 31, 2025
3 checks passed
@ianohara
Copy link
Collaborator Author

This was tested on HW, sorry for not updating the desc.

@ianohara ianohara deleted the ian/illum-ui-async branch May 31, 2025 22:32
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