diff --git a/sashimi/hardware/scanning/scanloops.py b/sashimi/hardware/scanning/scanloops.py index edcd46c0..a3c26253 100644 --- a/sashimi/hardware/scanning/scanloops.py +++ b/sashimi/hardware/scanning/scanloops.py @@ -297,7 +297,6 @@ def update_settings(self): if not self.camera_on and self.n_samples_read > self.n_samples_period(): self.camera_on = True - self.wait_signal.clear() self.trigger_exp_start = True elif not self.camera_on: self.wait_signal.set() @@ -344,6 +343,7 @@ def fill_arrays(self): if i_sample == 0: camera_pulses = self.camera_pulses.read(i_sample, self.n_samples) self.camera_was_off = False + self.wait_signal.clear() else: n_to_next_start = self.n_samples_period() - i_sample if n_to_next_start < self.n_samples: @@ -352,6 +352,7 @@ def fill_arrays(self): ).copy() camera_pulses[:n_to_next_start] = 0 self.camera_was_off = False + self.wait_signal.clear() else: camera_pulses = self.camera_pulses.read(i_sample, self.n_samples) diff --git a/sashimi/state.py b/sashimi/state.py index 4fa246d2..71af5b66 100644 --- a/sashimi/state.py +++ b/sashimi/state.py @@ -33,6 +33,7 @@ from pathlib import Path from enum import Enum from sashimi.config import read_config +from datetime import time conf = read_config() @@ -361,9 +362,6 @@ def __init__(self, sample_rate): self.light_source = light_source_class_dict[conf["light_source"]["name"]]( port=conf["light_source"]["port"] ) - self.light_source_settings.intensity.unit = ( - self.light_source.intensity_units - ) self.camera = CameraProcess( stop_event=self.stop_event, wait_event=self.scanner.wait_signal, @@ -402,6 +400,9 @@ def __init__(self, sample_rate): self.planar_setting = PlanarScanningSettings() self.light_source_settings = LightSourceSettings() + self.light_source_settings.params.intensity.unit = ( + self.light_source.intensity_units + ) self.save_status: Optional[SavingStatus] = None @@ -541,11 +542,12 @@ def get_camera_status(self): def start_experiment(self): # TODO disable the GUI except the abort button self.logger.log_message("started experiment") - self.send_scan_settings() self.scanner.wait_signal.set() + self.send_scan_settings() self.restart_event.set() self.saver.save_queue.empty() self.camera.image_queue.empty() + time.sleep(0.01) self.is_saving_event.set() def end_experiment(self):