DAQ Config: Add beam center storage
Build and Publish / build (push) Successful in 22s

This commit is contained in:
2025-06-02 16:23:28 +02:00
parent 92f8d6257c
commit ef4dd537af
2 changed files with 17 additions and 1 deletions
+4
View File
@@ -167,6 +167,10 @@ class DAQStatusModel(BaseModel):
sample: SampleShortInfo | None = None
session: SessionStatus
class BeamCenterModel(BaseModel):
x: float | None = 0.0
y: float | None = 0.0
class BeamlineSettingsModel(BaseModel):
# Float properties
cryojet_park_position: float | None = 12.0
+13 -1
View File
@@ -13,7 +13,7 @@ from aaredaqlib.models import (
def_loop_centering_zoom,
SampleShortInfo,
SessionStatus,
BeamlineStateEnum, SessionsStateEnum,
BeamlineStateEnum, SessionsStateEnum, BeamCenterModel,
)
from aaredaqlib.beamline import MXBeamline
@@ -147,6 +147,18 @@ class BeamlineConfig:
* np.exp(cfg.camera_translation_factor_a * zoom)
)
@property
def beam_center(self, dtz: float | None = None) -> BeamCenterModel:
tmp = self.__client.get(f"{self.__bl}:beam_center")
if tmp is None:
return BeamCenterModel()
data_dict = json.loads(tmp)
model = BeamCenterModel(**data_dict)
return model
@beam_center.setter
def beam_center(self, data: BeamCenterModel):
self.__client.set(f"{self.__bl}:beam_center", data.model_dump_json())
def __get_settings(self) -> BeamlineSettingsModel:
tmp = self.__client.get(f"{self.__bl}:settings")