-
Notifications
You must be signed in to change notification settings - Fork 39
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
stage: integrate into the system (replace NavigationController) #48
Conversation
software/control/core/core.py
Outdated
@@ -1610,1207 +1311,23 @@ def add_current_coords_to_focus_map(self): | |||
self.focus_map_coords.append((x,y,z)) | |||
print(f"Added triple ({x},{y},{z}) to focus map") | |||
|
|||
|
|||
class MultiPointWorker(QObject): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might make sense to move this back from core.multipoint.py just so we can see what actually changed, and then break core.py apart into pieces in multiple subsequent pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it’s time to make this independent of pyqt (remove dependence on signaling, for example for updating the illumination and channel settings)?
@@ -3785,122 +2285,6 @@ def scale_contrast_limits(self, target_dtype): | |||
self.acquisition_dtype = target_dtype | |||
|
|||
|
|||
class PlateReaderNavigationController(QObject): # Not implemented for Prior stage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was unused. ag PlateReaderNavigationController
only showed this occurence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this obsolete and can be deleted.
# update the displacement measurement | ||
self.measure_displacement() | ||
|
||
def set_reference(self): | ||
# turn on the laser | ||
self.microcontroller.turn_on_AF_laser() | ||
self.wait_till_operation_is_completed() | ||
self.microcontroller.wait_till_operation_is_completed() | ||
# get laser spot location | ||
x,y = self._get_laser_spot_centroid() | ||
# turn off the laser | ||
self.microcontroller.turn_off_AF_laser() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add the wait back here.
@@ -1,216 +0,0 @@ | |||
# set QT_API environment variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was very broken, so delete it for now. We can restore it later.
software/control/gui_hcs.py
Outdated
self.navigationController.signal_joystick_button_pressed.connect(self.trackingControlWidget.slot_joystick_button_pressed) | ||
else: | ||
self.navigationController.signal_joystick_button_pressed.connect(self.autofocusController.autofocus) | ||
# TODO(imo): Fix joystick after removal of navigation controller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This TODO needs to be addressed before merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the joystick buttons are not implemented in the firmware. Previously joystick is connected directly to the microcontroller (arduino). Now it’s joystick -> teensy lc -> teensy 4.1 -> computer.
software/control/gui_malaria.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was broken already, so removing it for now. We can restore + fix it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this. The malaria “app” is now in Heguang’s repo.
@@ -591,6 +591,11 @@ def analog_write_onboard_DAC(self,dac,value): | |||
cmd[4] = value & 0xff | |||
self.send_command(cmd) | |||
|
|||
def set_piezo_um(self, z_piezo_um): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably makes sense to move this here since it requires intricate knowledge of the micro dac setup. An alternative would be to figure out how to have AbstractStage
handle this (eg: in its Z axis)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we’ll need to think about how to deal with the different z stage options: stepper alone, stepper + piezo, direct drive stage alone (Dover Motion DOF-5 or PI V-308), piezo alone.
software/control/navigation_prior.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @hongquanli said this actually needs to work, but hopefully the way we'd do it is to just use a PriorStage
instead of CephlaStage
(and then everything should just work).
The only caveat is populating any special controls for the CephlaStage
and PriorStage
in the ui. For that, I think we are stuck doing isinstance
checks for now.
self.add_components() | ||
self.setFrameStyle(QFrame.Panel | QFrame.Raised) | ||
|
||
self.position_update_timer = QTimer() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one way to do position updates. It is nice because we only need to pass in pieces of the future Microscope
API, and otherwise the widgets can be independent of each other.
An alternative, if we don't like the Timer/polling approach, is to define a standard collection of Signal
that any Widget can assume exists and pass them as an init argument. Then each Widget can just connect itself to any of those signals if needed at init time, but doesn't need to be passed the entire machinery behind other Widgets.
093d1b7
to
52ee495
Compare
00ef16c
to
359951c
Compare
This is starting work on the "X, Y, Z Motion stage" task in https://www.notion.so/cephla/Headless-Mode-and-Scripting-Design-1452dfbf6ae480c3b444ee0847f532a5 . This adds the `AbstractStage` concept, and implements the `CephlaStage`. It also adds basic simulated stage tests. See #48 for integration of this into the system.
…and use stage everywhere
28e28d6
to
7a18115
Compare
…ration Feature/napari integration
This replaces
NavigationController
withAbstractStage
, and starts pulling apart the different pieces that depended on signals from afar in various pieces.Still To Do: