From a9a7bd40f2ffc0680f05606237e8633b3bdf5cd0 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Tue, 24 Jun 2025 11:32:30 +0200 Subject: [PATCH] GUI: Save current omega --- .../panels/data_collection_settings.py | 1 + .../panels/rotation_data_collection.py | 28 +++++++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/gui/src/aaregui/panels/data_collection_settings.py b/gui/src/aaregui/panels/data_collection_settings.py index 4d377102..1968da6c 100644 --- a/gui/src/aaregui/panels/data_collection_settings.py +++ b/gui/src/aaregui/panels/data_collection_settings.py @@ -68,4 +68,5 @@ class DataCollectionSettings(QFrame): @Slot(DAQStatusModel) def update_daq_status(self, s: DAQStatusModel): self.raster.update_daq_status(s) + self.screening.update_daq_status(s) self.file_path_panel.update_daq_status(s) diff --git a/gui/src/aaregui/panels/rotation_data_collection.py b/gui/src/aaregui/panels/rotation_data_collection.py index a398044f..7626218a 100644 --- a/gui/src/aaregui/panels/rotation_data_collection.py +++ b/gui/src/aaregui/panels/rotation_data_collection.py @@ -2,6 +2,7 @@ from PySide6.QtCore import Slot, Signal from PySide6.QtWidgets import QLabel, QComboBox, QPushButton from aaredaqlib.diffraction_geometry import DiffractionGeometry +from aaredaqlib.models import DAQStatusModel from aaredaqlib.rotation_scan import RotationScanRequest from aaregui.panels.scan_settings_panel import ScanSettingsPanel from aaregui.widgets.number_line_edit import NumberLineEdit @@ -21,12 +22,19 @@ class RotationDataCollectionPanel(ScanSettingsPanel): self._filename = "" + self.__omega = 0 + self._layout.addWidget(QLabel("Start angle", parent=self), 3, 0) self.start_angle = NumberLineEdit(-720, 720.0, 0.0, decimals=3, parent=self) self._layout.addWidget(self.start_angle, 3, 1, 1, 3) self._layout.addWidget(QLabel("°", parent=self), 3, 4) - self._layout.addWidget(QLabel("
Screening
", parent=self), 4, 0, 1,5) + self.omega_button = QPushButton("Ω") + self.omega_button.setFixedWidth(20) + self.omega_button.clicked.connect(self.update_omega_start) + self._layout.addWidget(self.omega_button, 3, 5) + + self._layout.addWidget(QLabel("
Screening
", parent=self), 4, 0, 1,6) self._layout.addWidget(QLabel("Image angle", parent=self), 5, 0) self.screening_image_angle = NumberLineEdit(0, 10.0, 0.5, decimals=3, parent=self) @@ -48,14 +56,14 @@ class RotationDataCollectionPanel(ScanSettingsPanel): self.screening_type.addItem("2 images every 45°", {"steps": 2, "omega_step_deg": 45}) self.screening_type.addItem("4 images every 45°", {"steps": 4, "omega_step_deg": 45}) - self._layout.addWidget(self.screening_type, 7, 0, 1, 5) + self._layout.addWidget(self.screening_type, 7, 0, 1, 6) self.screening_button = QPushButton("Run screening") self.screening_button.setStyleSheet("color: rgb(78, 154, 6);") self.screening_button.clicked.connect(self.run_screening) - self._layout.addWidget(self.screening_button, 8, 0, 1, 5) + self._layout.addWidget(self.screening_button, 8, 0, 1, 6) - self._layout.addWidget(QLabel("
Rotation
", parent=self), 9, 0, 1,5) + self._layout.addWidget(QLabel("
Rotation
", parent=self), 9, 0, 1,6) self._layout.addWidget(QLabel("Total angle", parent=self), 10, 0) self.total_angle = NumberLineEdit(0, 999.0, 180.0, decimals=3, parent=self) @@ -77,7 +85,7 @@ class RotationDataCollectionPanel(ScanSettingsPanel): self.measurement_button = QPushButton("Run rotation") self.measurement_button.setStyleSheet("color: rgb(78, 154, 6);") self.measurement_button.clicked.connect(self.run_measurement) - self._layout.addWidget(self.measurement_button, 13, 0, 1, 5) + self._layout.addWidget(self.measurement_button, 13, 0, 1, 6) @Slot() def run_screening(self): @@ -117,4 +125,12 @@ class RotationDataCollectionPanel(ScanSettingsPanel): @Slot(str) def update_filename(self, filename: str): - self._filename = filename \ No newline at end of file + self._filename = filename + + @Slot(DAQStatusModel) + def update_daq_status(self, s: DAQStatusModel): + self.__omega = s.geom.omega_deg + + @Slot() + def update_omega_start(self): + self.start_angle.update_value(self.__omega)