From 25d3b15d4eb8f2e4656cbc943b8cdc2867ad9205 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Sun, 22 Nov 2020 16:12:04 +0000 Subject: [PATCH] Fixed camera settings read --- openflexure_microscope/camera/mock.py | 16 ++++++---------- openflexure_microscope/camera/pi.py | 23 ++++++++--------------- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/openflexure_microscope/camera/mock.py b/openflexure_microscope/camera/mock.py index 4dfc976a..aa49c04c 100644 --- a/openflexure_microscope/camera/mock.py +++ b/openflexure_microscope/camera/mock.py @@ -136,17 +136,13 @@ class MissingCamera(BaseCamera): """ # Get config items from the base class - conf_dict = BaseCamera.read_settings(self) + conf_dict = { + "stream_resolution": self.stream_resolution, + "image_resolution": self.image_resolution, + "numpy_resolution": self.numpy_resolution, + "jpeg_quality": self.jpeg_quality, + } - # Include device-specific config items - conf_dict.update( - { - "stream_resolution": self.stream_resolution, - "image_resolution": self.image_resolution, - "numpy_resolution": self.numpy_resolution, - "jpeg_quality": self.jpeg_quality, - } - ) return conf_dict diff --git a/openflexure_microscope/camera/pi.py b/openflexure_microscope/camera/pi.py index 523267d2..a7546c10 100644 --- a/openflexure_microscope/camera/pi.py +++ b/openflexure_microscope/camera/pi.py @@ -127,21 +127,14 @@ class PiCameraStreamer(BaseCamera): """ Return config dictionary of the PiCameraStreamer. """ - - # Get config items from the base class - conf_dict = BaseCamera.read_settings(self) - - # Include device-specific config items - conf_dict.update( - { - "stream_resolution": self.stream_resolution, - "image_resolution": self.image_resolution, - "numpy_resolution": self.numpy_resolution, - "jpeg_quality": self.jpeg_quality, - "mjpeg_quality": self.mjpeg_quality, - "picamera": {}, - } - ) + conf_dict = { + "stream_resolution": self.stream_resolution, + "image_resolution": self.image_resolution, + "numpy_resolution": self.numpy_resolution, + "jpeg_quality": self.jpeg_quality, + "mjpeg_quality": self.mjpeg_quality, + "picamera": {}, + } # Include a subset of picamera properties. Excludes lens shading table for key in PiCameraStreamer.picamera_settings_keys: