refactor: transmission is a per-mode setting, placed in its section
The shared "Rotation transmission" row sat in the top rows of BOTH the Gridscan and Rotation tabs, where it read as one setting for everything (and as nonsense in the Gridscan tab). Now each tab places its own row: Gridscan keeps "Transmission" with the shared resolution/distance rows, and the Rotation tab moves "Rotation transmission" below the Screening block and its Run button, as the first row of the Rotation section - next to the fields it actually applies to. Screening keeps its separate "Screening transmission". No behavior change: same field, same spreadsheet/user-value handling, only the label and the placement. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6d09ae4fe3
commit
1fe3c7f4e5
4 files changed
+59
-9
No files matched your search
@@ -30,6 +30,9 @@ class RasterDataCollectionPanel(ScanSettingsPanel):
|
||||
diffraction=diffraction,
|
||||
default_dtz=raster_mgr.active_grid.dtz,
|
||||
default_transmission=raster_mgr.active_grid.transmission,
|
||||
# Plain "Transmission": the tab IS the gridscan, and the longer
|
||||
# "Gridscan transmission" clips in the label column.
|
||||
transmission_label="Transmission",
|
||||
parent=parent,
|
||||
)
|
||||
|
||||
|
||||
@@ -61,6 +61,11 @@ class RotationDataCollectionPanel(ScanSettingsPanel):
|
||||
"daq.data_collection_settings.default_rotation_settings.transmission",
|
||||
default_transmission,
|
||||
),
|
||||
# Row 11 = first row under the "Rotation" header: the rotation
|
||||
# transmission belongs next to the rotation fields, not at the
|
||||
# top of the tab where it read as applying to screening too.
|
||||
transmission_row=11,
|
||||
transmission_label="Rotation transmission",
|
||||
)
|
||||
|
||||
self._filename = ""
|
||||
@@ -151,13 +156,13 @@ class RotationDataCollectionPanel(ScanSettingsPanel):
|
||||
self.total_angle = NumberLineEdit(
|
||||
0, 9999.0, self._default_total_angle, decimals=3, parent=self, track_pending=True
|
||||
)
|
||||
self._add_row(11, "Total angle", self.total_angle, "°")
|
||||
self._add_row(12, "Total angle", self.total_angle, "°")
|
||||
self._add_database_field(self.total_angle, self._on_total_angle_committed)
|
||||
|
||||
self.image_angle = NumberLineEdit(
|
||||
0, 10.0, self._default_image_angle, decimals=3, parent=self, track_pending=True
|
||||
)
|
||||
self._add_row(12, "Image angle", self.image_angle, "°")
|
||||
self._add_row(13, "Image angle", self.image_angle, "°")
|
||||
self._add_database_field(self.image_angle, self._on_image_angle_committed)
|
||||
|
||||
self.image_time_enter = NumberLineEdit(
|
||||
@@ -168,27 +173,27 @@ class RotationDataCollectionPanel(ScanSettingsPanel):
|
||||
parent=self,
|
||||
track_pending=True,
|
||||
)
|
||||
self._add_row(13, "Image time", self.image_time_enter, "s")
|
||||
self._add_row(14, "Image time", self.image_time_enter, "s")
|
||||
self._add_database_field(self.image_time_enter, self._on_exp_time_committed)
|
||||
|
||||
self.omega_speed = QLabel("-")
|
||||
self._add_row(14, "Rotation speed", self.omega_speed, "°/s")
|
||||
self._add_row(15, "Rotation speed", self.omega_speed, "°/s")
|
||||
|
||||
self.total_time = QLabel(f"{self._total_time} min 0 s")
|
||||
self._add_row(15, "Total measurement time", self.total_time)
|
||||
self._add_row(16, "Total measurement time", self.total_time)
|
||||
|
||||
self.dose = QLabel(f"{self._dose_mgy}")
|
||||
self._add_row(16, "Dose", self.dose, "MGy")
|
||||
self._add_row(17, "Dose", self.dose, "MGy")
|
||||
|
||||
self.measurement_button = QPushButton("Run rotation")
|
||||
self.measurement_button.setStyleSheet(f"color: {GO_TEXT};")
|
||||
self.measurement_button.clicked.connect(self.run_measurement)
|
||||
self._layout.addWidget(self.measurement_button, 17, 0, 1, 6)
|
||||
self._layout.addWidget(self.measurement_button, 18, 0, 1, 6)
|
||||
|
||||
# Per-tab Abort (DataCollectionSettings wires it to the DAQ cancel).
|
||||
self.abort_button = QPushButton("Abort measurement")
|
||||
self.abort_button.setStyleSheet(f"color: {ABORT_TEXT};")
|
||||
self._layout.addWidget(self.abort_button, 18, 0, 1, 6)
|
||||
self._layout.addWidget(self.abort_button, 19, 0, 1, 6)
|
||||
|
||||
# every field exists now: fill in the speed and measurement time
|
||||
self._values_changed()
|
||||
|
||||
@@ -125,6 +125,8 @@ class ScanSettingsPanel(QWidget):
|
||||
diffraction: DiffractionGeometry,
|
||||
default_dtz: float = 200.0,
|
||||
default_transmission: float = 1.0,
|
||||
transmission_row: int = 2,
|
||||
transmission_label: str = "Transmission",
|
||||
parent=None,
|
||||
):
|
||||
super().__init__(parent)
|
||||
@@ -186,10 +188,13 @@ class ScanSettingsPanel(QWidget):
|
||||
self._add_row(1, "Detector distance", self.dtz_enter, "mm")
|
||||
self._add_database_field(self.dtz_enter, self._on_dtz_committed)
|
||||
|
||||
# Placed where the subclass says: transmission is a per-mode setting
|
||||
# (user request), so each tab puts its own row next to its section
|
||||
# instead of a shared top-level "Rotation transmission" for all tabs.
|
||||
self.transmission_enter = NumberLineEdit(
|
||||
0, 1.0, default=default_transmission, decimals=4, parent=self, track_pending=True
|
||||
)
|
||||
self._add_row(2, "Rotation transmission", self.transmission_enter)
|
||||
self._add_row(transmission_row, transmission_label, self.transmission_enter)
|
||||
self._add_database_field(self.transmission_enter, self._on_transmission_committed)
|
||||
|
||||
# -- grid rows ----------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user