Loading openflexure_microscope/camera/base.py +2 −2 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class BaseCamera(metaclass=ABCMeta): self.thread = None self.camera = None self.lock = StrictLock(name="Camera", timeout=None) self.lock = StrictLock(name="Camera", timeout=1) self.frame = None self.last_access = 0 Loading Loading @@ -55,7 +55,7 @@ class BaseCamera(metaclass=ABCMeta): @abstractmethod def update_settings(self, config: dict): """Update settings from a config dictionary""" with self.lock: with self.lock(timeout=None): # Apply valid config params to camera object for key, value in config.items(): # For each provided setting if hasattr(self, key): # If the instance has a matching property Loading openflexure_microscope/camera/pi.py +3 −3 Original line number Diff line number Diff line Loading @@ -195,7 +195,7 @@ class PiCameraStreamer(BaseCamera): logging.debug("PiCameraStreamer: Applying config:") logging.debug(config) with self.lock: with self.lock(timeout=None): # Apply valid config params to Picamera object if not self.record_active: # If not recording a video Loading Loading @@ -301,7 +301,7 @@ class PiCameraStreamer(BaseCamera): """ Change the camera zoom, handling re-centering and scaling. """ with self.lock: with self.lock(timeout=None): self.zoom_value = float(zoom_value) if self.zoom_value < 1: self.zoom_value = 1 Loading Loading @@ -448,7 +448,7 @@ class PiCameraStreamer(BaseCamera): resolution ((int, int)): Resolution to set the camera to, before starting recording. Defaults to `self.stream_resolution`. """ with self.lock: with self.lock(timeout=None): # If stream object was destroyed if not hasattr(self, "stream"): self.stream = io.BytesIO() # Create a stream object Loading openflexure_microscope/stage/base.py +1 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ class BaseStage(metaclass=ABCMeta): """ def __init__(self): self.lock = StrictLock(name="Stage", timeout=5) self.lock = StrictLock(name="Stage", timeout=1) @abstractmethod def update_settings(self, config: dict): Loading openflexure_microscope/stage/sanga.py +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ class SangaStage(BaseStage): @property def position(self): with self.lock: with self.lock(timeout=None): return self.board.position @property Loading Loading
openflexure_microscope/camera/base.py +2 −2 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class BaseCamera(metaclass=ABCMeta): self.thread = None self.camera = None self.lock = StrictLock(name="Camera", timeout=None) self.lock = StrictLock(name="Camera", timeout=1) self.frame = None self.last_access = 0 Loading Loading @@ -55,7 +55,7 @@ class BaseCamera(metaclass=ABCMeta): @abstractmethod def update_settings(self, config: dict): """Update settings from a config dictionary""" with self.lock: with self.lock(timeout=None): # Apply valid config params to camera object for key, value in config.items(): # For each provided setting if hasattr(self, key): # If the instance has a matching property Loading
openflexure_microscope/camera/pi.py +3 −3 Original line number Diff line number Diff line Loading @@ -195,7 +195,7 @@ class PiCameraStreamer(BaseCamera): logging.debug("PiCameraStreamer: Applying config:") logging.debug(config) with self.lock: with self.lock(timeout=None): # Apply valid config params to Picamera object if not self.record_active: # If not recording a video Loading Loading @@ -301,7 +301,7 @@ class PiCameraStreamer(BaseCamera): """ Change the camera zoom, handling re-centering and scaling. """ with self.lock: with self.lock(timeout=None): self.zoom_value = float(zoom_value) if self.zoom_value < 1: self.zoom_value = 1 Loading Loading @@ -448,7 +448,7 @@ class PiCameraStreamer(BaseCamera): resolution ((int, int)): Resolution to set the camera to, before starting recording. Defaults to `self.stream_resolution`. """ with self.lock: with self.lock(timeout=None): # If stream object was destroyed if not hasattr(self, "stream"): self.stream = io.BytesIO() # Create a stream object Loading
openflexure_microscope/stage/base.py +1 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ class BaseStage(metaclass=ABCMeta): """ def __init__(self): self.lock = StrictLock(name="Stage", timeout=5) self.lock = StrictLock(name="Stage", timeout=1) @abstractmethod def update_settings(self, config: dict): Loading
openflexure_microscope/stage/sanga.py +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ class SangaStage(BaseStage): @property def position(self): with self.lock: with self.lock(timeout=None): return self.board.position @property Loading