diff --git a/src/openflexure_microscope_server/things/smart_scan.py b/src/openflexure_microscope_server/things/smart_scan.py index 56f0d305..53e324cd 100644 --- a/src/openflexure_microscope_server/things/smart_scan.py +++ b/src/openflexure_microscope_server/things/smart_scan.py @@ -63,7 +63,7 @@ def ensure_free_disk_space(path: str, min_space: int = 500000000) -> None: if du.free < min_space: raise NotEnoughFreeSpaceError( "There is not enough free disk space to continue. " - f"(Required: {min_space}, {du})." + f"(Required: {min_space >> 20}MB, free: {du.free >> 20}MB)." ) @@ -182,8 +182,6 @@ class SmartScanThing(Thing): self._scan_images_taken = 0 self._stitch_resize = 1 - self._cam.start_streaming(main_resolution=(3280, 2464)) - # Don't set self._scan_data dictionary. This is done at the start of _run_scan try: @@ -204,7 +202,6 @@ class SmartScanThing(Thing): # Error must be raised so UI gives correct output raise e finally: - self._cam.start_streaming() # However the scan finishes, unset all variables and release lock self._cancel = None self._scan_logger = None @@ -559,6 +556,7 @@ class SmartScanThing(Thing): scan_successful = True try: + self._cam.start_streaming(main_resolution = (3280,2464)) self._set_scan_data() self._save_scan_inputs_json() if self._scan_images_taken != 0: @@ -590,6 +588,8 @@ class SmartScanThing(Thing): ) raise e finally: + # Start streaming in the default resolution again as soon as possible + self._cam.start_streaming() if self._capture_thread: # If the capture thread had an error, we capture it here try: