Commit d9156251 authored by Richard Bowman's avatar Richard Bowman 🔬
Browse files

Added a kludgy extensions settings dictionary.

parent e452d623
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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: