Stitch all scans button, and refresh scan tab when closing modals

This commit is contained in:
jaknapper 2025-07-25 16:52:37 +01:00
parent 37a28af04a
commit 7ac77c3e89
4 changed files with 41 additions and 2 deletions

View file

@ -977,3 +977,19 @@ class SmartScanThing(lt.Thing):
"""
zip_fname = self._scan_dir_manager.zip_scan(scan_name, final_version=True)
return ZipBlob.from_file(zip_fname)
@lt.thing_action
def stitch_all_scans(
self, logger: lt.deps.InvocationLogger, cancel: lt.deps.CancelHook
):
"""Check the list of scans, and stitch any that don't have a DZI associated with it.
Raises:
RuntimeError if the microscope is currently running a scan
"""
if self._scan_logger is not None:
raise RuntimeError("Can't stitch previous scans while a scan is ongoing")
for scan in self._scan_dir_manager.all_scans_info():
if scan.dzi is None:
self.stitch_scan(logger=logger, cancel=cancel, scan_name=scan.name)