API now loads config and lens shading table
This commit is contained in:
parent
2cf025088b
commit
3e4b1750ae
1 changed files with 4 additions and 2 deletions
|
|
@ -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.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_microscope.camera.pi import StreamingCamera
|
||||||
from openflexure_stage import OpenFlexureStage
|
from openflexure_stage import OpenFlexureStage
|
||||||
|
|
||||||
|
|
@ -69,8 +69,10 @@ def attach_microscope():
|
||||||
# Create the microscope object globally (common to all spawned server threads)
|
# Create the microscope object globally (common to all spawned server threads)
|
||||||
global api_microscope
|
global api_microscope
|
||||||
logging.debug("First request made. Populating microscope with hardware...")
|
logging.debug("First request made. Populating microscope with hardware...")
|
||||||
|
openflexurerc = config.load_config() # Load default user config
|
||||||
|
|
||||||
api_microscope.attach(
|
api_microscope.attach(
|
||||||
StreamingCamera(),
|
StreamingCamera(config=openflexurerc),
|
||||||
OpenFlexureStage("/dev/ttyUSB0")
|
OpenFlexureStage("/dev/ttyUSB0")
|
||||||
)
|
)
|
||||||
logging.debug("Microscope successfully attached!")
|
logging.debug("Microscope successfully attached!")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue