AllenNeuralDynamics / spim-core

common features shared across Allen Institute SPIM systems
MIT License
0 stars 1 forks source link

Dev/joystick mapping and lockout #11

Closed Poofjunior closed 1 year ago

Poofjunior commented 1 year ago

Adding joystick lockout at the sample pose level.

This is implemented via context manager. All you need to do is decorate the lowest-level function that you want to lockout with this decorator:

from spim_core.spim_base import lock_external_user_input

@lock_external_user_input
def collect_volumetric_imate(stuff):
    # stuff here...

And it will lock the joystick before the function runs and then release it afterwards.

Testing

Works in simulation! At the acquisition start, you should see: Screenshot from 2023-03-09 14-53-28 At the end, you should see: Screenshot from 2023-03-09 14-52-47