Commit 0595d3c6 authored by Joel Collins's avatar Joel Collins
Browse files

Let camera object handle its own library rebuild

parent d39f8975
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
from openflexure_microscope import Microscope
from openflexure_microscope.camera.capture import build_captures_from_exif

import logging

@@ -8,8 +7,6 @@ default_microscope = Microscope()

# Restore loaded capture array to camera object
logging.debug("Restoring captures...")
default_microscope.camera.images = build_captures_from_exif(
    default_microscope.camera.paths["default"]
)
default_microscope.camera.rebuild_captures()

logging.debug("Microscope successfully attached!")
+4 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ import logging

from abc import ABCMeta, abstractmethod

from .capture import CaptureObject
from .capture import CaptureObject, build_captures_from_exif
from openflexure_microscope.utilities import entry_by_uuid
from labthings.core.lock import StrictLock

@@ -177,6 +177,9 @@ class BaseCamera(metaclass=ABCMeta):
            shutil.rmtree(self.paths["temp"])
            logging.debug("Cleared {}.".format(self.paths["temp"]))

    def rebuild_captures(self):
        self.images = build_captures_from_exif(self.paths["default"])

    # START AND STOP WORKER THREAD

    def start_worker(self, timeout: int = 5) -> bool: