From 4c5728b182857d019ad0057699fbc0b675fe8ff0 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Tue, 8 Jan 2019 15:59:47 +0000 Subject: [PATCH] Updated docstrings and todo --- openflexure_microscope/camera/base.py | 21 ++++++++++++++++++--- openflexure_microscope/camera/capture.py | 2 +- openflexure_microscope/camera/pi.py | 2 ++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/openflexure_microscope/camera/base.py b/openflexure_microscope/camera/base.py index 364cf770..944482e6 100644 --- a/openflexure_microscope/camera/base.py +++ b/openflexure_microscope/camera/base.py @@ -234,7 +234,15 @@ class BaseCamera(object): fmt: str='jpeg', shunt_others: bool=True): - """Add a new capture to the image list, and shunt all others.""" + """ + Create a new image capture object. Adds to the image list, and shunt all others. + + Args: + write_to_file (bool): Should the StreamObject write to a file, or an in-memory byte stream. + keep_on_disk (bool): Should the data be kept on disk after session ends. Creating the capture with a content manager sets this to false. + filename (str): Name of the stored file. Defaults to timestamp. + fmt (str): Format of the capture. + """ if not filename: filename = self.generate_basename(self.images) @@ -258,10 +266,17 @@ class BaseCamera(object): keep_on_disk: bool=True, filename: str=None, fmt: str='h264', - quality: int=15, shunt_others: bool=True): - """Add a new capture to the video list, and shunt all others.""" + """ + Create a new video capture object. Adds to the image list, and shunt all others. + + Args: + write_to_file (bool): Should the StreamObject write to a file, or an in-memory byte stream. + keep_on_disk (bool): Should the data be kept on disk after session ends. Creating the capture with a content manager sets this to false. + filename (str): Name of the stored file. Defaults to timestamp. + fmt (str): Format of the capture. + """ if not filename: filename = self.generate_basename(self.videos) diff --git a/openflexure_microscope/camera/capture.py b/openflexure_microscope/camera/capture.py index d34775f6..1a8f4b8b 100644 --- a/openflexure_microscope/camera/capture.py +++ b/openflexure_microscope/camera/capture.py @@ -26,7 +26,7 @@ class CaptureObject(object): folder: str='', fmt: str='') -> None: """Create a new StreamObject, to manage capture data.""" - + # Store a nice ID self.id = uuid.uuid4().hex logging.info("Created StreamObject {}".format(self.id)) diff --git a/openflexure_microscope/camera/pi.py b/openflexure_microscope/camera/pi.py index ac4fcf5c..2a5b58b9 100644 --- a/openflexure_microscope/camera/pi.py +++ b/openflexure_microscope/camera/pi.py @@ -418,6 +418,8 @@ class StreamingCamera(BaseCamera): logging.info("Capturing to {}".format(output)) + + # TODO: Do we really always want bayer data for full captures? if not use_video_port: # Pause video splitter port 1