Added a kludgy extensions settings dictionary.
This commit is contained in:
parent
e452d623ca
commit
d915625113
1 changed files with 9 additions and 1 deletions
|
|
@ -40,6 +40,8 @@ class Microscope:
|
||||||
self.settings_file = settings
|
self.settings_file = settings
|
||||||
self.configuration_file = configuration
|
self.configuration_file = configuration
|
||||||
|
|
||||||
|
self.extension_settings = {}
|
||||||
|
|
||||||
# Initialise with an empty composite lock
|
# Initialise with an empty composite lock
|
||||||
#: :py:class:`labthings.lock.CompositeLock`: Composite lock for locking both camera and stage
|
#: :py:class:`labthings.lock.CompositeLock`: Composite lock for locking both camera and stage
|
||||||
self.lock = CompositeLock([])
|
self.lock = CompositeLock([])
|
||||||
|
|
@ -157,6 +159,12 @@ class Microscope:
|
||||||
if "fov" in settings:
|
if "fov" in settings:
|
||||||
self.fov = settings["fov"]
|
self.fov = settings["fov"]
|
||||||
|
|
||||||
|
# Extension settings
|
||||||
|
if "extensions" in settings:
|
||||||
|
self.extension_settings.update(settings["extensions"])
|
||||||
|
|
||||||
|
# TODO: warn if there are settings that we silently ignore
|
||||||
|
|
||||||
def read_settings(self, full: bool = True):
|
def read_settings(self, full: bool = True):
|
||||||
"""
|
"""
|
||||||
Get an updated settings dictionary.
|
Get an updated settings dictionary.
|
||||||
|
|
@ -168,7 +176,7 @@ class Microscope:
|
||||||
don't get removed from the settings file.
|
don't get removed from the settings file.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
settings_current = {"id": self.id, "name": self.name, "fov": self.fov}
|
settings_current = {"id": self.id, "name": self.name, "fov": self.fov, "extensions": self.extension_settings}
|
||||||
|
|
||||||
# If attached to a camera
|
# If attached to a camera
|
||||||
if self.camera:
|
if self.camera:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue