From 864f7aa0058dcef444a60be8ee4ec7107fe1b976 Mon Sep 17 00:00:00 2001 From: GotthardG <51994228+GotthardG@users.noreply.github.com> Date: Wed, 10 Dec 2025 10:28:01 +0100 Subject: [PATCH 1/6] DAQ: Adding run_number into SampleShortInfo model --- common/pyproject.toml | 2 +- common/src/aaredaqlib/models.py | 1 + daq/pyproject.toml | 2 +- daq/src/aaredaq/server.py | 1 + gui/pyproject.toml | 2 +- gui/src/aaregui/panels/manual_sample_panel.py | 1 + 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/pyproject.toml b/common/pyproject.toml index 89728ee7..b82798c8 100644 --- a/common/pyproject.toml +++ b/common/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "aaredaqlib" -version = "0.2.66" +version = "0.2.67" description = "Libraries shared between AareDAQ and AareGUI" readme = "README.md" requires-python = ">=3.11" diff --git a/common/src/aaredaqlib/models.py b/common/src/aaredaqlib/models.py index 1eb4e2d6..af771831 100644 --- a/common/src/aaredaqlib/models.py +++ b/common/src/aaredaqlib/models.py @@ -382,6 +382,7 @@ class SampleShortInfo(BaseModel): puck_name: str dewar_name: str sample_name: str + run_number: int aaredb_params: Optional[DataCollectionParameters] = None user: str = "" pin: Annotated[int, Field(ge=1, le=16)] diff --git a/daq/pyproject.toml b/daq/pyproject.toml index e50b7822..b28f5564 100644 --- a/daq/pyproject.toml +++ b/daq/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "aaredaq" -version = "0.2.65" +version = "0.2.67" description = "AareDAQ data acquisition server" readme = "README.md" requires-python = ">=3.11" diff --git a/daq/src/aaredaq/server.py b/daq/src/aaredaq/server.py index 7ea166a7..1b7a19dd 100644 --- a/daq/src/aaredaq/server.py +++ b/daq/src/aaredaq/server.py @@ -226,6 +226,7 @@ async def sample(token: str = Depends(oauth2_scheme)) -> SampleShortInfo: else: return SampleShortInfo( sample_name="Other user sample", + run_number=0, puck_name="", dewar_name="", db_id=-1, diff --git a/gui/pyproject.toml b/gui/pyproject.toml index 8d68e539..d26e54b0 100644 --- a/gui/pyproject.toml +++ b/gui/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "aaregui" -version = "0.2.66" +version = "0.2.67" description = "Beamline control GUI" readme = "README.md" requires-python = ">=3.11" diff --git a/gui/src/aaregui/panels/manual_sample_panel.py b/gui/src/aaregui/panels/manual_sample_panel.py index 9693cdf2..8219add6 100644 --- a/gui/src/aaregui/panels/manual_sample_panel.py +++ b/gui/src/aaregui/panels/manual_sample_panel.py @@ -112,6 +112,7 @@ class ManualSamplePanel(QWidget): puck_name="", dewar_name="", sample_name=self.__sample_name, + run_number=-1, pin=1, aaredb_params=data_processing, user=self.__pgroup, From 22a64cd6a3c79c788b839a5eea95dadc1bc2fd88 Mon Sep 17 00:00:00 2001 From: appleb_m Date: Wed, 10 Dec 2025 13:20:05 +0100 Subject: [PATCH 2/6] GUI: bug in creating manual sample where run number couldn't be -1. May need fixing later.! --- gui/src/aaregui/panels/manual_sample_panel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/src/aaregui/panels/manual_sample_panel.py b/gui/src/aaregui/panels/manual_sample_panel.py index 8219add6..5dce6884 100644 --- a/gui/src/aaregui/panels/manual_sample_panel.py +++ b/gui/src/aaregui/panels/manual_sample_panel.py @@ -112,7 +112,7 @@ class ManualSamplePanel(QWidget): puck_name="", dewar_name="", sample_name=self.__sample_name, - run_number=-1, + run_number=1, #can't be -1. So have defaulted to 1 for now. pin=1, aaredb_params=data_processing, user=self.__pgroup, From 21804121795cff1bd25c0ef1263ebc5ab892d960 Mon Sep 17 00:00:00 2001 From: appleb_m Date: Wed, 10 Dec 2025 13:23:50 +0100 Subject: [PATCH 3/6] DAQ: authenticate for super users added --- daq/src/aaredaq/auth.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daq/src/aaredaq/auth.py b/daq/src/aaredaq/auth.py index 7690ff63..e293f9ae 100644 --- a/daq/src/aaredaq/auth.py +++ b/daq/src/aaredaq/auth.py @@ -21,7 +21,7 @@ ACCESS_TOKEN_EXPIRE_MINUTES = 24 * 60 * 7 # 1 week SESSION_EXPIRE_SECONDS = 60 * 10 STAFF_GROUP = "unx-MXgroup" - +SUPER_USERS = ["e10019", "e11206", "e18147"] class TokenData(BaseModel): sub: str # Username @@ -42,9 +42,9 @@ def authenticate_user(cfg: BeamlineConfig, form_data: OAuth2PasswordRequestForm) groups = os.getgrouplist(user_info.pw_name, user_info.pw_gid) supplementary_groups = [grp.getgrgid(g).gr_name.lower() for g in groups] - + super_user = form_data.username in SUPER_USERS pgroups = [group for group in supplementary_groups if group.startswith('p')] - staff = "unx-mxgroup" in supplementary_groups or "unx-sls_mx" in supplementary_groups + staff = "unx-mxgroup" in supplementary_groups or "unx-sls_mx" in supplementary_groups or super_user token = TokenData(sub=form_data.username, pgroups=pgroups, staff=staff, From 0d3c83144d57e6137b43c05cd1a8f70c9fa28270 Mon Sep 17 00:00:00 2001 From: appleb_m Date: Wed, 10 Dec 2025 13:39:25 +0100 Subject: [PATCH 4/6] Updated changelog to 0.2.67 --- changelog.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/changelog.md b/changelog.md index 23f111fa..7052797d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,11 @@ +0.2.67 +- added run number to sampleshortinfo +- ingest raster result, including beam center to database +- aerotech goes to mount postion for manual mount +- logger config correctly expands file path for logger location. +- smart_rotiation_panel fix - but will be mvoed to DAQ in future update +- Fluoresence scan can be saved to CSV with right click +- Wait for ready before sending Tell to dry 0.2.66 - moved rastergridingestmodel and centreofmassmodel from models to raster_grid.py - after raster load closest image to new centre \ No newline at end of file From fd58fbc07afcfebdaabfbea17f8d90c9526b4352 Mon Sep 17 00:00:00 2001 From: appleb_m Date: Wed, 10 Dec 2025 13:40:31 +0100 Subject: [PATCH 5/6] Changelog has unreleased section --- changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog.md b/changelog.md index 7052797d..afbb1ffd 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +unreleased: +- added check box to numberlineedits to switch between user input and spreadsheet +- re-enabled MLprediciton +- fixed bug in gui where manual sample couldnt be created when run nubmer was negative. 0.2.67 - added run number to sampleshortinfo - ingest raster result, including beam center to database From 0ed2f85faad5a30cd532303bfe091bf6583b4ad8 Mon Sep 17 00:00:00 2001 From: appleb_m Date: Wed, 10 Dec 2025 13:42:52 +0100 Subject: [PATCH 6/6] GUI: beamline view vertical not horizontal --- changelog.md | 1 + gui/src/aaregui/main_window.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index afbb1ffd..09a4671c 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ unreleased: - added check box to numberlineedits to switch between user input and spreadsheet - re-enabled MLprediciton - fixed bug in gui where manual sample couldnt be created when run nubmer was negative. +- Combined beamline view now split vertically not horizontally 0.2.67 - added run number to sampleshortinfo - ingest raster result, including beam center to database diff --git a/gui/src/aaregui/main_window.py b/gui/src/aaregui/main_window.py index 71b11b82..8bdaed3c 100644 --- a/gui/src/aaregui/main_window.py +++ b/gui/src/aaregui/main_window.py @@ -110,7 +110,7 @@ class MainWindow(QMainWindow): self.sample_camera = SampleCameraImageLabel(geom=geom, raster=self.raster, parent=top_widget, default_image=default_image) self.beamline_view_container = QWidget(parent=top_widget) - self.beamline_view_layout = QHBoxLayout(self.beamline_view_container) + self.beamline_view_layout = QVBoxLayout(self.beamline_view_container) self.beamline_view_layout.setContentsMargins(0,0,0,0) self.beamline_view_layout.setSpacing(6)