From 39631c5206071811be1dd51b207d9bba6d134851 Mon Sep 17 00:00:00 2001 From: Dawn Date: Thu, 10 Sep 2026 14:42:19 +0200 Subject: [PATCH 1/3] feat: X10SA energy range 6-30 keV Pick the mono limits by BEAMLINE env via mx_beamline(): X10SA gets 6-30 keV, other beamlines keep the 4-20 placeholder until confirmed. Co-Authored-By: Claude Fable 5.1 --- src/aare/gui/panels/monochromator_panel.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/aare/gui/panels/monochromator_panel.py b/src/aare/gui/panels/monochromator_panel.py index 28f787e5..56b98f4b 100644 --- a/src/aare/gui/panels/monochromator_panel.py +++ b/src/aare/gui/panels/monochromator_panel.py @@ -1,3 +1,5 @@ +from aarecommon.config.beamline import mx_beamline +from aarecommon.models.beamline import MXBeamline from aarecommon.models.models import DAQStatusModel from PySide6.QtCore import Signal, Slot from PySide6.QtWidgets import QDoubleSpinBox, QGridLayout, QLabel, QPushButton, QWidget @@ -9,8 +11,8 @@ from aare.gui.widgets.title_label import TitleLabel # TODO: placeholder range (was an arbitrary 1-30; nothing downstream validates — # daq.change_energy forwards straight to bec) — confirm the real monochromator # limits with the Beamline Scientist. Shared by both Set Energy rows. -ENERGY_MIN_KEV = 4.0 -ENERGY_MAX_KEV = 20.0 +# X10SA mono reaches 6-30 keV; others keep the placeholder until confirmed. +ENERGY_MIN_KEV, ENERGY_MAX_KEV = (6.0, 30.0) if mx_beamline() == MXBeamline.X10SA else (4.0, 20.0) # "arrived" window for the moving->neutral transition; per-hardware knob like # MotorMoveGroup's tol (the mono never lands exactly on the setpoint) ENERGY_AT_TARGET_TOL_KEV = 0.001 -- 2.54.0 From b27556e4cf971222d9732f8dd54e029abb60b090 Mon Sep 17 00:00:00 2001 From: duan_j Date: Thu, 10 Sep 2026 16:25:58 +0200 Subject: [PATCH 2/3] fix: according to 6124 planner feedback, use 10 to 20 keV at PXII --- src/aare/gui/panels/monochromator_panel.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aare/gui/panels/monochromator_panel.py b/src/aare/gui/panels/monochromator_panel.py index 56b98f4b..499ac290 100644 --- a/src/aare/gui/panels/monochromator_panel.py +++ b/src/aare/gui/panels/monochromator_panel.py @@ -12,7 +12,8 @@ from aare.gui.widgets.title_label import TitleLabel # daq.change_energy forwards straight to bec) — confirm the real monochromator # limits with the Beamline Scientist. Shared by both Set Energy rows. # X10SA mono reaches 6-30 keV; others keep the placeholder until confirmed. -ENERGY_MIN_KEV, ENERGY_MAX_KEV = (6.0, 30.0) if mx_beamline() == MXBeamline.X10SA else (4.0, 20.0) +# in the 6124 planner it says 10 to 20 keV at PXII +ENERGY_MIN_KEV, ENERGY_MAX_KEV = (10.0, 20.0) if mx_beamline() == MXBeamline.X10SA else (4.0, 20.0) # "arrived" window for the moving->neutral transition; per-hardware knob like # MotorMoveGroup's tol (the mono never lands exactly on the setpoint) ENERGY_AT_TARGET_TOL_KEV = 0.001 -- 2.54.0 From d5a7074ec1d528514acfb082b5806fc14720cdea Mon Sep 17 00:00:00 2001 From: Dawn Date: Thu, 10 Sep 2026 16:57:24 +0200 Subject: [PATCH 3/3] feat: compact sample list headers, move Comment column Count columns use glyphs instead of long headers to save width, Comment moves ahead of the data-collection params, transmission shown as the stored value instead of percent. Co-Authored-By: Claude Fable 5.1 --- src/aare/gui/models/user_sample_model.py | 24 ++++++++++++------------ tests/unit/gui/test_models.py | 5 +++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/aare/gui/models/user_sample_model.py b/src/aare/gui/models/user_sample_model.py index 4fbd7b30..9751862f 100644 --- a/src/aare/gui/models/user_sample_model.py +++ b/src/aare/gui/models/user_sample_model.py @@ -46,17 +46,17 @@ def get_entry(sample: SampleShortInfo, column: int): # Data-collection params straight from the AareDB spreadsheet (filled by # spreadsheetupdater). Nullable: samples without params show blank. elif column == 11: - return sample.aaredb_params.oscillation if sample.aaredb_params else None + return sample.comment elif column == 12: - return sample.aaredb_params.exposure if sample.aaredb_params else None + return sample.aaredb_params.oscillation if sample.aaredb_params else None elif column == 13: - return sample.aaredb_params.totalangle if sample.aaredb_params else None + return sample.aaredb_params.exposure if sample.aaredb_params else None elif column == 14: + return sample.aaredb_params.totalangle if sample.aaredb_params else None + elif column == 15: # Model holds a 0-1 fraction; users think in spreadsheet percent. t = sample.aaredb_params.transmission if sample.aaredb_params else None - return None if t is None else round(t * 100, 1) - elif column == 15: - return sample.comment + return None if t is None else t return "" @@ -80,17 +80,17 @@ class UserSampleSpreadsheet(QAbstractTableModel): "Location", "Priority", "User", - "Mount count", - "Raster count", + "⧂", # Mount count + "▦", # Raster count # Workflow order: a sample is screened before rotation data is # collected, so Screening sits left of Rotation. - "Screening count", - "Rotation count", + "⌕", # Screening count + "↻", # Rotation count + "Comment", "Oscillation (°)", "Exposure (s)", "Total range (°)", - "Transmission (%)", - "Comment", + "Transmission", ] self.current_sample = current_sample self.current_puck = current_puck diff --git a/tests/unit/gui/test_models.py b/tests/unit/gui/test_models.py index 58868d6a..e11ec6a6 100644 --- a/tests/unit/gui/test_models.py +++ b/tests/unit/gui/test_models.py @@ -289,14 +289,15 @@ def test_spreadsheet_param_columns(status_model): hdr.index("Oscillation (°)"), hdr.index("Exposure (s)"), hdr.index("Total range (°)"), - hdr.index("Transmission (%)"), + hdr.index("Transmission"), ) model.get_id(_row_of(model, 1)).aaredb_params = DataCollectionParameters( oscillation=0.1, exposure=0.01, totalangle=360, transmission=0.125 ) row = _row_of(model, 1) d = lambda c: model.data(model.index(row, c), Qt.ItemDataRole.DisplayRole) - assert (d(osc), d(exp), d(tot), d(trans)) == (0.1, 0.01, 360, 12.5) + # Transmission shown as stored, no percent conversion. + assert (d(osc), d(exp), d(tot), d(trans)) == (0.1, 0.01, 360, 0.125) # No params -> blank, and sorting a mostly-None column must not raise; # the real value sorts first. assert model.data(model.index(_row_of(model, 2), osc), Qt.ItemDataRole.DisplayRole) is None -- 2.54.0