From b40b30c13d241979f0f272b1917317cadc0b36b3 Mon Sep 17 00:00:00 2001 From: appleb_m Date: Thu, 20 Nov 2025 09:09:45 +0100 Subject: [PATCH] DAQ: added new properties to redis including crystal size, b_factor and automation_parameters --- daq/src/aaredaq/config.py | 18 ++++++++++++++++++ daq/src/mxlibs3/jfjoch.py | 1 - 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/daq/src/aaredaq/config.py b/daq/src/aaredaq/config.py index 535a7422..e71dc392 100644 --- a/daq/src/aaredaq/config.py +++ b/daq/src/aaredaq/config.py @@ -112,6 +112,24 @@ class BeamlineConfig: ) self.__client.expire(f"{self.__bl}:active_session", expiry_sec) + #TODO finish setting this up! + def try_extend_active_session(self, session: int, expiry_sec: int) -> None: + with redis_lock.Lock( + self.__client, f"{self.__bl}:active_session_lock", expire=10 + ): + tmp = self.__client.get(f"{self.__bl}:active_session") + if tmp == session: + self.__client.expire(f"{self.__bl}:active_session", expiry_sec, gt=True) + elif int(tmp) != session: + raise Exception( + "There is already active session with different id. Try again later." + ) + else: + raise Exception( + "There is no active session with given id. Try again later." + ) + + def end_active_session(self, session: int) -> None: with redis_lock.Lock( self.__client, f"{self.__bl}:active_session_lock", expire=10 diff --git a/daq/src/mxlibs3/jfjoch.py b/daq/src/mxlibs3/jfjoch.py index a4003b4b..b073b55f 100644 --- a/daq/src/mxlibs3/jfjoch.py +++ b/daq/src/mxlibs3/jfjoch.py @@ -135,7 +135,6 @@ class JFJochWrapper: ring_current_mA=s.bl.ring_current_mA, sample_temperature_K=s.bl.cryojet_K, total_flux=s.bl.flux_ph_s, - space_group_number=1,#TODO space_group_number and unit_cell??? poni_rot1_rad = s.diffraction.poni_rot1_rad, poni_rot2_rad = s.diffraction.poni_rot2_rad, max_spot_count = 1000,