From 3e4b1750ae98ae01284e3e9609b0db054af1a199 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Thu, 29 Nov 2018 18:09:11 +0000 Subject: [PATCH] API now loads config and lens shading table --- openflexure_microscope/api/v1.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openflexure_microscope/api/v1.py b/openflexure_microscope/api/v1.py index f9018a64..1689c4c0 100644 --- a/openflexure_microscope/api/v1.py +++ b/openflexure_microscope/api/v1.py @@ -21,7 +21,7 @@ from werkzeug.exceptions import default_exceptions from openflexure_microscope.api.utilities import parse_payload, get_from_payload, gen, get_bool -from openflexure_microscope import Microscope +from openflexure_microscope import Microscope, config from openflexure_microscope.camera.pi import StreamingCamera from openflexure_stage import OpenFlexureStage @@ -69,8 +69,10 @@ def attach_microscope(): # Create the microscope object globally (common to all spawned server threads) global api_microscope logging.debug("First request made. Populating microscope with hardware...") + openflexurerc = config.load_config() # Load default user config + api_microscope.attach( - StreamingCamera(), + StreamingCamera(config=openflexurerc), OpenFlexureStage("/dev/ttyUSB0") ) logging.debug("Microscope successfully attached!")