diff --git a/src/openflexure_microscope_server/things/smart_scan.py b/src/openflexure_microscope_server/things/smart_scan.py index a6ab415c..71376362 100644 --- a/src/openflexure_microscope_server/things/smart_scan.py +++ b/src/openflexure_microscope_server/things/smart_scan.py @@ -7,7 +7,16 @@ It also controls external processes for live stitching composite images, and the creation of the final stitched images. """ -from typing import Optional, Self, TypeVar, ParamSpec, Callable, Concatenate +from typing import ( + Optional, + Self, + TypeVar, + ParamSpec, + Callable, + Concatenate, + Mapping, + Any, +) import threading import os import time @@ -481,6 +490,13 @@ class SmartScanThing(lt.Thing): **self._scan_data.starting_position, block_cancellation=True ) + @property + def thing_state(self) -> Mapping[str, Any]: + """Return a metadata dict for ongoing scan to populate.""" + if self._ongoing_scan is None: + return {} + return {"scan_name": self._ongoing_scan.name} + @_scan_running def _perform_final_stitch(self) -> None: """Update the scan zip and perform final stitch of the data."""