Smart Scan metadata containing scan name if scan is running

This commit is contained in:
jaknapper 2025-10-21 19:00:15 +01:00 committed by Julian Stirling
parent 057376a799
commit c2d8160ff4

View file

@ -7,7 +7,16 @@ It also controls external processes for live stitching composite images, and
the creation of the final stitched images. 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 threading
import os import os
import time import time
@ -481,6 +490,13 @@ class SmartScanThing(lt.Thing):
**self._scan_data.starting_position, block_cancellation=True **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 @_scan_running
def _perform_final_stitch(self) -> None: def _perform_final_stitch(self) -> None:
"""Update the scan zip and perform final stitch of the data.""" """Update the scan zip and perform final stitch of the data."""