From 3467fe7759501f2a68b405623e32fc51894b62ba Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Thu, 8 Aug 2019 10:14:57 +0100 Subject: [PATCH 1/3] Added extra type checking when applying pi camera config --- openflexure_microscope/api/v1/blueprints/base.py | 3 ++- openflexure_microscope/camera/pi.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openflexure_microscope/api/v1/blueprints/base.py b/openflexure_microscope/api/v1/blueprints/base.py index 924d7631..3ef923ca 100644 --- a/openflexure_microscope/api/v1/blueprints/base.py +++ b/openflexure_microscope/api/v1/blueprints/base.py @@ -205,7 +205,8 @@ class ConfigAPI(MicroscopeView): """ payload = JsonPayload(request) - logging.debug("Updating settings from POST request.") + logging.debug("Updating settings from POST request:") + logging.debug(payload.json) self.microscope.apply_config(payload.json) self.microscope.save_config() diff --git a/openflexure_microscope/camera/pi.py b/openflexure_microscope/camera/pi.py index ee4d53ee..cf2d70c6 100644 --- a/openflexure_microscope/camera/pi.py +++ b/openflexure_microscope/camera/pi.py @@ -173,15 +173,15 @@ class PiCameraStreamer(BaseCamera): # Apply gains and let them settle if 'analog_gain' in settings_dict: logging.debug("Applying analog_gain: {}".format(settings_dict['analog_gain'])) - set_analog_gain(self.camera, settings_dict['analog_gain']) + set_analog_gain(self.camera, float(settings_dict['analog_gain'])) if 'digital_gain' in settings_dict: logging.debug("Applying digital_gain: {}".format(settings_dict['digital_gain'])) - set_digital_gain(self.camera, settings_dict['digital_gain']) + set_digital_gain(self.camera, float(settings_dict['digital_gain'])) # Apply shutter speed if 'shutter_speed' in settings_dict: logging.debug("Applying shutter_speed: {}".format(settings_dict['shutter_speed'])) - self.camera.shutter_speed = settings_dict['shutter_speed'] + self.camera.shutter_speed = int(settings_dict['shutter_speed']) time.sleep(0.2) # Let gains settle From e603b34267203f17eda792fd26f43644c8c12914 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Thu, 8 Aug 2019 10:41:44 +0100 Subject: [PATCH 2/3] Added extra docs --- openflexure_microscope/api/v1/blueprints/plugins.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openflexure_microscope/api/v1/blueprints/plugins.py b/openflexure_microscope/api/v1/blueprints/plugins.py index 9c32dacd..ff7b1183 100644 --- a/openflexure_microscope/api/v1/blueprints/plugins.py +++ b/openflexure_microscope/api/v1/blueprints/plugins.py @@ -13,6 +13,12 @@ class PluginSchemaAPI(MicroscopeView): .. :quickref: Plugin; Get schemas + Returns an array of present plugin schemas (describing plugin user interfaces.) + Please note, this is *not* a list of all enabled plugins, only those with associated + user interface forms. + + A complete list of enabled plugins can be found in the microscope state. + """ out = self.microscope.plugin.schemas return jsonify(out) From d13341dd5b7c2f26f159e9b14512eb7d4d20efc5 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Thu, 8 Aug 2019 11:06:53 +0100 Subject: [PATCH 3/3] Iterated version number --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a343d425..4b16704a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api" [tool.poetry] name = "openflexure_microscope" -version = "1.1.1" +version = "1.1.2" description = "Python module, and Flask-based web API, to run the OpenFlexure Microscope." authors = [