From b5e6a43caa9d05d9852aa49a5f3d4798decaa98c Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Thu, 21 Mar 2019 15:48:22 +0000 Subject: [PATCH] Spinkled in some sleeps to fix #49 --- openflexure_microscope/camera/pi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openflexure_microscope/camera/pi.py b/openflexure_microscope/camera/pi.py index 650a931f..dad0878f 100644 --- a/openflexure_microscope/camera/pi.py +++ b/openflexure_microscope/camera/pi.py @@ -231,12 +231,14 @@ class StreamingCamera(BaseCamera): self.start_stream_recording() self.camera.start_preview(fullscreen=fullscreen, window=window) self.state['preview_active'] = True + time.sleep(0.2) return True def stop_preview(self) -> bool: """Stop the on board GPU camera preview.""" self.camera.stop_preview() self.state['preview_active'] = False + time.sleep(0.2) return True def start_recording( @@ -326,6 +328,7 @@ class StreamingCamera(BaseCamera): logging.info("Stopped MJPEG stream on port {1}. Switching to {0}.".format(resolution, splitter_port)) # Increase the resolution for taking an image + time.sleep(0.2) # Sprinkled a sleep to prevent camera getting confused by rapid commands self.camera.resolution = resolution def start_stream_recording(