From 92ac947982fca631d195db1d969b58b50378c47d Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Wed, 30 Jan 2019 18:23:40 +0000 Subject: [PATCH] Demoted missing attribute warning to debug --- openflexure_microscope/camera/pi.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/openflexure_microscope/camera/pi.py b/openflexure_microscope/camera/pi.py index 74571538..38744c2b 100644 --- a/openflexure_microscope/camera/pi.py +++ b/openflexure_microscope/camera/pi.py @@ -162,7 +162,7 @@ class StreamingCamera(BaseCamera): value = fractions_to_floats(value) conf_dict['picamera_settings'][key] = value except AttributeError: - logging.warning("Unable to read PiCamera attribute {}".format(key)) + logging.debug("Unable to read PiCamera attribute {}".format(key)) # StreamingCamera parameters (obtained from StreamingCamera _config) for key in CONFIG_KEYS: @@ -204,7 +204,14 @@ class StreamingCamera(BaseCamera): for key, value in config['picamera_settings'].items(): # For each given setting self._config['picamera_settings'][key] = None # Add the key to the list of returned settings logging.debug("Setting parameter {}: {}".format(key, config['picamera_settings'][key])) - setattr(self.camera, key, value) # Write setting to camera + + # Handle special attributes: + if key == 'digital_gain': + set_digital_gain(self.camera, value) + elif key == 'analog_gain': + set_analog_gain(self.camera, value) + else: + setattr(self.camera, key, value) # Write setting to camera # StreamingCamera parameters (applied via StreamingCamera config) for key, value in config.items(): # For each provided setting