microscope mode selection: do it directly, and only use signals for ui updates #241
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theLiveControlWidget
is changed so that it callsLiveController.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 usingQtThread.yieldCurrentThread
andQtThread.usleep
- I am missing something here!). Note thatQtApplication.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.