Ensure stream recording at start of fast_up_down_up_autofocus

This commit is contained in:
Joel Collins 2019-05-30 10:43:46 +01:00
parent 5d7fa03cbd
commit 70be245c2a

View file

@ -112,7 +112,10 @@ class AutofocusPlugin(MicroscopePlugin):
might slightly hurt accuracy, but is unlikely to be a big issue. Too big
may cause you to overshoot, which is a problem.
"""
with self.monitor_sharpness() as m:
with self.monitor_sharpness() as m, self.microscope.camera.lock:
# Ensure the MJPEG stream has started
self.microscope.camera.start_stream_recording()
df = dz #TODO: refactor so I actually use dz in the code below!
if initial_move_up:
m.focus_rel(df/2)