From d915625113aab6423c4f294391c815e6ee4a3f9b Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Thu, 12 Mar 2020 16:43:18 +0000 Subject: [PATCH] Added a kludgy extensions settings dictionary. --- openflexure_microscope/microscope.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openflexure_microscope/microscope.py b/openflexure_microscope/microscope.py index 3ed73568..f3e45650 100644 --- a/openflexure_microscope/microscope.py +++ b/openflexure_microscope/microscope.py @@ -40,6 +40,8 @@ class Microscope: self.settings_file = settings self.configuration_file = configuration + self.extension_settings = {} + # Initialise with an empty composite lock #: :py:class:`labthings.lock.CompositeLock`: Composite lock for locking both camera and stage self.lock = CompositeLock([]) @@ -157,6 +159,12 @@ class Microscope: if "fov" in settings: 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): """ Get an updated settings dictionary. @@ -168,7 +176,7 @@ class Microscope: 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 self.camera: