Loading openflexure_microscope/camera/pi.py +4 −4 Original line number Diff line number Diff line Loading @@ -315,7 +315,7 @@ class PiCameraStreamer(BaseCamera): def start_preview(self, fullscreen=True, window=None): """Start the on board GPU camera preview.""" with self.lock(): with self.lock(timeout=1): try: if not self.camera.preview: logging.debug("Starting preview") Loading @@ -340,7 +340,7 @@ class PiCameraStreamer(BaseCamera): def stop_preview(self): """Stop the on board GPU camera preview.""" with self.lock(): with self.lock(timeout=1): if self.camera.preview: self.camera.stop_preview() self.preview_active = False Loading @@ -359,7 +359,7 @@ class PiCameraStreamer(BaseCamera): output_object (str/BytesIO): Target object. """ with self.lock: with self.lock(timeout=5): # Start recording method only if a current recording is not running if not self.record_active: Loading Loading @@ -388,7 +388,7 @@ class PiCameraStreamer(BaseCamera): def stop_recording(self): """Stop the last started video recording on splitter port 2.""" with self.lock: with self.lock(timeout=5): # Stop the camera video recording on port 2 logging.info("Stopping recording") self.camera.stop_recording(splitter_port=2) Loading openflexure_microscope/microscope.py +38 −42 Original line number Diff line number Diff line Loading @@ -189,9 +189,7 @@ class Microscope: Return: dict: Dictionary containing complete microscope state """ with self.lock: state = {"camera": self.camera.state, "stage": self.stage.state} return state return {"camera": self.camera.state, "stage": self.stage.state} def update_settings(self, settings: dict): """ Loading Loading @@ -242,7 +240,6 @@ class Microscope: "extensions": self.extension_settings, } with self.lock: # If attached to a camera if self.camera: settings_current_camera = self.camera.read_settings() Loading Loading @@ -274,7 +271,6 @@ class Microscope: self.settings_file.save(current_config, backup=True) def force_get_configuration(self): with self.lock: initial_configuration = self.configuration_file.load() current_configuration = { Loading openflexure_microscope/stage/sanga.py +1 −2 Original line number Diff line number Diff line Loading @@ -56,7 +56,6 @@ class SangaStage(BaseStage): @property def position(self): with self.lock(timeout=None): return self.board.position @property Loading Loading
openflexure_microscope/camera/pi.py +4 −4 Original line number Diff line number Diff line Loading @@ -315,7 +315,7 @@ class PiCameraStreamer(BaseCamera): def start_preview(self, fullscreen=True, window=None): """Start the on board GPU camera preview.""" with self.lock(): with self.lock(timeout=1): try: if not self.camera.preview: logging.debug("Starting preview") Loading @@ -340,7 +340,7 @@ class PiCameraStreamer(BaseCamera): def stop_preview(self): """Stop the on board GPU camera preview.""" with self.lock(): with self.lock(timeout=1): if self.camera.preview: self.camera.stop_preview() self.preview_active = False Loading @@ -359,7 +359,7 @@ class PiCameraStreamer(BaseCamera): output_object (str/BytesIO): Target object. """ with self.lock: with self.lock(timeout=5): # Start recording method only if a current recording is not running if not self.record_active: Loading Loading @@ -388,7 +388,7 @@ class PiCameraStreamer(BaseCamera): def stop_recording(self): """Stop the last started video recording on splitter port 2.""" with self.lock: with self.lock(timeout=5): # Stop the camera video recording on port 2 logging.info("Stopping recording") self.camera.stop_recording(splitter_port=2) Loading
openflexure_microscope/microscope.py +38 −42 Original line number Diff line number Diff line Loading @@ -189,9 +189,7 @@ class Microscope: Return: dict: Dictionary containing complete microscope state """ with self.lock: state = {"camera": self.camera.state, "stage": self.stage.state} return state return {"camera": self.camera.state, "stage": self.stage.state} def update_settings(self, settings: dict): """ Loading Loading @@ -242,7 +240,6 @@ class Microscope: "extensions": self.extension_settings, } with self.lock: # If attached to a camera if self.camera: settings_current_camera = self.camera.read_settings() Loading Loading @@ -274,7 +271,6 @@ class Microscope: self.settings_file.save(current_config, backup=True) def force_get_configuration(self): with self.lock: initial_configuration = self.configuration_file.load() current_configuration = { Loading
openflexure_microscope/stage/sanga.py +1 −2 Original line number Diff line number Diff line Loading @@ -56,7 +56,6 @@ class SangaStage(BaseStage): @property def position(self): with self.lock(timeout=None): return self.board.position @property Loading