DAQ - config: added property and setter for bl_zoom_settings. Setting zoom checks cfg_state for beamlocation. TODO: tidy up zoom functions - combine them using self.state in config.py?
This commit is contained in:
1 parent
f479eac4fb
commit
80aa1466af
2 files changed
+20
-4
No files matched your search
@@ -14,7 +14,7 @@ from aaredaqlib.models import (
|
||||
def_loop_centering_zoom,
|
||||
SampleShortInfo,
|
||||
SessionStatus,
|
||||
BeamlineStateEnum, SessionsStateEnum, SampleShortInfoList, CryojetSettingsModel, ZoomModel, def_zoom,
|
||||
BeamlineStateEnum, SessionsStateEnum, SampleShortInfoList, CryojetSettingsModel, ZoomModel, def_zoom, def_bl_zoom,
|
||||
)
|
||||
|
||||
from aaredaqlib.beamline import MXBeamline
|
||||
@@ -340,6 +340,8 @@ class BeamlineConfig:
|
||||
def beam_mark_coeff(self, data: BeamMarkCoeffModel):
|
||||
self.__client.set(f"{self.__bl}:beam_center_camera", data.model_dump_json())
|
||||
|
||||
#TODO tidy up zoom functions
|
||||
|
||||
@property
|
||||
def alc_zoom_settings(self) -> LoopCenteringZoomModel:
|
||||
tmp = self.__client.get(f"{self.__bl}:alc_zoom_settings")
|
||||
@@ -365,6 +367,18 @@ class BeamlineConfig:
|
||||
def zoom_settings(self, data: ZoomModel):
|
||||
self.__client.set(f"{self.__bl}:zoom_settings", data.model_dump_json())
|
||||
|
||||
@property
|
||||
def bl_zoom_settings(self) -> ZoomModel:
|
||||
tmp = self.__client.get(f"{self.__bl}:zoom_settings")
|
||||
if tmp is None:
|
||||
return def_bl_zoom()
|
||||
data_dict = json.loads(tmp)
|
||||
return ZoomModel(**data_dict)
|
||||
|
||||
@zoom_settings.setter
|
||||
def bl_zoom_settings(self, data: ZoomModel):
|
||||
self.__client.set(f"{self.__bl}:bl_zoom_settings", data.model_dump_json())
|
||||
|
||||
@property
|
||||
def abr_meas_pos(self) -> Coordinate:
|
||||
tmp = self.__client.get(f"{self.__bl}:abr_meas_pos")
|
||||
|
||||
@@ -103,9 +103,11 @@ class AareDAQ:
|
||||
def zoom(self, val: float):
|
||||
self.__saved_box = None
|
||||
self.__devs.zoom = val
|
||||
#if self.__cfg.state == BeamlineStateEnum.BeamLocation:
|
||||
# self.samcam_settings = self.__cfg.zoom_settings.get_camera_settings(val)
|
||||
self.samcam_settings = self.__cfg.zoom_settings.get_camera_settings(val)
|
||||
if self.__cfg.state == BeamlineStateEnum.BeamLocation:
|
||||
self.samcam_settings = self.__cfg.bl_zoom_settings.get_camera_settings(val)
|
||||
zoom_settings = self.__cfg.zoom_settings.get_camera_settings(val)
|
||||
print("Setting zoom {val} {zoom_settings}")
|
||||
self.samcam_settings = zoom_settings
|
||||
#elf.__cfg.state_busy = False
|
||||
|
||||
@property
|
||||
|
||||
Reference in new issue
Block a user