Commit 70be245c authored by Joel Collins's avatar Joel Collins
Browse files

Ensure stream recording at start of fast_up_down_up_autofocus

parent 5d7fa03c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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)