From bc9b80d11a112549f2b1e27aadbae39e74c09272 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Tue, 1 Dec 2020 17:10:25 +0000 Subject: [PATCH] Added start_worker and get_frame for compatibility --- openflexure_microscope/camera/base.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/openflexure_microscope/camera/base.py b/openflexure_microscope/camera/base.py index 0251b5c2..126d3070 100644 --- a/openflexure_microscope/camera/base.py +++ b/openflexure_microscope/camera/base.py @@ -170,6 +170,20 @@ class BaseCamera(metaclass=ABCMeta): thumbnail: Dimensions and quality (x, y, quality) of a thumbnail to generate, if supported """ + def start_worker(self, **_) -> bool: + """Start the background camera thread if it isn't running yet.""" + logging.debug( + "`start_worker` method has been deprecated and is no longer required. Please avoid calling this method." + ) + return True + + def get_frame(self): + """Return the current camera frame.""" + logging.debug( + "`camera.get_frame` method has been deprecated. Please use `camera.stream.getframe()." + ) + return self.stream.getframe() + def __enter__(self): """Create camera on context enter.""" return self