python-microscope / microscope

Python library for control of microscope devices, supporting hardware triggers and distribution of devices over the network for performance and flexibility.
https://www.python-microscope.org
GNU General Public License v3.0
69 stars 41 forks source link

alpao mirror - `apply_pattern` does not check if trigger type is software #61

Closed carandraug closed 4 years ago

carandraug commented 6 years ago

The apply pattern in the alpao mirror only works in software trigger mode. However, it does not check for this and will happily send patterns which then never get applied.

The method should check the current trigger type, change it to software, send and apply the pattern, then revert to the previous state. If there are any patterns queued, this will empty the queue. This should also be documented on the abstract class.

The BMC mirror may suffer of the same issue.

carandraug commented 4 years ago

I thought better about it. Since changing trigger type behind the scenes means that previous queued patterns get destroyed, it's better to not do it automatically, and instead require that the user does it explicitly.

Fixed with 9f6ffca53580b7ace1e which adds a check on DeformableMirror.apply_pattern for trigger type, thus fixing it for all other deformable mirrors. Closing as fixed.