GUI: Save current omega
Build and Publish / build (push) Successful in 22s

This commit is contained in:
2025-06-24 11:51:58 +02:00
parent eca90e7c51
commit a9a7bd40f2
2 changed files with 23 additions and 6 deletions
@@ -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)
@@ -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("<br/><center><B><u>Screening</u></B></center>", 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("<br/><center><B><u>Screening</u></B></center>", 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("<br/><center><B><u>Rotation</u></B></center>", parent=self), 9, 0, 1,5)
self._layout.addWidget(QLabel("<br/><center><B><u>Rotation</u></B></center>", 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
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)