From be7e40fa9ae66e9f08f2547dde482251ba81b02e Mon Sep 17 00:00:00 2001 From: Micah Woodard Date: Tue, 29 Oct 2024 16:05:03 -0700 Subject: [PATCH 1/3] fix dismantle live big --- src/view/acquisition_view.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/view/acquisition_view.py b/src/view/acquisition_view.py index d953c38..fd4efc4 100644 --- a/src/view/acquisition_view.py +++ b/src/view/acquisition_view.py @@ -155,7 +155,8 @@ def start_acquisition(self) -> None: self.update_tiles() if self.instrument_view.grab_frames_worker.is_running: # stop livestream if running - self.instrument_view.dismantle_live() + for camera_name in self.instrument.cameras.keys(): + self.instrument_view.dismantle_live(camera_name) # write correct daq values if different from livestream for daq_name, daq in self.instrument.daqs.items(): From 4feba385fb0189c24cbeeec6bf1002e3e21d722e Mon Sep 17 00:00:00 2001 From: Micah Woodard Date: Wed, 30 Oct 2024 08:07:38 -0700 Subject: [PATCH 2/3] fixing livesteam channel not being set bug --- src/view/acquisition_view.py | 6 +++++- src/view/instrument_view.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/view/acquisition_view.py b/src/view/acquisition_view.py index fd4efc4..4e5bc71 100644 --- a/src/view/acquisition_view.py +++ b/src/view/acquisition_view.py @@ -162,7 +162,6 @@ def start_acquisition(self) -> None: for daq_name, daq in self.instrument.daqs.items(): if daq_name in self.config['acquisition_view'].get('data_acquisition_tasks', {}).keys(): daq.tasks = self.config['acquisition_view']['data_acquisition_tasks'][daq_name]['tasks'] - # Tasks should be added and written in acquisition? # anchor grid in volume widget for anchor, widget in zip(self.volume_plan.anchor_widgets, self.volume_plan.grid_offset_widgets): @@ -205,6 +204,11 @@ def acquisition_ended(self) -> None: getattr(self, f'{operation}_dock').setDisabled(False) self.stop_button.setEnabled(False) + # write correct daq values if different from acquisition task + for daq_name, daq in self.instrument.daqs.items(): + if daq_name in self.config['instrument_view'].get('livestream_tasks', {}).keys(): + daq.tasks = self.config['instrument_view']['livestream_tasks'][daq_name]['tasks'] + # unanchor grid in volume widget # anchor grid in volume widget for anchor, widget in zip(self.volume_plan.anchor_widgets, self.volume_plan.grid_offset_widgets): diff --git a/src/view/instrument_view.py b/src/view/instrument_view.py index 76b0d8b..4b182e2 100644 --- a/src/view/instrument_view.py +++ b/src/view/instrument_view.py @@ -454,10 +454,10 @@ def setup_channel_widget(self) -> None: laser_button_group = QButtonGroup(widget) for channel, specs in self.channels.items(): button = QRadioButton(str(channel)) - button.setChecked(True) # Arbitrarily set last button checked button.toggled.connect(lambda value, ch=channel: self.change_channel(value, ch)) laser_button_group.addButton(button) widget_layout.addWidget(button) + button.setChecked(True) # Arbitrarily set last button checked widget.setLayout(widget_layout) widget.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum) self.viewer.window.add_dock_widget(widget, area='bottom', name='Channels') From 0d7b23dc9bd0e35007d9edfb79143a257ca88d25 Mon Sep 17 00:00:00 2001 From: Micah Woodard Date: Wed, 30 Oct 2024 08:23:45 -0700 Subject: [PATCH 3/3] aborting livestream thread instead of calling dismantle livestream --- src/view/acquisition_view.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/view/acquisition_view.py b/src/view/acquisition_view.py index 4e5bc71..ead41fe 100644 --- a/src/view/acquisition_view.py +++ b/src/view/acquisition_view.py @@ -155,8 +155,7 @@ def start_acquisition(self) -> None: self.update_tiles() if self.instrument_view.grab_frames_worker.is_running: # stop livestream if running - for camera_name in self.instrument.cameras.keys(): - self.instrument_view.dismantle_live(camera_name) + self.instrument_view.grab_frames_worker.quit() # write correct daq values if different from livestream for daq_name, daq in self.instrument.daqs.items():