Merge branch 'config-scan-dir' into 'v3'

Add scan directory to json config

Closes #393

See merge request openflexure/openflexure-microscope-server!283
This commit is contained in:
Joe Knapper 2025-06-09 13:42:27 +00:00
commit ae2ec1864f
6 changed files with 58 additions and 19 deletions

View file

@ -114,7 +114,8 @@ def _scan_running(method):
class SmartScanThing(Thing):
def __init__(self):
def __init__(self, scans_folder):
self._scans_folder = scans_folder
self._preview_stitch_popen = None
self._preview_stitch_popen_lock = threading.Lock()
self._scan_lock = threading.Lock()
@ -270,11 +271,8 @@ class SmartScanThing(Thing):
@property
def base_scan_dir(self) -> str:
"""This directory will hold all the scans we do."""
# TODO: This should be determined using sensible configuration.
# If the working directory is `/var/openflexure` this will result
# in scans being saved at `/var/openflexure/scans/`
return "scans"
"""The path of the directory where the scans are saved."""
return self._scans_folder
@thing_property
def latest_scan_name(self) -> Optional[str]: