update X10SA yaml, added detector_distance_minimum

This commit is contained in:
2026-05-29 10:04:07 +02:00
parent 2357e82935
commit 818f40bb4e
2 changed files with 21 additions and 7 deletions
+4 -2
View File
@@ -33,12 +33,14 @@ daq:
default_raster_scan_settings:
exp_time_s: 0.01
transmission: 1.0
dtz: 150.0
dtz: 200
default_rotation_settings:
exp_time_s: 0.01
transmission: 1.0
dtz: 150.0
dtz: 200
start_omega_deg: 0.0
increment_omega_deg: 0.2
steps: 1800
detector_distance_minimum: 170
+17 -5
View File
@@ -20,13 +20,14 @@ from aare.devices.my_motor import MyMotor
from aare.devices.set_get_pv import SetGetPV, PredefinedPV
from aare.devices.tell_client import make_tell_client
from aare.devices.bec_worker import BECClientWorker
from aare.devices.bec_worker import BECClientWorker, DetectorCoverEnum
from aare.devices.zmq_client import ZMQCameraClient
logger = setup_logger("aareDAQ")
class BeamlineDevices:
def __init__(self, beamline: MXBeamline):
self.detector_distance_minimum = 170
BEAMLINE = beamline.value.upper()
self.tell = make_tell_client(beamline)
self.aerotech = aerotech.AerotechController(beamline)
@@ -329,6 +330,10 @@ class BeamlineDevices:
self.set_dtz(value, wait=True)
def set_dtz(self, value: float, /, wait: bool = True):
if value < self.detector_distance_minimum:
#raise ValueError(f"Detector distance cannot be less than {self.detector_distance_minimum} mm")
logger.warning(f"Requested detector distance {value} is less than minimum: {self.detector_distance_minimum}, setting to minimum")
value = self.detector_distance_minimum
self.__dtz.move(value, wait=wait)
@property
@@ -415,13 +420,20 @@ class BeamlineDevices:
def smargon_initialize(self):
self.__smargon.initialize()
@property
def det_cov(self):
return devs.bec_worker.get_det_cov()
@det_cov.setter
def det_cov(self, val: DetectorCoverEnum):
devs.bec_worker.det_cov(val)
if __name__ == "__main__":
from aare.common.beamline import mx_beamline
beamline = mx_beamline()
devs = BeamlineDevices(beamline)
print(devs.aerotech_pos)
devs.bec_worker.scilog_msg(message="Testing DAQ hijack of BEC sci log communication channel", color='blue')
# devs.aerotech_pos = Coordinate(x=124.0, y=1.0, z=1.0)
# print(devs.aerotech_pos)
# devs.aerotech_omega = 0.0
print(devs.reflector_up)
devs.reflector_up = StagePositionEnum.MEASURE
# devs.aerotech_omega = 0.0