This commit is contained in:
@@ -34,8 +34,4 @@ to setup the prompts.
|
||||
"""
|
||||
|
||||
# pylint: disable=invalid-name, unused-import, import-error, undefined-variable, unused-variable, unused-argument, no-name-in-module
|
||||
d = init_se_devices()
|
||||
states, allow_modifiers = get_states()
|
||||
deps = planner_deps()
|
||||
planner = StateManager(d, states, allow_modifiers, deps)
|
||||
|
||||
d, planner = init_beamline_environment()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+81
-21
@@ -10,8 +10,14 @@ states:
|
||||
det_cov: 'close'
|
||||
diag_y: out
|
||||
fl_bright: 'off'
|
||||
gon_x: in
|
||||
# smargon: not implemented
|
||||
aerotech_x: in
|
||||
aerotech_y: mount
|
||||
aerotech_z: mount
|
||||
aerotech_u: mount
|
||||
smargon_x: mount
|
||||
smargon_y: mount
|
||||
smargon_chi: mount
|
||||
smargon_phi: mount
|
||||
xrf_pos: out
|
||||
|
||||
sample_alignment:
|
||||
@@ -25,8 +31,14 @@ states:
|
||||
det_cov: 'close'
|
||||
diag_y: out
|
||||
fl_bright: 'on'
|
||||
gon_x: in
|
||||
# smargon: not implemented
|
||||
aerotech_x: in
|
||||
aerotech_y: work
|
||||
aerotech_z: work
|
||||
# aerotech_u: mount
|
||||
# smargon_x: mount
|
||||
# smargon_y: mount
|
||||
# smargon_chi: mount
|
||||
# smargon_phi: mount
|
||||
xrf_pos: out
|
||||
|
||||
data_collection:
|
||||
@@ -40,8 +52,14 @@ states:
|
||||
det_cov: 'open'
|
||||
diag_y: out
|
||||
fl_bright: 'on'
|
||||
gon_x: in
|
||||
# smargon: not implemented
|
||||
aerotech_x: in
|
||||
aerotech_y: work
|
||||
aerotech_z: work
|
||||
# aerotech_u: mount
|
||||
# smargon_x: mount
|
||||
# smargon_y: mount
|
||||
# smargon_chi: mount
|
||||
# smargon_phi: mount
|
||||
xrf_pos: out
|
||||
|
||||
DC_XRF:
|
||||
@@ -55,9 +73,15 @@ states:
|
||||
det_cov: 'close'
|
||||
diag_y: out
|
||||
fl_bright: 'on'
|
||||
gon_x: in
|
||||
# smargon: not implemented
|
||||
xrf_pos: in
|
||||
aerotech_x: in
|
||||
aerotech_y: work
|
||||
aerotech_z: work
|
||||
aerotech_u: mount
|
||||
# smargon_x: mount
|
||||
# smargon_y: mount
|
||||
# smargon_chi: mount
|
||||
# smargon_phi: mount
|
||||
xrf_pos: out
|
||||
|
||||
manual_sample_exchange:
|
||||
allow_modifiers: true
|
||||
@@ -70,8 +94,14 @@ states:
|
||||
det_cov: 'close'
|
||||
diag_y: park
|
||||
fl_bright: 'off'
|
||||
gon_x: in
|
||||
# smargon: not implemented
|
||||
aerotech_x: in
|
||||
aerotech_y: mount
|
||||
aerotech_z: mount
|
||||
aerotech_u: mount
|
||||
smargon_x: mount
|
||||
smargon_y: mount
|
||||
smargon_chi: mount
|
||||
smargon_phi: mount
|
||||
xrf_pos: out
|
||||
|
||||
beam_visualisation:
|
||||
@@ -84,8 +114,14 @@ states:
|
||||
det_cov: 'close'
|
||||
diag_y: scint
|
||||
fl_bright: 'off'
|
||||
gon_x: out
|
||||
# smargon: not implemented
|
||||
aerotech_x: out
|
||||
aerotech_y: mount
|
||||
aerotech_z: mount
|
||||
aerotech_u: mount
|
||||
smargon_x: mount
|
||||
smargon_y: mount
|
||||
smargon_chi: mount
|
||||
smargon_phi: mount
|
||||
xrf_pos: out
|
||||
|
||||
flux_measurement:
|
||||
@@ -98,8 +134,14 @@ states:
|
||||
det_cov: 'close'
|
||||
diag_y: i1
|
||||
fl_bright: 'off'
|
||||
gon_x: out
|
||||
# smargon: not implemented
|
||||
aerotech_x: out
|
||||
aerotech_y: mount
|
||||
aerotech_z: mount
|
||||
aerotech_u: mount
|
||||
smargon_x: mount
|
||||
smargon_y: mount
|
||||
smargon_chi: mount
|
||||
smargon_phi: mount
|
||||
xrf_pos: out
|
||||
|
||||
beamstop_alignment:
|
||||
@@ -112,8 +154,14 @@ states:
|
||||
det_cov: 'close'
|
||||
diag_y: out
|
||||
fl_bright: 'on'
|
||||
gon_x: out
|
||||
# smargon: not implemented
|
||||
aerotech_x: out
|
||||
aerotech_y: mount
|
||||
aerotech_z: mount
|
||||
aerotech_u: mount
|
||||
smargon_x: mount
|
||||
smargon_y: mount
|
||||
smargon_chi: mount
|
||||
smargon_phi: mount
|
||||
xrf_pos: out
|
||||
|
||||
maintenance:
|
||||
@@ -127,8 +175,14 @@ states:
|
||||
det_cov: 'close'
|
||||
diag_y: park
|
||||
fl_bright: 'off'
|
||||
gon_x: out
|
||||
# smargon: not implemented
|
||||
aerotech_x: out
|
||||
aerotech_y: mount
|
||||
aerotech_z: mount
|
||||
aerotech_u: mount
|
||||
smargon_x: mount
|
||||
smargon_y: mount
|
||||
smargon_chi: mount
|
||||
smargon_phi: mount
|
||||
xrf_pos: out
|
||||
|
||||
xtal_snapshot:
|
||||
@@ -142,8 +196,14 @@ states:
|
||||
det_cov: 'close'
|
||||
diag_y: out
|
||||
fl_bright: 'on'
|
||||
gon_x: in
|
||||
# smargon: not implemented
|
||||
aerotech_x: in
|
||||
aerotech_y: work
|
||||
aerotech_z: work
|
||||
aerotech_u: mount
|
||||
smargon_x: mount
|
||||
smargon_y: mount
|
||||
smargon_chi: mount
|
||||
smargon_phi: mount
|
||||
xrf_pos: out
|
||||
|
||||
|
||||
@@ -1,170 +0,0 @@
|
||||
name,description,deviceClass,PV,readoutPriority,tag,readOnly,include,userParameter,
|
||||
sls_current,SLS Current,SignalRO,ARS07-DPCT-0100:CURR,monitored,SLS,yes,yes,,
|
||||
fe_bpm1,FE XBPM Channel 1,SignalRO,X10SA-FE-XBPM1:Current1:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
fe_bpm2,FE XBPM Channel 2,SignalRO,X10SA-FE-XBPM1:Current2:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
fe_bpm3,FE XBPM Channel 3,SignalRO,X10SA-FE-XBPM1:Current3:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
fe_bpm4,FE XBPM Channel 4,SignalRO,X10SA-FE-XBPM1:Current4:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
fe_bpmsum,FE XBPM Summed,SignalRO,X10SA-FE-XBPM1:SumAll:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
fe_bpm_x,FE BPM X,Motor,X10SA-FE-XBPM1:TRX,baseline,fe,no,yes,,
|
||||
fe_bpm_y,FE BPM Y,Motor,X10SA-FE-XBPM1:TRY,baseline,fe,no,yes,,
|
||||
fe_sl_xr,FE Slit X Ring,MotorEC,X10SA-FE-SL1:TRXR,baseline,fe,no,yes,,
|
||||
fe_sl_yt,FE Slit Y Top,MotorEC,X10SA-FE-SL1:TRYT,baseline,fe,no,yes,,
|
||||
fe_sl_xw,FE Slit X Wall,MotorEC,X10SA-FE-SL1:TRXW,baseline,fe,no,yes,,
|
||||
fe_sl_yb,FE Slit Y Bottom,MotorEC,X10SA-FE-SL1:TRYB,baseline,fe,no,yes,,
|
||||
fe_sl_xcen,FE Slit X Centre,MotorEC,X10SA-FE-SL1:CENTERX,baseline,fe,no,yes,,
|
||||
fe_sl_xsize,FE Slit X Size,MotorEC,X10SA-FE-SL1:SIZEX,baseline,fe,no,yes,,
|
||||
fe_sl_ycen,FE Slit Y Centre,MotorEC,X10SA-FE-SL1:CENTERY,baseline,fe,no,yes,,
|
||||
fe_sl_ysize,FE Slit Y Size,MotorEC,X10SA-FE-SL1:SIZEY,baseline,fe,no,yes,,
|
||||
bsf_bpm1,BSF BPM Channel 1,SignalRO,X10SA-OP-BSFBPM:SIGNAL1,monitored,bpm,yes,no,,
|
||||
bsf_bpm2,BSF BPM Channel 2,SignalRO,X10SA-OP-BSFBPM:SIGNAL2,monitored,bpm,yes,no,,
|
||||
bsf_bpm3,BSF BPM Channel 3,SignalRO,X10SA-OP-BSFBPM:SIGNAL3,monitored,bpm,yes,no,,
|
||||
bsf_bpm4,BSF BPM Channel 4,SignalRO,X10SA-OP-BSFBPM:SIGNAL4,monitored,bpm,yes,no,,
|
||||
bsf_bpmsum,BSF BPM Summed,SignalRO,X10SA-OP-BSFBPM:SUM,monitored,bpm,yes,no,,
|
||||
bsf_sl_xw,BSF Slit Wall,MotorEC,X10SA-OP-BSFSLH:TRXW,baseline,bsf,no,yes,,
|
||||
bsf_sl_xr,BSF Slit Ring,MotorEC,X10SA-OP-BSFSLH:TRXR,baseline,bsf,no,yes,,
|
||||
bsf_sl_yt,BSF Slit Top,MotorEC,X10SA-OP-BSFSLV:TRYT,baseline,bsf,no,yes,,
|
||||
bsf_sl_yb,BSF Slit Bottom,MotorEC,X10SA-OP-BSFSLV:TRYB,baseline,bsf,no,yes,,
|
||||
bsf_sl_xcen,BSF X Centre,MotorEC,X10SA-OP-BSFSLH:CENTER,baseline,bsf,no,yes,,
|
||||
bsf_sl_xsize,BSF X Size,MotorEC,X10SA-OP-BSFSLH:SIZE,baseline,bsf,no,yes,,
|
||||
bsf_sl_ycen,BSF Y Centre,MotorEC,X10SA-OP-BSFSLV:CENTER,baseline,bsf,no,yes,,
|
||||
bsf_sl_ysize,BSF Y Size,MotorEC,X10SA-OP-BSFSLV:SIZE,baseline,bsf,no,yes,,
|
||||
bsf_f1_y,BSF Filter 1 Y,MotorEC,X10SA-OP-BSFFI1:TRY,baseline,bsf,no,yes,,
|
||||
bsf_f2_y,BSF Filter 2 Y,MotorEC,X10SA-OP-BSFFI2:TRY,baseline,bsf,no,yes,,
|
||||
dcm_bragg,DCM Bragg Angle,MotorEC,X10SA-OP-DCM:ROTY,baseline,dcm,no,yes,,
|
||||
dcm_x,DCM Lateral,MotorEC,X10SA-OP-DCM:TRX,baseline,dcm,no,yes,,
|
||||
dcm_perp,DCM Perpendicular,MotorEC,X10SA-OP-DCM:TRX-CR2,baseline,dcm,no,yes,,
|
||||
dcm_pitch,DCM 2nd Crystal Pitch,MotorEC,X10SA-OP-DCM:ROTY-CR2-PITCH,baseline,dcm,no,yes,,
|
||||
dcm_fpitch,DCM 2nd Crystal Fine Pitch,MotorEC,X10SA-OP-DCM:ROTY-CR2-FINEPITCH,baseline,dcm,no,yes,,
|
||||
dcm_froll,DCM 2nd Crystal Fine roll,MotorEC,X10SA-OP-DCM:ROTZ-CR2-FINEROLL,baseline,dcm,no,yes,,
|
||||
lu_bpm1,LU BPM Channel 1,SignalRO,X10SA-OP-LUBPM:Current1:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
lu_bpm2,LU BPM Channel 2,SignalRO,X10SA-OP-LUBPM:Current2:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
lu_bpm3,LU BPM Channel 3,SignalRO,X10SA-OP-LUBPM:Current3:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
lu_bpm4,LU BPM Channel 4,SignalRO,X10SA-OP-LUBPM:Current4:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
lu_bpmsum,LU BPM Summed,SignalRO,X10SA-OP-LUBPM:SumAll:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
lu_bpm_x,BPM2 X ,Motor,X10SA-OP-LUBPM:TRX,baseline,lu,no,yes,,
|
||||
lu_bpm_y,BPM2 Y ,Motor,X10SA-OP-LUBPM:TRY,baseline,lu,no,yes,,
|
||||
lu_z1,Lens Z1 ,Motor,X10SA-OP-LUTRZ1:TRZ,baseline,lu,no,yes,,
|
||||
lu_z2,Lens Z2 ,Motor,X10SA-OP-LUTRZ2:TRZ,baseline,lu,no,yes,,
|
||||
lu_pod1_x,SmarPod1 X,Motor,X10SA-OP-LUPOD1:TRX1,baseline,lu,no,no,,
|
||||
lu_lens1_x2,Lenses1 X,Motor,X10SA-OP-LUPOD1:TRX2,baseline,lu,no,no,,
|
||||
lu_pod1_y,SmarPod1 Y,Motor,X10SA-OP-LUPOD1:TRY,baseline,lu,no,yes,,
|
||||
lu_pod1_z,SmarPod1 Z,Motor,X10SA-OP-LUPOD1:TRZ,baseline,lu,no,yes,,
|
||||
lu_pod1_rotx,SmarPod1 RX,Motor,X10SA-OP-LUPOD1:ROTX,baseline,lu,no,yes,,
|
||||
lu_pod1_roty,SmarPod1 RY,Motor,X10SA-OP-LUPOD1:ROTY,baseline,lu,no,yes,,
|
||||
lu_pod1_rotz,SmarPod1 RZ,Motor,X10SA-OP-LUPOD1:ROTZ,baseline,lu,no,yes,,
|
||||
lu_pod2_x,SmarPod2 X,Motor,X10SA-OP-LUPOD2:TRX1,baseline,lu,no,no,,
|
||||
lu_lens2_x2,Lenses2 X,Motor,X10SA-OP-LUPOD2:TRX2,baseline,lu,no,no,,
|
||||
lu_pod2_y,SmarPod2 Y,Motor,X10SA-OP-LUPOD2:TRY,baseline,lu,no,yes,,
|
||||
lu_pod2_z,SmarPod2 Z,Motor,X10SA-OP-LUPOD2:TRZ,baseline,lu,no,yes,,
|
||||
lu_pod2_rotx,SmarPod2 RX,Motor,X10SA-OP-LUPOD2:ROTX,baseline,lu,no,yes,,
|
||||
lu_pod2_roty,SmarPod2 RY,Motor,X10SA-OP-LUPOD2:ROTY,baseline,lu,no,yes,,
|
||||
lu_pod2_rotz,SmarPod2 RZ,Motor,X10SA-OP-LUPOD2:ROTZ,baseline,lu,no,yes,,
|
||||
ss_bpm1,SS BPM Channel 1,SignalRO,X10SA-ES-SSBPM:Current1:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
ss_bpm2,SS BPM Channel 2,SignalRO,X10SA-ES-SSBPM:Current2:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
ss_bpm3,SS BPM Channel 3,SignalRO,X10SA-ES-SSBPM:Current3:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
ss_bpm4,SS BPM Channel 4,SignalRO,X10SA-ES-SSBPM:Current4:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
ss_bpmsum,SS BPM Summed,SignalRO,X10SA-ES-SSBPM:SumAll:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
ss_bpm_x,SS BPM X,Motor,X10SA-ES-SSBPM:TRX,baseline,ss,no,yes,,
|
||||
ss_bpm_y,SS BPM Y,Motor,X10SA-ES-SSBPM:TRY,baseline,ss,no,yes,,
|
||||
ss_f1_x,SS Filter 1 X,Motor,X10SA-ES-SSFI1:TRX,baseline,ss,no,yes,,
|
||||
ss_f2_x,SS Filter 2 X,Motor,X10SA-ES-SSFI2:TRX,baseline,ss,no,yes,,
|
||||
ss_f3_x,SS Filter 2 X,Motor,X10SA-ES-SSFI3:TRX,baseline,ss,no,yes,,
|
||||
ss_f4_x,SS Filter 4 X,Motor,X10SA-ES-SSFI4:TRX,baseline,ss,no,yes,,
|
||||
ss_sl_xw,SS Slit Wall,Motor,X10SA-ES-SSSLH:TRXW,baseline,ss,no,yes,,
|
||||
ss_sl_xr,SS Slit Ring,Motor,X10SA-ES-SSSLH:TRXR,baseline,ss,no,yes,,
|
||||
ss_sl_xcen,SS Slit X Centre,Motor,X10SA-ES-SSSLH:CENTER,baseline,ss,no,yes,,
|
||||
ss_sl_xsize,SS Slit X Size,Motor,X10SA-ES-SSSLH:SIZE,baseline,ss,no,yes,,
|
||||
ss_sl_yt,SS Slit Top,Motor,X10SA-ES-SSSLV:TRYT,baseline,ss,no,yes,,
|
||||
ss_sl_yb,SS Slit Bottom,Motor,X10SA-ES-SSSLV:TRYB,baseline,ss,no,yes,,
|
||||
ss_sl_ycen,SS Slit Y Centre,Motor,X10SA-ES-SSSLV:CENTER,baseline,ss,no,yes,,
|
||||
ss_sl_ysize,SS Slit Y Size,Motor,X10SA-ES-SSSLV:SIZE,baseline,ss,no,yes,,
|
||||
ss_xi_x,SS X-ray eye X,Motor,X10SA-ES-SSXI:TRX,baseline,ss,no,yes,"{""type"": multi-position,""in"": 7.5, ""out"": -2.1}",
|
||||
ss_xi_y,SS X-ray eye Y,Motor,X10SA-ES-SSXI:TRY,baseline,ss,no,yes,,
|
||||
ss_xicam_x,SS Camera X,SignalRO,X10SA-ES-SSXI:cam1:Stats5:CentroidX_RBV,baseline,ss,yes,no,,
|
||||
ss_xicam_y,SS Camera Y,SignalRO,X10SA-ES-SSXI:cam1:Stats5:CentroidY_RBV,baseline,ss,yes,no,,
|
||||
ss_xicam_max,SS Cam Max,SignalRO,X10SA-ES-SSXI:cam1:Stats5:MaxValue_RBV,monitored,ss,yes,no,,
|
||||
ss_xicam_exp,SS Camera Exposure,Signal,X10SA-ES-SSXI:cam1:AcquireTime,baseline,ss,no,no,,
|
||||
ss_xicam_gain,SS Camera Gain,Signal,X10SA-ES-SSXI:cam1:cam1:Gain,baseline,ss,no,no,,
|
||||
ss_xicam_xsig,SS Camera X Sigma,Signal,X10SA-ES-SSXI:cam1:Stats5:SigmaX_RBV,baseline,ss,yes,no,,
|
||||
ss_xicam_ysig,SS Camera Y Sigma,Signal,X10SA-ES-SSXI:cam1:Stats5:SigmaY_RBV,baseline,ss,yes,no,,
|
||||
vfm_xu,VFM Upstream X,MotorEC,X10SA-ES-VFM:TRXU,baseline,vfm,no,yes,,
|
||||
vfm_xd,VFM Downstream X,MotorEC,X10SA-ES-VFM:TRXD,baseline,vfm,no,yes,,
|
||||
vfm_yur,VFM Upstream Ring Y,MotorEC,X10SA-ES-VFM:TRYUR,baseline,vfm,no,yes,,
|
||||
vfm_yw,VFM Wall Y,MotorEC,X10SA-ES-VFM:TRYW,baseline,vfm,no,yes,,
|
||||
vfm_ydr,VFM Downstream Ring Y,MotorEC,X10SA-ES-VFM:TRYDR,baseline,vfm,no,yes,,
|
||||
vfm_bu,VFM Upstream Bender,MotorEC,X10SA-ES-VFM:BNDU,baseline,vfm,no,yes,,
|
||||
vfm_bd,VFM Downstream Bender,MotorEC,X10SA-ES-VFM:BNDD,baseline,vfm,no,yes,,
|
||||
vfm_yaw,VFM Virtual Yaw,MotorEC,X10SA-ES-VFM:YAW,baseline,vfm,no,yes,,
|
||||
vfm_roll,VFM Virtual Roll,MotorEC,X10SA-ES-VFM:ROLL,baseline,vfm,no,yes,,
|
||||
vfm_pitch,VFM Virtual Pitch,MotorEC,X10SA-ES-VFM:PITCH,baseline,vfm,no,yes,,
|
||||
vfm_x,VFM Virtual X,MotorEC,X10SA-ES-VFM:TRX,baseline,vfm,no,yes,,
|
||||
vfm_y,VFM Virtual Y ,MotorEC,X10SA-ES-VFM:TRY,baseline,vfm,no,yes,,
|
||||
hfm_xu,HFM Upstream X,MotorEC,X10SA-ES-HFM:TRXU,baseline,hfm,no,yes,,
|
||||
hfm_xd,HFM Downstream X,MotorEC,X10SA-ES-HFM:TRXD,baseline,hfm,no,yes,,
|
||||
hfm_yuw,HFM Upstream Wall Y,MotorEC,X10SA-ES-HFM:TRYUW,baseline,hfm,no,yes,,
|
||||
hfm_yr,HFM Ring Y,MotorEC,X10SA-ES-HFM:TRYR,baseline,hfm,no,yes,,
|
||||
hfm_ydw,HFM Downstream Wall Y,MotorEC,X10SA-ES-HFM:TRYDW,baseline,hfm,no,yes,,
|
||||
hfm_bu,HFM Upstream Bender,MotorEC,X10SA-ES-HFM:BNDU,baseline,hfm,no,yes,,
|
||||
hfm_bd,HFM Downstream Bender,MotorEC,X10SA-ES-HFM:BNDD,baseline,hfm,no,yes,,
|
||||
hfm_yaw,HFM Virtual Yaw,MotorEC,X10SA-ES-HFM:YAW,baseline,hfm,no,yes,,
|
||||
hfm_roll,HFM Virtual Roll,MotorEC,X10SA-ES-HFM:ROLL,baseline,hfm,no,yes,,
|
||||
hfm_pitch,HFM Virtual Pitch,MotorEC,X10SA-ES-HFM:PITCH,baseline,hfm,no,yes,,
|
||||
hfm_x,HFM Virtual X,MotorEC,X10SA-ES-HFM:TRX,baseline,hfm,no,yes,,
|
||||
hfm_y,HFM Virtual Y ,MotorEC,X10SA-ES-HFM:TRY,baseline,hfm,no,yes,,
|
||||
bcu_bpm1,BCU BPM Channel 1 ,SignalRO,X10SA-ES-BCBPM:Current1:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
bcu_bpm2,BCU BPM Channel 2,SignalRO,X10SA-ES-BCBPM:Current2:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
bcu_bpm3,BCU BPM Channel 3,SignalRO,X10SA-ES-BCBPM:Current3:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
bcu_bpm4,BCU BPM Channel 4,SignalRO,X10SA-ES-BCBPM:Current4:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
bcu_bpmsum,BCU BPM Summed,SignalRO,X10SA-ES-BCBPM:SumAll:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
bcu_bpm_x,BCU BPM X,Motor,X10SA-ES-BCBPM:TRX,baseline,bcu,no,yes,,
|
||||
bcu_bpm_y,BCU BPM Y ,Motor,X10SA-ES-BCBPM:TRY,baseline,bcu,no,yes,,
|
||||
bcu_sl_xw,BCU Slit Wall,Motor,X10SA-ES-BCSLH:TRXW,baseline,bcu,no,yes,,
|
||||
bcu_sl_xr,BCU Slit Ring,Motor,X10SA-ES-BCSLH:TRXR,baseline,bcu,no,yes,,
|
||||
bcu_sl_xcen,BCU Slit X Centre,Motor,X10SA-ES-BCSLH:CENTER,baseline,bcu,no,yes,,
|
||||
bcu_sl_xsize,BCU Slit X Size,Motor,X10SA-ES-BCSLH:SIZE,baseline,bcu,no,yes,,
|
||||
bcu_sl_yt,BCU Slit Top,Motor,X10SA-ES-BCSLV:TRYT,baseline,bcu,no,yes,,
|
||||
bcu_sl_yb,BCU Slit Bottom,Motor,X10SA-ES-BCSLV:TRYB,baseline,bcu,no,yes,,
|
||||
bcu_sl_ycen,BCU Slit Y Centre,Motor,X10SA-ES-BCSLV:CENTER,baseline,bcu,no,yes,,
|
||||
bcu_sl_ysize,BCU Slit Y Size,Motor,X10SA-ES-BCSLV:SIZE,baseline,bcu,no,yes,,
|
||||
xrf_pos,XRF Positioner,Signal,X10SA-ES-XRF:POS-SET,baseline,se,no,no,"{""type"":positioner}",
|
||||
samcam_x,Sample Camera X ,SignalRO,X10SA-ES-MS:Stats5:CentroidX_RBV,baseline,scam,yes,yes,,
|
||||
samcam_xsig,Sample Camera X Sigma,SignalRO,X10SA-ES-MS:Stats5:SigmaX_RBV,monitored,scam,yes,yes,,
|
||||
samcam_y,Sample Camera Y ,SignalRO,X10SA-ES-MS:Stats5:CentroidY_RBV,baseline,scam,yes,yes,,
|
||||
samcam_ysig,Sample Camera Y Sigma,SignalRO,X10SA-ES-MS:Stats5:SigmaY_RBV,monitored,scam,yes,yes,,
|
||||
samcam_max,Sample Camera Max ,SignalRO,X10SA-ES-MS:Stats5:MaxValue_RBV,monitored,scam,yes,yes,,
|
||||
samcam_exp,Sample Camera Exposure,Signal,X10SA-ES-MS:cam1:AcquireTime,baseline,scam,no,yes,,
|
||||
samcam_gain,Sample Camera Gain,Signal,X10SA-ES-MS:cam1:Gain,baseline,scam,no,yes,,
|
||||
scam_zoom,Sample Camera Zoom,Motor,X10SA-ES-MS:ZOOM,baseline,scam,no,yes,,
|
||||
fl_bright,Frontlight Brightness,Signal,X10SA-ES-FL:SET,baseline,se,no,no,,
|
||||
coll_x,Collimator X,Motor,X10SA-ES-COL:TRX,baseline,se,no,yes,,
|
||||
coll_y,Collimator Y,Motor,X10SA-ES-COL:TRY,baseline,se,no,no,"{""type"": multi-position, ""in"": 41.5, ""out"": 20.0, ""park"": 0,""tol"":0.05}",
|
||||
diag_y,Scintillator/diode Y,Motor,X10SA-ES-SCL:TRY,baseline,se,no,no,"{""type"": multi-position, ""scint"": 38.62, ""i1"": 44.0, ""out"": 20.0,""park"": 0,""tol"":0.3}",
|
||||
diag_z,Scintillator/diode Z,Motor,X10SA-ES-SCL:TRZ,baseline,se,no,yes,,
|
||||
i1,I1 Diode,SignalRO,X10SA-ES-SCLDI:READOUT,monitored,bpm,yes,yes,,
|
||||
bl_pos,Backlight Positioner,Signal,X10SA-ES-BL:POS-SET,baseline,se,no,no,"{""type"":positioner}",
|
||||
bl_bright,Backlight Brightness,Signal,X10SA-ES-BL:SET,baseline,se,no,no,,
|
||||
bs_x,Beamstop X,Motor,X10SA-ES-BS:TRX,baseline,se,no,yes,,
|
||||
bs_y,Beamstop Y,Motor,X10SA-ES-BS:TRY,baseline,se,no,yes,,
|
||||
bs_z,Beamstop Z,Motor,X10SA-ES-BS:TRZ,baseline,se,no,no,"{""type"": guarded, ""min"": 13, ""samp"": 15, ""work_min"": 20, ""safe"": 41, ""max_blin"": 42, ""max_blout"": 70}",
|
||||
bs_pos,Beamstop Positioner,Signal,X10SA-ES-BS:POS-SET,baseline,se,no,no,"{""type"":positioner}",
|
||||
gon_x,Goniometer X,Motor,X10SA-ES-DF1:TRX1,baseline,det,no,no,"{""type"": guarded, ""in"": 18.0, ""out"": -10.0, ""safe"": -100,""tol"":0.5}",
|
||||
gon_y,Goniometer Y,Motor,X10SA-ES-DF1:TRY1,baseline,det,no,yes,,
|
||||
gon_z,Goniometer X,Motor,X10SA-ES-DF1:TRZ1,baseline,det,no,yes,,
|
||||
omega,Omega,Motor,X10SA-ES-DF1:ROTU,baseline,det,no,yes,,
|
||||
cryo_pos,Cryo positioner,Signal,X10SA-ES-CS:POS-SET,baseline,se,no,no,"{""type"":positioner}",
|
||||
cryo_x,Cryo X ,Motor,X10SA-ES-CS:TRX,baseline,se,no,yes,,
|
||||
cryo_temp,Cryo Temperature,Signal,X10SA-ES-CS:TEMP_RBV,baseline,se,yes,yes,,
|
||||
det_xi_focus,X-ray Eye 2 Focus,Motor,X10SA-ES-XEYE:FOCUS,baseline,det,no,yes,,
|
||||
det_xi_zoom,X-ray Eye 2 Zoom,Motor,X10SA-ES-XEYE:ZOOM,baseline,det,no,yes,,
|
||||
det_xi_x,X-ray Eye X,Motor,X10SA-ES-XEYE:TRX,baseline,det,no,yes,,
|
||||
i2,I2 Diode,SignalRO,X10SA-ES-XEYEDI:READOUT,monitored,bpm,yes,yes,,
|
||||
det_xicam_x,Det Camera X ,SignalRO,X10SA-ES-XEYE:cam1:Stats5:CentroidX_RBV,baseline,scam,yes,no,,
|
||||
det_xicam_xsig,Det Camera X Sigma,SignalRO,X10SA-ES-XEYE:cam1:Stats5:SigmaX_RBV,monitored,scam,yes,no,,
|
||||
det_xicam_y,Det Camera Y ,SignalRO,X10SA-ES-XEYE:cam1:Stats5:CentroidY_RBV,baseline,scam,yes,no,,
|
||||
det_xicam_ysig,Det Camera Y Sigma,SignalRO,X10SA-ES-XEYE:cam1:Stats5:SigmaY_RBV,monitored,scam,yes,no,,
|
||||
det_xicam_max,Det Camera Max,SignalRO,X10SA-ES-XEYE:cam1:Stats5:MaxValue_RBV,monitored,scam,yes,no,,
|
||||
det_xicam_exp,Det Camera Exposure,Signal,X10SA-ES-XEYE:cam1:cam1:AcquireTime,baseline,scam,no,no,,
|
||||
det_xicam_gain,Det Camera Gain,Signal,X10SA-ES-XEYE:cam1:cam1:Gain,baseline,Sigma,no,no,,
|
||||
det_cov,Detector Cover,Signal,X10SA-ES-DETCOV:SET,baseline,det,no,no,"{""type"":positioner}",
|
||||
det_y,Detector Y,Motor,X10SA-ES-DET:TRY,baseline,det,no,yes,,
|
||||
det_z,Detector Z,Motor,X10SA-ES-DET:TRZ,baseline,det,no,yes,,
|
||||
|
@@ -0,0 +1,18 @@
|
||||
aerotech_x:
|
||||
userParameter: {"type": continuous, "in": 0.0, "out": -10.0, "safe": -50, "tol": 0.5}
|
||||
aerotech_y:
|
||||
userParameter: {"type": continuous, "mount": 0.0, "work": 0.01, "tol": 0.002}
|
||||
aerotech_z:
|
||||
userParameter: {"type": continuous, "mount": 0.0, "work": 0.02, "tol": 0.01}
|
||||
aerotech_u:
|
||||
userParameter: {"type": continuous, "mount": 0.0}
|
||||
smargon_x:
|
||||
userParameter: {"type": continuous, "mount": 0.0}
|
||||
smargon_y:
|
||||
userParameter: {"type": continuous, "mount": 0.0}
|
||||
smargon_z:
|
||||
userParameter: {"type": continuous, "mount": 18.0}
|
||||
smargon_chi:
|
||||
userParameter: {"type": continuous, "mount": 0.0}
|
||||
smargon_phi:
|
||||
userParameter: {"type": continuous, "mount": 0.0}
|
||||
+41
-5
@@ -839,7 +839,7 @@ ss_sl_ysize:
|
||||
softwareTrigger: false
|
||||
|
||||
ss_xi_x:
|
||||
description: SS X-ray eye X
|
||||
description: SS X-ray Eye X
|
||||
deviceClass: ophyd_devices.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-ES-SSXI:TRX'}
|
||||
onFailure: buffer
|
||||
@@ -852,7 +852,7 @@ ss_xi_x:
|
||||
userParameter: {"type": multi-position,"in": 7.5, "out": -2.1}
|
||||
|
||||
ss_xi_y:
|
||||
description: SS X-ray eye Y
|
||||
description: SS X-ray Eye Y
|
||||
deviceClass: ophyd_devices.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-ES-SSXI:TRY'}
|
||||
onFailure: buffer
|
||||
@@ -1523,6 +1523,42 @@ omega:
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
|
||||
mag_ok:
|
||||
description: Sample Sensor Check
|
||||
deviceClass: ophyd.EpicsSignalRO
|
||||
deviceConfig: {read_pv: 'X10SA-ES-DFS:CBOX-CMP1', auto_monitor: true}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- se
|
||||
readOnly: True
|
||||
softwareTrigger: false
|
||||
|
||||
mag_rbv:
|
||||
description: Sample Sensor RBV
|
||||
deviceClass: ophyd.EpicsSignalRO
|
||||
deviceConfig: {read_pv: 'X10SA-ES-DFS:CBOX-USER1', auto_monitor: true}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- se
|
||||
readOnly: True
|
||||
softwareTrigger: false
|
||||
|
||||
mag_ref:
|
||||
description: Sample Sensor Reference
|
||||
deviceClass: ophyd.EpicsSignalRO
|
||||
deviceConfig: {read_pv: 'X10SA-ES-DFS:CBOX-REFVAL1', auto_monitor: true}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- se
|
||||
readOnly: True
|
||||
softwareTrigger: false
|
||||
|
||||
cryo_x:
|
||||
description: Cryo X
|
||||
deviceClass: ophyd_devices.EpicsMotor
|
||||
@@ -1548,7 +1584,7 @@ cryo_temp:
|
||||
softwareTrigger: false
|
||||
|
||||
det_xi_focus:
|
||||
description: X-ray eye 2 Focus
|
||||
description: X-ray Eye 2 Focus
|
||||
deviceClass: ophyd_devices.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-ES-XEYE:FOCUS'}
|
||||
onFailure: buffer
|
||||
@@ -1560,7 +1596,7 @@ det_xi_focus:
|
||||
softwareTrigger: false
|
||||
|
||||
det_xi_zoom:
|
||||
description: X-ray eye 2 Zoom
|
||||
description: X-ray Eye 2 Zoom
|
||||
deviceClass: ophyd_devices.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-ES-XEYE:ZOOM'}
|
||||
onFailure: buffer
|
||||
@@ -1572,7 +1608,7 @@ det_xi_zoom:
|
||||
softwareTrigger: false
|
||||
|
||||
det_xi_x:
|
||||
description: X-ray eye X
|
||||
description: X-ray Eye X
|
||||
deviceClass: ophyd_devices.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-ES-XEYE:TRX'}
|
||||
onFailure: buffer
|
||||
+97
-173
@@ -1,159 +1,3 @@
|
||||
ss_sl_xw:
|
||||
description: SS slit wall
|
||||
deviceClass: ophyd_devices.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-ES-SSSLH:TRXW'}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- ss
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter:
|
||||
type: continuous
|
||||
in: 1.0
|
||||
out: 2.0
|
||||
|
||||
bs_z:
|
||||
description: Beamstop Z
|
||||
deviceClass: ophyd_devices.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-ES-BS:TRZ'}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- se
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter:
|
||||
type: continuous
|
||||
min: 13
|
||||
samp: 15
|
||||
work_min: 20
|
||||
safe: 41
|
||||
max_blin: 42
|
||||
max_blout: 70
|
||||
|
||||
gon_x:
|
||||
description: Goniometer X
|
||||
deviceClass: ophyd_devices.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-ES-DF1:TRX1'}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- det
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter:
|
||||
type: continuous
|
||||
in: 0.0
|
||||
out: -10.0
|
||||
safe: -100
|
||||
tol: 0.5
|
||||
|
||||
diag_y:
|
||||
description: Scintillator/diode Y
|
||||
deviceClass: ophyd_devices.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-ES-SCL:TRY'}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- se
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter:
|
||||
type: continuous
|
||||
scint: 38.62
|
||||
i1: 44.0
|
||||
out: 20.0
|
||||
park: 1
|
||||
tol: 0.3
|
||||
|
||||
coll_y:
|
||||
description: Collimator Y
|
||||
deviceClass: ophyd_devices.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-ES-COL:TRY'}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- se
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter:
|
||||
type: continuous
|
||||
in: 41.5
|
||||
intermediate: 32
|
||||
out: 20.0
|
||||
park: 1
|
||||
tol: 0.05
|
||||
|
||||
bs_pos:
|
||||
description: Beamstop Positioner
|
||||
deviceClass: ophyd.EpicsSignal
|
||||
deviceConfig: {read_pv: 'X10SA-ES-BS:POS-SET', auto_monitor: true}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- se
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter:
|
||||
type: discrete
|
||||
in: 1.0
|
||||
out: 0.0
|
||||
|
||||
xrf_pos:
|
||||
description: XRF Positioner
|
||||
deviceClass: ophyd.EpicsSignal
|
||||
deviceConfig: {read_pv: 'X10SA-ES-XRF:POS-SET', auto_monitor: true}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- se
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter:
|
||||
type: discrete
|
||||
in: 1.0
|
||||
out: 0.0
|
||||
|
||||
cryo_pos:
|
||||
description: Cryo Positioner
|
||||
deviceClass: ophyd.EpicsSignal
|
||||
deviceConfig: {read_pv: 'X10SA-ES-CS:POS-SET', auto_monitor: true}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- se
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter:
|
||||
type: discrete
|
||||
in: 1.0
|
||||
out: 0.0
|
||||
|
||||
det_cov:
|
||||
description: Detector Cover
|
||||
deviceClass: ophyd.EpicsSignal
|
||||
deviceConfig: {read_pv: 'X10SA-ES-DETCOV:SET', auto_monitor: true}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- det
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter:
|
||||
type: discrete
|
||||
'open': 2.0
|
||||
'close': 1.0
|
||||
|
||||
bl_bright:
|
||||
description: Backlight Brightness
|
||||
deviceClass: ophyd.EpicsSignal
|
||||
@@ -162,15 +6,10 @@ bl_bright:
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- se
|
||||
- state
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter:
|
||||
type: continuous
|
||||
'on': 1.3
|
||||
'off': 0.0
|
||||
'tol': 0.01
|
||||
|
||||
userParameter: {"type": continuous, "on": 1.3, "off": 0.0, "tol": 0.01}
|
||||
|
||||
bl_pos:
|
||||
description: Backlight Positioner
|
||||
@@ -180,13 +19,88 @@ bl_pos:
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- se
|
||||
- state
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter:
|
||||
type: discrete
|
||||
in: 1.0
|
||||
out: 0.0
|
||||
userParameter: {"type":discrete, "in": 1, "out": 0}
|
||||
|
||||
bs_pos:
|
||||
description: Beamstop Positioner
|
||||
deviceClass: ophyd.EpicsSignal
|
||||
deviceConfig: {read_pv: 'X10SA-ES-BS:POS-SET', auto_monitor: true}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- state
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter: {"type":discrete, "in": 1, "out": 0}
|
||||
|
||||
bs_z:
|
||||
description: Beamstop Z
|
||||
deviceClass: ophyd_devices.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-ES-BS:TRZ'}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- state
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter: {"type": continuous, "min": 13, "samp": 15, "work_min": 20, "safe": 41, "max_blin": 42, "max_blout": 70}
|
||||
|
||||
coll_y:
|
||||
description: Collimator Y
|
||||
deviceClass: ophyd_devices.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-ES-COL:TRY'}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- state
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter: {"type": continuous, "in": 41.5, "out": 20.0, "intermediate": 32, "park": 1,"tol":0.05}
|
||||
|
||||
cryo_pos:
|
||||
description: Cryo positioner
|
||||
deviceClass: ophyd.EpicsSignal
|
||||
deviceConfig: {read_pv: 'X10SA-ES-CS:POS-SET', auto_monitor: true}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- state
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter: {"type":discrete, "in": 1, "out": 0}
|
||||
|
||||
det_cov:
|
||||
description: Detector cover
|
||||
deviceClass: ophyd.EpicsSignal
|
||||
deviceConfig: {read_pv: 'X10SA-ES-DETCOV:SET', auto_monitor: true}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- state
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter: {"type":discrete, "open": 2, "close": 1}
|
||||
|
||||
diag_y:
|
||||
description: Scintillator/diode Y
|
||||
deviceClass: ophyd_devices.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-ES-SCL:TRY'}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- state
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter: {"type": continuous, "scint": 38.62, "i1": 44.0, "out": 20.0,"park": 1,"tol":0.3}
|
||||
|
||||
fl_bright:
|
||||
description: Frontlight Brightness
|
||||
@@ -196,11 +110,21 @@ fl_bright:
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- se
|
||||
- state
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter:
|
||||
type: continuous
|
||||
'on': 3.0
|
||||
'off': 0.0
|
||||
userParameter: {"type": continuous, "on": 3.0, "off": 0.0, "tol": 0.01}
|
||||
|
||||
xrf_pos:
|
||||
description: XRF Positioner
|
||||
deviceClass: ophyd.EpicsSignal
|
||||
deviceConfig: {read_pv: 'X10SA-ES-XRF:POS-SET', auto_monitor: true}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- state
|
||||
readOnly: False
|
||||
softwareTrigger: false
|
||||
userParameter: {"type":discrete, "in": 1, "out": 0}
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
name,description,deviceClass,PV,readoutPriority,tag,readOnly,include,userParameter,
|
||||
sls_current,SLS current,SignalRO,ARS07-DPCT-0100:CURR,monitored,SLS,yes,yes,,
|
||||
fe_sl_xr,FE Slit X Ring,Motor,X06DA-FE-SLDI:TRXR,baseline,fe,no,yes,,
|
||||
fe_sl_yt,FE Slit Y top,Motor,X06DA-FE-SLDI:TRYT,baseline,fe,no,yes,,
|
||||
fe_sl_xw,FE Slit X Wall,Motor,X06DA-FE-SLDI:TRXW,baseline,fe,no,yes,,
|
||||
fe_sl_yb,FE SlitY Bottom,Motor,X06DA-FE-SLDI:TRYB,baseline,fe,no,yes,,
|
||||
fe_sl_xcen,FE Slit X Centre,Motor,X06DA-FE-SLDI:CENTERX,baseline,fe,no,yes,,
|
||||
fe_sl_xsize,FE Slit X Size,Motor,X06DA-FE-SLDI:SIZEX,baseline,fe,no,yes,,
|
||||
fe_sl_ycen,FE Slit Y Centre,Motor,X06DA-FE-SLDI:CENTERY,baseline,fe,no,yes,,
|
||||
fe_sl_ysize,FE Slit Y Size,Motor,X06DA-FE-SLDI:SIZEY,baseline,fe,no,yes,,
|
||||
fe_cm_xu,FE Coll Mirror Upstream X,Motor,X06DA-ES-MI1:TRXU,baseline,fe_cm,no,yes,,
|
||||
fe_cm_xd,FE Coll Mirror Downstream X,Motor,X06DA-ES-MI1:TRXD,baseline,fe_cm,no,yes,,
|
||||
fe_cm_yur,FE Coll Mirror Upstream Ring Y,Motor,X06DA-ES-MI1:TRYUR,baseline,fe_cm,no,yes,,
|
||||
fe_cm_yw,FE Coll Mirror Wall Y,Motor,X06DA-ES-MI1:TRYW,baseline,fe_cm,no,yes,,
|
||||
fe_cm_ydr,FE Coll Mirror Downstream Ring Y,Motor,X06DA-ES-MI1:TRYDR,baseline,fe_cm,no,yes,,
|
||||
fe_cm_b1,FE Coll Mirror Bender,Motor,X06DA-ES-MI1:BND1,baseline,fe_cm,no,yes,,
|
||||
fe_cm_yaw,FE Coll Mirror Yaw,Motor,X06DA-ES-MI1:YAW,baseline,fe_cm,no,yes,,
|
||||
fe_cm_roll,FE Coll Mirror Roll,Motor,X06DA-ES-MI1:ROLL,baseline,fe_cm,no,yes,,
|
||||
fe_cm_pitch,FE Coll Mirror Pitch,Motor,X06DA-ES-MI1:PITCH,baseline,fe_cm,no,yes,,
|
||||
fe_cm_x,FE Coll Mirror X,Motor,X06DA-ES-MI1:TRX,baseline,fe_cm,no,yes,,
|
||||
fe_cm_y,FE Coll Mirror Y ,Motor,X06DA-ES-MI1:TRY,baseline,fe_cm,no,yes,,
|
||||
bsf_bpm1,BSF BPM Signal 1,SignalRO,X06DA-OP-BSFBPM:SIGNAL1,monitored,bpm,yes,no,,
|
||||
bsf_bpm2,BSF BPM Signal 2,SignalRO,X06DA-OP-BSFBPM:SIGNAL2,monitored,bpm,yes,no,,
|
||||
bsf_bpm3,BSF BPM Signal 3,SignalRO,X06DA-OP-BSFBPM:SIGNAL3,monitored,bpm,yes,no,,
|
||||
bsf_bpm4,BSF BPM Signal 4,SignalRO,X06DA-OP-BSFBPM:SIGNAL4,monitored,bpm,yes,no,,
|
||||
bsf_bpmsum,BSF BPM Summed,SignalRO,X06DA-OP-BSFBPM:SUM,monitored,bpm,yes,no,,
|
||||
bsf_sl_xw,BSF slit outboard,Motor,X06DA-OP-BSFSLH:TRXW,baseline,bsf,no,yes,,
|
||||
bsf_sl_xr,BSF slit inboard,Motor,X06DA-OP-BSFSLH:TRXR,baseline,bsf,no,yes,,
|
||||
bsf_sl_yt,BSF slit top,Motor,X06DA-OP-BSFSLV:TRYT,baseline,bsf,no,yes,,
|
||||
bsf_sl_yb,BSF slit bottom,Motor,X06DA-OP-BSFSLV:TRYB,baseline,bsf,no,yes,,
|
||||
bsf_sl_xcen,BSF X centre,Motor,X06DA-OP-BSFSLH:CENTER,baseline,bsf,no,yes,,
|
||||
bsf_sl_xsize,BSF X size,Motor,X06DA-OP-BSFSLH:SIZE,baseline,bsf,no,yes,,
|
||||
bsf_sl_ycen,BSF Y centre,Motor,X06DA-OP-BSFSLV:CENTER,baseline,bsf,no,yes,,
|
||||
bsf_sl_ysize,BSF Y size,Motor,X06DA-OP-BSFSLV:SIZE,baseline,bsf,no,yes,,
|
||||
bsf_f1_y,BSF Filter 1 Y,Motor,X06DA-OP-BSFFI1:TRY,baseline,bsf,no,yes,,
|
||||
bsf_f2_y,BSF Filter 2 Y,Motor,X06DA-OP-BSFFI2:TRY,baseline,bsf,no,yes,,
|
||||
dccm_theta1,DCCM theta1,Motor,X06DA-OP-DCCM:ROTX-CR1,baseline,dccm,no,yes,,
|
||||
dccm_theta2,DCCM theta2,Motor,X06DA-OP-DCCM:ROTX-CR2,baseline,dccm,no,yes,,
|
||||
dccm_rotz,DCCM Crystal 2 rotz ,Motor,X06DA-OP-DCCM:ROTZ-CR2,baseline,dccm,no,yes,,
|
||||
dccm_energy,DCCM energy,Motor,X06DA-OP-DCCM:ENERGY,baseline,dccm,no,yes,,
|
||||
dccm_diode_t,Top diode between mono crystals,SignalRO,X06DA-OP-XPM1:TOP:READOUT,baseline,dccm,no,yes,,
|
||||
dccm_diode_b,Bottom diode between mono crystals,SignalRO,X06DA-OP-XPM1:BOT:READOUT,baseline,dccm,no,yes,,
|
||||
dccm_xbpm1,XBPM after mono ch1,SignalRO,X06DA-OP-XBPM1:Current1:MeanValue_RBV,baseline,dccm,no,yes,,
|
||||
dccm_xbpm2,XBPM after mono ch2,SignalRO,X06DA-OP-XBPM1:Current2:MeanValue_RBV,baseline,dccm,no,yes,,
|
||||
dccm_xbpm3,XBPM after mono ch3,SignalRO,X06DA-OP-XBPM1:Current3:MeanValue_RBV,baseline,dccm,no,yes,,
|
||||
dccm_xbpm4,XBPM after mono ch4,SignalRO,X06DA-OP-XBPM1:Current4:MeanValue_RBV,baseline,dccm,no,yes,,
|
||||
dccm_xbpmsum,XBPM after mono summed,SignalRO,X06DA-OP-XBPM1:SumAll:MeanValue_RBV,baseline,dccm,no,yes,,
|
||||
ss_bpm1,SS BPM Signal 1,SignalRO,X06DA-ES-SSBPM:Current1:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
ss_bpm2,SS BPM Signal 2,SignalRO,X06DA-ES-SSBPM:Current2:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
ss_bpm3,SS BPM Signal 3,SignalRO,X06DA-ES-SSBPM:Current3:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
ss_bpm4,SS BPM Signal 4,SignalRO,X06DA-ES-SSBPM:Current4:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
ss_bpmsum,SS BPM Summed,SignalRO,X06DA-ES-SSBPM:SumAll:MeanValue_RBV,monitored,bpm,yes,yes,,
|
||||
ss_bpm_x,SS BPM X,Motor,X06DA-ES-SSBPM:TRX,baseline,ss,no,yes,,
|
||||
ss_bpm_y,SS BPM Y,Motor,X06DA-ES-SSBPM:TRY,baseline,ss,no,yes,,
|
||||
ss_sl_xw,SS slit wall,Motor,X06DA-ES-SSSLH:TRXW,baseline,ss,no,yes,,
|
||||
ss_sl_xr,SS slit ring,Motor,X06DA-ES-SSSLH:TRXR,baseline,ss,no,yes,,
|
||||
ss_sl_xcen,SS slit X centre,Motor,X06DA-ES-SSSLH:CENTER,baseline,ss,no,yes,,
|
||||
ss_sl_xsize,SS slit X size,Motor,X06DA-ES-SSSLH:SIZE,baseline,ss,no,yes,,
|
||||
ss_sl_yt,SS slit top,Motor,X06DA-ES-SSSLV:TRYT,baseline,ss,no,yes,,
|
||||
ss_sl_yb,SS slit bottom,Motor,X06DA-ES-SSSLV:TRYB,baseline,ss,no,yes,,
|
||||
ss_sl_ycen,SS slit Y centre,Motor,X06DA-ES-SSSLV:CENTER,baseline,ss,no,yes,,
|
||||
ss_sl_ysize,SS slit Y size,Motor,X06DA-ES-SSSLV:SIZE,baseline,ss,no,yes,,
|
||||
ss_xi_x,SS X-ray eye X,Motor,X06DA-ES-SSXI:TRX,baseline,ss,no,yes,,
|
||||
ss_xi_y,SS X-ray eye Y,Motor,X06DA-ES-SSXI:TRY,baseline,ss,no,yes,,
|
||||
ss_xicam_x,ss cam X,SignalRO,X06DA-ES-SSXI:cam1:Stats5:CentroidX_RBV,baseline,ss,yes,yes,,
|
||||
ss_xicam_y,ss cam Y,SignalRO,X06DA-ES-SSXI:cam1:Stats5:CentroidY_RBV,baseline,ss,yes,yes,,
|
||||
ss_xicam_max,ss cam max value,SignalRO,X06DA-ES-SSXI:cam1:Stats5:MaxValue_RBV,monitored,ss,yes,yes,,
|
||||
ss_xicam_exp,ss camera exposure,Signal,X06DA-ES-SSXI:cam1:AcquireTime,baseline,ss,no,yes,,
|
||||
ss_xicam_gain,ss camera gain,Signal,X06DA-ES-SSXI:cam1:cam1:Gain,baseline,ss,no,yes,,
|
||||
ss_xicam_xsig,ss camera x sigma,Signal,X06DA-ES-SSXI:cam1:Stats5:SigmaX_RBV,baseline,ss,yes,yes,,
|
||||
ss_xicam_ysig,ss camera y sigma,Signal,X06DA-ES-SSXI:cam1:Stats5:SigmaY_RBV,baseline,ss,yes,yes,,
|
||||
vfm_xu,VFM Upstream X,Motor,X06DA-ES-KBV:TRXU,baseline,vfm,no,no,,
|
||||
vfm_xd,VFM Downstream X,Motor,X06DA-ES-KBV:TRXD,baseline,vfm,no,no,,
|
||||
vfm_yur,VFM Upstream Ring Y,Motor,X06DA-ES-KBV:TRYUR,baseline,vfm,no,no,,
|
||||
vfm_yw,VFM Wall Y,Motor,X06DA-ES-KBV:TRYW,baseline,vfm,no,no,,
|
||||
vfm_ydr,VFM Downstream Ring Y,Motor,X06DA-ES-KBV:TRYDR,baseline,vfm,no,no,,
|
||||
vfm_bu,VFM Upstream Bender,Motor,X06DA-ES-KBV:BNDU,baseline,vfm,no,no,,
|
||||
vfm_bd,VFM Downstream Bender,Motor,X06DA-ES-KBV:BNDD,baseline,vfm,no,no,,
|
||||
vfm_yaw,VFM Virtual Yaw,Motor,X06DA-ES-KBV:YAW,baseline,vfm,no,no,,
|
||||
vfm_roll,VFM Virtual Roll,Motor,X06DA-ES-KBV:ROLL,baseline,vfm,no,no,,
|
||||
vfm_pitch,VFM Virtual Pitch,Motor,X06DA-ES-KBV:PITCH,baseline,vfm,no,no,,
|
||||
vfm_x,VFM Virtual X,Motor,X06DA-ES-KBV:TRX,baseline,vfm,no,no,,
|
||||
vfm_y,VFM Virtual Y ,Motor,X06DA-ES-KBV:TRY,baseline,vfm,no,no,,
|
||||
hfm_xu,HFM Upstream X,Motor,X06DA-ES-KBH:TRXU,baseline,hfm,no,no,,
|
||||
hfm_xd,HFM Downstream X,Motor,X06DA-ES-KBH:TRXD,baseline,hfm,no,no,,
|
||||
hfm_yuw,HFM Upstream Wall Y,Motor,X06DA-ES-KBH:TRYUW,baseline,hfm,no,no,,
|
||||
hfm_yr,HFM Ring Y,Motor,X06DA-ES-KBH:TRYR,baseline,hfm,no,no,,
|
||||
hfm_ydw,HFM Downstream Wall Y,Motor,X06DA-ES-KBH:TRYDW,baseline,hfm,no,no,,
|
||||
hfm_bu,HFM Upstream Bender,Motor,X06DA-ES-KBH:BNDU,baseline,hfm,no,no,,
|
||||
hfm_bd,HFM Downstream Bender,Motor,X06DA-ES-KBH:BNDD,baseline,hfm,no,no,,
|
||||
hfm_yaw,HFM Virtual Yaw,Motor,X06DA-ES-KBH:YAW,baseline,hfm,no,no,,
|
||||
hfm_roll,HFM Virtual Roll,Motor,X06DA-ES-KBH:ROLL,baseline,hfm,no,no,,
|
||||
hfm_pitch,HFM Virtual Pitch,Motor,X06DA-ES-KBH:PITCH,baseline,hfm,no,no,,
|
||||
hfm_x,HFM Virtual X,Motor,X06DA-ES-KBH:TRX,baseline,hfm,no,no,,
|
||||
hfm_y,HFM Virtual Y ,Motor,X06DA-ES-KBH:TRY,baseline,hfm,no,no,,
|
||||
bcu_bpm1,BCU BPM Signal 1 ,SignalRO,X06DA-ES-BCBPM:Current1:MeanValue_RBV,monitored,bpm,yes,no,,
|
||||
bcu_bpm2,BCU BPM Signal 2,SignalRO,X06DA-ES-BCBPM:Current2:MeanValue_RBV,monitored,bpm,yes,no,,
|
||||
bcu_bpm3,BCU BPM Signal 3,SignalRO,X06DA-ES-BCBPM:Current3:MeanValue_RBV,monitored,bpm,yes,no,,
|
||||
bcu_bpm4,BCU BPM Signal 4,SignalRO,X06DA-ES-BCBPM:Current4:MeanValue_RBV,monitored,bpm,yes,no,,
|
||||
bcu_bpmsum,BCU BPM Summed,SignalRO,X06DA-ES-BCBPM:SumAll:MeanValue_RBV,monitored,bpm,yes,no,,
|
||||
bcu_bpm_x,BCU BPM X,Motor,X06DA-ES-BCBPM:TRX,baseline,bcu,no,no,,
|
||||
bcu_bpm_y,BCU BPM Y ,Motor,X06DA-ES-BCBPM:TRY,baseline,bcu,no,no,,
|
||||
bcu_sl_xw,BCU slit wall,Motor,X06DA-ES-BCSLH:TRXW,baseline,bcu,no,no,,
|
||||
bcu_sl_xr,BCU slit ring,Motor,X06DA-ES-BCSLH:TRXR,baseline,bcu,no,no,,
|
||||
bcu_sl_xcen,BCU slit X centre,Motor,X06DA-ES-BCSLH:CENTER,baseline,bcu,no,no,,
|
||||
bcu_sl_xsize,BCU slit X size,Motor,X06DA-ES-BCSLH:SIZEX,baseline,bcu,no,no,,
|
||||
bcu_sl_yt,BCU slit top,Motor,X06DA-ES-BCSLV:TRYT,baseline,bcu,no,no,,
|
||||
bcu_sl_yb,BCU slit bottom,Motor,X06DA-ES-BCSLV:TRYB,baseline,bcu,no,no,,
|
||||
bcu_sl_ycen,BCU slit Y centre,Motor,X06DA-ES-BCSLV:CENTER,baseline,bcu,no,no,,
|
||||
bcu_sl_ysize,BCU slit Y size,Motor,X06DA-ES-BCSLV:SIZE,baseline,bcu,no,no,,
|
||||
bcu_f1_x,BCU filter 1 X,Motor,X06DA-ES-BCFI1:TRX,baseline,bcu,no,no,,
|
||||
bcu_f2_x,BCU filter 2 X,Motor,X06DA-ES-BCFI2:TRX,baseline,bcu,no,no,,
|
||||
bcu_f3_x,BCU filter 3 X,Motor,X06DA-ES-BCFI3:TRX,baseline,bcu,no,no,,
|
||||
bcu_f4_x,BCU filter 4 X,Motor,X06DA-ES-BCFI4:TRX,baseline,bcu,no,no,,
|
||||
xrf_pos,XRF det in/out,Signal,X06DA-ES-XRF:POS-SET,baseline,se,no,yes,"{""type"":positioner}",
|
||||
samcam_x,sample cam X ,SignalRO,X06DA-ES-MS:Stats5:CentroidX_RBV,baseline,scam,yes,yes,,
|
||||
samcam_xsig,sample cam X sigma,SignalRO,X06DA-ES-MS:Stats5:SigmaX_RBV,monitored,scam,yes,yes,,
|
||||
samcam_y,sample cam Y ,SignalRO,X06DA-ES-MS:Stats5:CentroidY_RBV,baseline,scam,yes,yes,,
|
||||
samcam_ysig,sample cam Y sigma,SignalRO,X06DA-ES-MS:Stats5:SigmaY_RBV,monitored,scam,yes,yes,,
|
||||
samcam_max,sample cam max value,SignalRO,X06DA-ES-MS:Stats5:MaxValue_RBV,monitored,scam,yes,yes,,
|
||||
samcam_exp,sample cam exp time,Signal,X06DA-ES-MS:cam1:AcquireTime,baseline,scam,no,yes,,
|
||||
samcam_gain,sample cam gain,Signal,X06DA-ES-MS:cam1:Gain,baseline,scam,no,yes,,
|
||||
scam_zoom,Sample cam zoom,Motor,X06DA-ES-MS:ZOOM,baseline,scam,no,yes,,
|
||||
fl_bright,Frontlight brightness,Signal,X06DA-ES-FL:SET,baseline,se,no,yes,,
|
||||
coll_x,Collimator X,Motor,X06DA-ES-COL:TRX,baseline,se,no,yes,,
|
||||
coll_y,Collimator Y,Motor,X06DA-ES-COL:TRY,baseline,se,no,yes,"{""type"": multi-position, ""in"": 41.5, ""out"": 20.0, ""park"": 0,""tol"":0.05}",
|
||||
diag_y,Scintillator/diode Y,Motor,X06DA-ES-SCL:TRY,baseline,se,no,yes,"{""type"": multi-position, ""scint"": 38.62, ""i1"": 44.0, ""out"": 20.0,""park"": 0,""tol"":0.3}",
|
||||
diag_z,Scintillator/diode Z,Motor,X06DA-ES-SCL:TRZ,baseline,se,no,yes,,
|
||||
i1,i1 diode reading,SignalRO,X06DA-ES-SCLDI:READOUT,monitored,bpm,yes,yes,,
|
||||
bl_pos,Backlight positioner,Signal,X06DA-ES-BL:POS-SET,baseline,se,no,yes,"{""type"":positioner}",
|
||||
bl_bright,Backlight brightness,Signal,X06DA-ES-BL:SET,baseline,se,no,yes,,
|
||||
bs_x,Beamstop X,Motor,X06DA-ES-BS:TRX,baseline,se,no,yes,,
|
||||
bs_y,Beamstop Y,Motor,X06DA-ES-BS:TRY,baseline,se,no,yes,,
|
||||
bs_z,Beamstop Z,Motor,X06DA-ES-BS:TRZ,baseline,se,no,yes,"{""type"": guarded, ""min"": 13, ""samp"": 15, ""work_min"": 20, ""safe"": 41, ""max_blin"": 42, ""max_blout"": 70}",
|
||||
bs_pos,Beamstop positioner,Signal,X06DA-ES-BS:POS-SET,baseline,se,no,yes,"{""type"":positioner}",
|
||||
gon_x,Goniometer X,Motor,X06DA-ES-DF1:TRX1,baseline,det,no,yes,"{""type"": guarded, ""in"": 18.0, ""out"": -10.0, ""safe"": -100,""tol"":0.5}",
|
||||
gon_y,Goniometer Y,Motor,X06DA-ES-DF1:TRY1,baseline,det,no,yes,,
|
||||
gon_z,Goniometer X,Motor,X06DA-ES-DF1:TRZ1,baseline,det,no,yes,,
|
||||
omega,Omega,Motor,X06DA-ES-DF1:ROTU,baseline,det,no,yes,,
|
||||
cryo_pos,Cryo positioner,Signal,X06DA-ES-CS:POS-SET,baseline,se,no,yes,"{""type"":positioner}",
|
||||
cryo_x,Cryojet X ,Motor,X06DA-ES-CS:TRX,baseline,se,no,yes,,
|
||||
det_cov,Detector cover,Signal,X06DA-ES-DETCOV:SET,baseline,det,no,yes,"{""type"":positioner}",
|
||||
det_y,Detector Y,Motor,X06DA-ES-DET:TRY,baseline,det,no,yes,,
|
||||
det_z,Detector Z,Motor,X06DA-ES-DET:TRZ,baseline,det,no,yes,,
|
||||
gonpos,Sample sensor distance,SignalRO,X06DA-ES-DF1:CBOX-USER1,baseline,se,no,yes,,
|
||||
gonvalid,Sample in valid distance,SignalRO,X06DA-ES-DF1:CBOX-CMP1,baseline,se,no,yes,,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
base_config:
|
||||
- !include ./pxii-devices-new.yaml
|
||||
- !include ./pxii-standard-devices.yaml
|
||||
sample_env:
|
||||
- !include ./se_devices.yaml
|
||||
id_gap:
|
||||
@@ -25,3 +25,16 @@ smargon:
|
||||
- motors
|
||||
readOnly: false
|
||||
softwareTrigger: false
|
||||
|
||||
aerotech:
|
||||
description: REST-based device which connects to AareScan and Aerotech
|
||||
deviceClass: pxii_bec.devices.aerotech.Aerotech
|
||||
deviceConfig: {prefix: 'http://mx-x10sa-queue-01:5234'}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- aerotech
|
||||
- motors
|
||||
readOnly: false
|
||||
softwareTrigger: false
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
base_config:
|
||||
- !include ./pxii-autogenerated.yaml
|
||||
id_gap:
|
||||
readoutPriority: baseline
|
||||
description: undulator gap
|
||||
deviceClass: pxii_bec.devices.undulator.UndulatorGap
|
||||
deviceConfig:
|
||||
prefix: 'X10SA-UIND:'
|
||||
onFailure: buffer
|
||||
enabled: true
|
||||
readOnly: false
|
||||
softwareTrigger: false
|
||||
coll_x:
|
||||
description: Collimator X
|
||||
deviceClass: ophyd.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-ES-COL:TRX'}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- se
|
||||
readOnly: false
|
||||
softwareTrigger: false
|
||||
dcm_fpitch:
|
||||
description: DCM 2nd crystal fine pitch
|
||||
deviceClass: ophyd.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-OP-DCM:PITCH-C2'}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- dcm
|
||||
readOnly: false
|
||||
softwareTrigger: false
|
||||
dcm_froll:
|
||||
description: DCM 2nd crystal fine roll
|
||||
deviceClass: ophyd.EpicsMotor
|
||||
deviceConfig: {prefix: 'X10SA-OP-DCM:ROLL-C2'}
|
||||
onFailure: buffer
|
||||
enabled: True
|
||||
readoutPriority: baseline
|
||||
deviceTags:
|
||||
- dcm
|
||||
readOnly: false
|
||||
softwareTrigger: false
|
||||
|
||||
bcu_xasym:
|
||||
description: horizontal asymmetry
|
||||
deviceClass: ophyd_devices.ComputedSignal
|
||||
deviceConfig:
|
||||
compute_method: "def compute_xasym(signal1, signal2, signal3, signal4):\n return (signal3.get()+signal4.get() - signal1.get()- signal2.get())/(sum((signal1.get(), signal2.get(), signal3.get(), signal4.get())))"
|
||||
input_signals:
|
||||
- "bcu_bpm1"
|
||||
- "bcu_bpm2"
|
||||
- "bcu_bpm3"
|
||||
- "bcu_bpm4"
|
||||
enabled: true
|
||||
readOnly: false
|
||||
readoutPriority: baseline
|
||||
|
||||
bcu_yasym:
|
||||
description: vertical asymmetry
|
||||
deviceClass: ophyd_devices.ComputedSignal
|
||||
deviceConfig:
|
||||
compute_method: "def compute_xasym(signal1, signal2, signal3, signal4):\n return (signal1.get()+signal2.get() - signal3.get()- signal4.get())/(sum((signal1.get(), signal2.get(), signal3.get(), signal4.get())))"
|
||||
input_signals:
|
||||
- "bcu_bpm1"
|
||||
- "bcu_bpm2"
|
||||
- "bcu_bpm3"
|
||||
- "bcu_bpm4"
|
||||
enabled: true
|
||||
readOnly: false
|
||||
readoutPriority: baseline
|
||||
|
||||
bcu_xpos:
|
||||
description: horizontal position
|
||||
deviceClass: ophyd_devices.ComputedSignal
|
||||
deviceConfig:
|
||||
compute_method: "def compute_xpos(signal1):\n import numpy as np\n return 0.131786+ np.arctanh((signal1.get()-0.007105) /0.99342) / 9.5597 "
|
||||
input_signals:
|
||||
- "bcu_xasym"
|
||||
enabled: true
|
||||
readOnly: false
|
||||
readoutPriority: baseline
|
||||
|
||||
bcu_ypos:
|
||||
description: vertical position
|
||||
deviceClass: ophyd_devices.ComputedSignal
|
||||
deviceConfig:
|
||||
compute_method: "def compute_ypos(signal1):\n import numpy as np\n return -0.20283 + np.arctanh((signal1.get()- (-0.19936)) /0.80653) / (-13.18539)"
|
||||
input_signals:
|
||||
- "bcu_yasym"
|
||||
enabled: true
|
||||
readOnly: false
|
||||
readoutPriority: baseline
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ from .http import TIMESTAMP_ID, HttpDeviceController, HttpDeviceSignal, HttpOphy
|
||||
|
||||
|
||||
class AerotechController(HttpDeviceController):
|
||||
_readback_endpoint = "status"
|
||||
_target_endpoint = "position"
|
||||
_readback_endpoint = "/status"
|
||||
_target_endpoint = "/position"
|
||||
|
||||
def __init__(self, *, prefix, **kwargs):
|
||||
self._readbacks: dict[str, dict[str, float | bool]] = {}
|
||||
|
||||
@@ -138,8 +138,9 @@ def rock(**kwargs):
|
||||
from lmfit.models import LinearModel, GaussianModel # LorentzianModel
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
## create a dock area:
|
||||
dock_area = bec.gui.new()
|
||||
wr = dock_area.new().new(bec.gui.available_widgets.Waveform)
|
||||
wr = dock_area.new(gui.available_widgets.Waveform)
|
||||
|
||||
# width of rocking curve of perfect xtal: at 20 keV: 14 urad == 0.0008 deg
|
||||
|
||||
@@ -485,7 +486,7 @@ def fit_plot(data_x, data_y, model="gauss", ibg=1, fitrange=0, fitclick=0):
|
||||
|
||||
|
||||
####################################
|
||||
### just save data
|
||||
### just SAVE DATA
|
||||
####################################
|
||||
def save_data(hindex: int, device_name: str, signal_name: str):
|
||||
"""
|
||||
@@ -494,8 +495,8 @@ def save_data(hindex: int, device_name: str, signal_name: str):
|
||||
|
||||
Args:
|
||||
history_index (int): scan to fetch, e.g. -1 for the most recent scan
|
||||
device_name (str): the device for which to get the monitoring data
|
||||
signal_name (str): the monitor
|
||||
device_name (str): the device for which to get the monitoring data, eg, device_name='dcm_pitch'
|
||||
signal_name (str): the monitor, eg, signal_name='lu_bpmsum'
|
||||
"""
|
||||
|
||||
h = bec.history[hindex]
|
||||
@@ -591,6 +592,7 @@ def save_plot_gaps(hindex: int, device_name: str, signal_name: str):
|
||||
"""
|
||||
Get data for a completed scan from the BEC history,
|
||||
and plot all the results, store in a CSV file
|
||||
For a certain gap size, scan through energy (Bragg angle)
|
||||
|
||||
Args:
|
||||
history_index (int): scan to fetch, e.g. -1 for the most recent scan
|
||||
@@ -923,7 +925,7 @@ def colliscan(direction: str, range=0.3, nsteps=30, stime=0.5, centre=1):
|
||||
|
||||
|
||||
#####################
|
||||
### slitscans
|
||||
### SLITSCANS
|
||||
#####################
|
||||
def slitscan(device_location: str, direction: str, range: 1, nsteps=50, centre=0):
|
||||
"""
|
||||
@@ -1032,7 +1034,7 @@ def slitscan(device_location: str, direction: str, range: 1, nsteps=50, centre=0
|
||||
return
|
||||
|
||||
dock_area = bec.gui.new()
|
||||
wr = dock_area.new().new(bec.gui.available_widgets.Waveform)
|
||||
wr = dock_area.new(gui.available_widgets.Waveform)
|
||||
|
||||
pos0 = mot.user_readback.get()
|
||||
siz0 = size.user_readback.get()
|
||||
@@ -1483,24 +1485,31 @@ def scan_eg(erange, nsteps=50, fit=True):
|
||||
|
||||
|
||||
################################################
|
||||
### open window/doch for long gap scan
|
||||
### open window/dock for long gap scan
|
||||
################################################
|
||||
#
|
||||
### Note: all deprecated !!!!
|
||||
def scan_window(wname="Scan", fit=True):
|
||||
dock_area = bec.gui.new()
|
||||
# Add a new dock with a Waveform to the BECDockArea
|
||||
nam = "waveform_dock_"+wname
|
||||
dock_area.new(name=nam, widget="Waveform")
|
||||
# dock_area.panels
|
||||
# dock_area.panel_list
|
||||
plt1 = dock_area.panels[nam]
|
||||
dock_area = bec.gui.new(name=wname, geometry = [4000, 900, 700, 700])
|
||||
|
||||
w1 = dock_area.new(gui.available_widgets.Waveform) # CALL gui.available_widgets to see what is available
|
||||
w2 = dock_area.new(gui.available_widgets.ScanControl)
|
||||
|
||||
# Add signals to the WaveformWidget
|
||||
plt1.plot(device_x='id_gap', device_y='bpm')
|
||||
w1.plot(device_x = dev.id_gap, device_y = dev.lu_bpmsum)
|
||||
|
||||
###w1.plot(device_x='id_gap', device_y='bpm')
|
||||
###dock2 = dock_area.new(name="motor_dock", widget="MotorMap",relative_to=nam, position="right")
|
||||
|
||||
dock2 = dock_area.new(name="motor_dock", widget="MotorMap",relative_to=nam, position="right")
|
||||
###do stuff
|
||||
|
||||
gstart = 4.5
|
||||
gend = 5.0
|
||||
resol = 0.003 # 3 um resol for gap scan
|
||||
nsteps = round(gend-gstart)/resol
|
||||
s = scans.line_scan(dev.id_gap, gstart, gend, steps = nsteps, exp_time = 0.1, relative = False)
|
||||
|
||||
### if done, remove
|
||||
dock2.remove()
|
||||
#w2.remove()
|
||||
|
||||
@@ -178,11 +178,12 @@ def setu19(en, *harm_no, detune=0):
|
||||
def harmon_walk(estart=7.5, end_en=13):
|
||||
import time
|
||||
|
||||
harmon = 5
|
||||
en = estart
|
||||
ans = "y"
|
||||
while en < end_en + 0.5 and ans == "y":
|
||||
print(en)
|
||||
setu19(en, 5)
|
||||
setu19(en, harmon)
|
||||
time.sleep(2)
|
||||
sete(en)
|
||||
en = en + 0.5
|
||||
@@ -209,6 +210,9 @@ def gap_harm(e=12.4):
|
||||
|
||||
##################################
|
||||
|
||||
# use with estart = 6, end_en = 30.5
|
||||
|
||||
# test with estart = 6, end_en = 7.5 # should be 3 files , estimated time: 90 min
|
||||
|
||||
def long_gscan(estart=7, end_en=20.5, g_low=4.5, g_high=9.0, nsteps=1500):
|
||||
import time
|
||||
@@ -216,13 +220,15 @@ def long_gscan(estart=7, end_en=20.5, g_low=4.5, g_high=9.0, nsteps=1500):
|
||||
|
||||
dirname = "/sls/x10sa/config/commissioning/Data/"
|
||||
|
||||
enstep = 0.5
|
||||
|
||||
print(
|
||||
f"scanning the U19 gap from {estart} keV to {end_en} keV, for a gapsize from {g_low} to {g_high}"
|
||||
f"scanning the U19 gap from {estart} keV to {end_en} keV, for a gapsize from {g_low} to {g_high} in {enstep} keV energy intervals"
|
||||
)
|
||||
resol = (g_high - g_low) / nsteps
|
||||
print(f"nsteps = {nsteps}; resolution is {resol} mm")
|
||||
dock_area = bec.gui.new("LongGapScan")
|
||||
wr = dock_area.new().new(bec.gui.available_widgets.Waveform)
|
||||
wr = dock_area.new(gui.available_widgets.Waveform)
|
||||
mot = dev.id_gap
|
||||
det = dev.lu_bpmsum
|
||||
wr.plot(x_name=mot.name, y_name=det.name) ## names first !
|
||||
@@ -237,12 +243,17 @@ def long_gscan(estart=7, end_en=20.5, g_low=4.5, g_high=9.0, nsteps=1500):
|
||||
|
||||
## now: probably do from 5 keV to ?? 30 keV ???
|
||||
|
||||
tstart = time.perf_counter() # time logging
|
||||
|
||||
en = estart
|
||||
|
||||
while en < end_en:
|
||||
sete(en)
|
||||
time.sleep(0.2)
|
||||
rock()
|
||||
#sete(en)
|
||||
#time.sleep(0.2)
|
||||
#rock()
|
||||
# maybe use
|
||||
bl_energy(en, move_gap = False, plot = False)
|
||||
|
||||
print(f"setting energy to {en}")
|
||||
time.sleep(0.2)
|
||||
ds = scans.line_scan(dev.id_gap, g_low, g_high, steps=nsteps, exp_time=0.1, relative=False)
|
||||
@@ -255,7 +266,28 @@ def long_gscan(estart=7, end_en=20.5, g_low=4.5, g_high=9.0, nsteps=1500):
|
||||
with open(filename, "w") as f:
|
||||
np.savetxt(f, combined, delimiter=",", fmt="%5f")
|
||||
|
||||
en += 1
|
||||
en += enstep
|
||||
|
||||
# SNAKING ###
|
||||
bl_energy(en, move_gap = False, plot = False)
|
||||
|
||||
print(f"setting energy to {en}")
|
||||
time.sleep(0.2)
|
||||
ds = scans.line_scan(dev.id_gap, g_high, g_low, steps=nsteps, exp_time=0.1, relative=False)
|
||||
gap_data = ds.scan.live_data.id_gap.id_gap.val
|
||||
bpm_data = ds.scan.live_data.lu_bpmsum.lu_bpmsum.val
|
||||
wr.plot(x=gap_data, y=bpm_data)
|
||||
# writing output to simple data file for later analysis:
|
||||
combined = np.column_stack((gap_data, bpm_data))
|
||||
filename = dirname + "gaps" + str(en) + ".txt"
|
||||
with open(filename, "w") as f:
|
||||
np.savetxt(f, combined, delimiter=",", fmt="%5f")
|
||||
|
||||
en += enstep
|
||||
|
||||
elapsed_time = time.perf_counter()-tstart
|
||||
print(f"Runtime: {elapsed_time: .6f} seconds, i.e., {elapsed_time: .6f}/60 min")
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -273,7 +305,7 @@ def gscan(centre=0, gomax=0, detune=0):
|
||||
import time
|
||||
|
||||
dock_area = bec.gui.new()
|
||||
wr = dock_area.new().new(bec.gui.available_widgets.Waveform)
|
||||
wr = dock_area.new(gui.available_widgets.Waveform)
|
||||
mot = dev.id_gap
|
||||
det = dev.lu_bpmsum
|
||||
wr.plot(x_name=mot.name, y_name=det.name) ## names first !
|
||||
|
||||
Regular → Executable
+44
-109
@@ -1,10 +1,13 @@
|
||||
"""Planner to move between beamline states"""
|
||||
from enum import Enum
|
||||
import yaml
|
||||
from collections import defaultdict, deque
|
||||
"""Planner to move between beamline statesΩ"""
|
||||
|
||||
import time
|
||||
from collections import defaultdict, deque
|
||||
from enum import Enum
|
||||
# from enums import BeamlineState, TemperatureMode
|
||||
# from matcher import DeviceMatcher, nonzero_is_on
|
||||
|
||||
class BeamlineState(str, Enum):
|
||||
"""List of beamline states"""
|
||||
ROBOT_SAMPLE_EXCHANGE = "robot_sample_exchange"
|
||||
SAMPLE_ALIGNMENT = "sample_alignment"
|
||||
DATA_COLLECTION = "data_collection"
|
||||
@@ -16,47 +19,24 @@ class BeamlineState(str, Enum):
|
||||
MAINTENANCE = "maintenance"
|
||||
XTAL_SNAPSHOT = "xtal_snapshot"
|
||||
|
||||
|
||||
class TemperatureMode(str, Enum):
|
||||
"""List of temperature modes"""
|
||||
CRYO = "cryo"
|
||||
ROOM_TEMP = "room_temp"
|
||||
|
||||
def get_states():
|
||||
"""Returns the states defined in beamline_states.yaml"""
|
||||
directory = "/sls/x10sa/config/bec/production/pxii_bec/pxii_bec/device_configs/"
|
||||
# directory = "./"
|
||||
filename = "beamline_states.yaml"
|
||||
file = directory + filename
|
||||
with open(file, "r", encoding="utf-8") as f:
|
||||
cfg = yaml.safe_load(f)
|
||||
states = {}
|
||||
allow_modifiers = {}
|
||||
|
||||
for name, config in cfg["states"].items():
|
||||
state = BeamlineState(name)
|
||||
|
||||
allow_modifiers[state] = config.pop("allow_modifiers", False)
|
||||
|
||||
states[state] = config
|
||||
|
||||
return states, allow_modifiers
|
||||
|
||||
# cfg = yaml.safe_load(f)
|
||||
# return {
|
||||
# BeamlineState(name): config
|
||||
# for name, config in cfg["states"].items()
|
||||
# }
|
||||
|
||||
|
||||
class StateManager:
|
||||
class StateChangePlanner:
|
||||
"""Moves devices to the correct positions to achieve a given state"""
|
||||
|
||||
def __init__(self,
|
||||
devices,
|
||||
states: dict[BeamlineState, dict[str, str]],
|
||||
allow_modifiers=None,
|
||||
deps=None,
|
||||
debug=False,
|
||||
):
|
||||
def __init__(
|
||||
self,
|
||||
devices,
|
||||
states: dict[BeamlineState, dict[str, str]],
|
||||
allow_modifiers=None,
|
||||
deps=None,
|
||||
debug=False,
|
||||
):
|
||||
self.devices = devices
|
||||
self.states = states
|
||||
self.allow_modifiers = allow_modifiers or {}
|
||||
@@ -79,6 +59,7 @@ class StateManager:
|
||||
target.update(self.modifiers[modifier])
|
||||
return target
|
||||
|
||||
|
||||
def move_to(self, state_name, modifier=None):
|
||||
"""Move devices to the correct positions to achieve a given state"""
|
||||
if isinstance(state_name, str):
|
||||
@@ -109,18 +90,6 @@ class StateManager:
|
||||
print("States at failure:", self.get_positions())
|
||||
raise
|
||||
|
||||
# if self.debug:
|
||||
# print(" After :", self.get_states())
|
||||
# if not d.is_at(pos):
|
||||
# d.move(pos)
|
||||
|
||||
# def reset(self, state):
|
||||
# """Reset all devices to the given state"""
|
||||
# if isinstance(state, str):
|
||||
# state = BeamlineState(state)
|
||||
# for dev, pos in self.states[state].items():
|
||||
# self.devices[dev].set_pos(pos)
|
||||
|
||||
def available_states(self):
|
||||
"""Return a list of available states"""
|
||||
return list(self.states.keys())
|
||||
@@ -132,7 +101,7 @@ class StateManager:
|
||||
def print_positions(self):
|
||||
"""Return current state of all devices"""
|
||||
for name, device in self.devices.items():
|
||||
print(f"{name:10s} : {device.pos}")
|
||||
print(f"{name:10s} : {device.pos:10s} value: {device.actual}")
|
||||
|
||||
def diff_states(self, before):
|
||||
"""Return a dict of {device: (before, after)} pairs for devices that changed state"""
|
||||
@@ -164,8 +133,6 @@ class StateManager:
|
||||
|
||||
return matches if matches else None
|
||||
|
||||
|
||||
|
||||
def is_state(self, state, modifier=None):
|
||||
"""Check if the current state matches the given state and modifier."""
|
||||
actual = self.current_state()
|
||||
@@ -180,65 +147,33 @@ class StateManager:
|
||||
|
||||
def _plan(self, target):
|
||||
|
||||
graph = defaultdict(set)
|
||||
indeg = defaultdict(int)
|
||||
nodes = set()
|
||||
graph = defaultdict(set)
|
||||
indeg = defaultdict(int)
|
||||
nodes = set()
|
||||
|
||||
for dev, pos in target.items():
|
||||
node = (dev, pos)
|
||||
nodes.add(node)
|
||||
for dev, pos in target.items():
|
||||
node = (dev, pos)
|
||||
nodes.add(node)
|
||||
|
||||
for dep in self.deps.get(node, []):
|
||||
graph[dep].add(node)
|
||||
indeg[node] += 1
|
||||
nodes.add(dep)
|
||||
for dep in self.deps.get(node, []):
|
||||
graph[dep].add(node)
|
||||
indeg[node] += 1
|
||||
nodes.add(dep)
|
||||
|
||||
q = deque(n for n in nodes if indeg[n] == 0)
|
||||
stages = []
|
||||
q = deque(n for n in nodes if indeg[n] == 0)
|
||||
stages = []
|
||||
|
||||
while q:
|
||||
stage = list(q)
|
||||
stages.append(stage)
|
||||
q.clear()
|
||||
|
||||
for n in stage:
|
||||
for m in graph[n]:
|
||||
indeg[m] -= 1
|
||||
if indeg[m] == 0:
|
||||
q.append(m)
|
||||
|
||||
if sum(len(s) for s in stages) != len(nodes):
|
||||
raise RuntimeError("Circular dependency in state dependencies")
|
||||
return stages
|
||||
|
||||
|
||||
def planner_deps():
|
||||
"""Define the dependencies between beamline positions"""
|
||||
return {
|
||||
("bs_z", "samp"): [
|
||||
("gon_x", "out"),
|
||||
("diag_y", "out"),
|
||||
("coll_y", "out"),
|
||||
],
|
||||
("gon_x", "in"): [
|
||||
("diag_y", "out"),
|
||||
("bs_z", "safe"),
|
||||
],
|
||||
("diag_y", "scint"): [
|
||||
("gon_x", "out"),
|
||||
("cryo_pos", "out")
|
||||
],
|
||||
("diag_y", "i1"): [
|
||||
("gon_x", "out"),
|
||||
("cryo_pos", "out")],
|
||||
("bs_pos", "out"): [("bs_z", "safe")],
|
||||
("bs_pos", "in"): [("bs_z", "safe")],
|
||||
("diag_y", "out"): [("bs_z", "safe")],
|
||||
("diag_y", "park"): [("bs_z", "safe")],
|
||||
("coll_y", "out"): [("bs_z", "safe")],
|
||||
("coll_y", "park"): [("bs_z", "safe")],
|
||||
("coll_y", "in"): [("bs_z", "safe")],
|
||||
("coll_y", "intermediate"): [("bs_z", "safe")]
|
||||
}
|
||||
while q:
|
||||
stage = list(q)
|
||||
stages.append(stage)
|
||||
q.clear()
|
||||
|
||||
for n in stage:
|
||||
for m in graph[n]:
|
||||
indeg[m] -= 1
|
||||
if indeg[m] == 0:
|
||||
q.append(m)
|
||||
|
||||
if sum(len(s) for s in stages) != len(nodes):
|
||||
raise RuntimeError("Circular dependency in state dependencies")
|
||||
return stages
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
# from enums import BeamlineState
|
||||
import yaml
|
||||
|
||||
|
||||
class DefineStatesManager:
|
||||
@staticmethod
|
||||
def initialize_states(states_file):
|
||||
"""
|
||||
Returns the states and modifiers defined in the specified states file.
|
||||
"""
|
||||
with open(states_file, "r", encoding="utf-8") as f:
|
||||
cfg = yaml.safe_load(f)
|
||||
states = {}
|
||||
allow_modifiers = {}
|
||||
|
||||
for name, config in cfg["states"].items():
|
||||
state = BeamlineState(name)
|
||||
allow_modifiers[state] = config.pop("allow_modifiers", False)
|
||||
states[state] = config
|
||||
|
||||
return states, allow_modifiers
|
||||
Executable
+70
@@ -0,0 +1,70 @@
|
||||
""" Build the sample environment devices"""
|
||||
import yaml
|
||||
|
||||
# from position_device import PositionDevice
|
||||
|
||||
def motor_resolver(bec_name):
|
||||
|
||||
candidates = [
|
||||
bec_name,
|
||||
bec_name.replace("_", "."),
|
||||
]
|
||||
|
||||
for path in candidates:
|
||||
try:
|
||||
obj = dev
|
||||
|
||||
for part in path.split("."):
|
||||
obj = getattr(obj, part)
|
||||
|
||||
return obj
|
||||
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
raise ValueError(f"Cannot resolve motor for '{bec_name}'")
|
||||
|
||||
def build_devices(yaml_file, mock_devices):
|
||||
""" Build devices from the beamline states yaml"""
|
||||
|
||||
|
||||
state_devices = {}
|
||||
|
||||
with open(yaml_file, encoding="utf-8") as f:
|
||||
data = yaml.safe_load(f)
|
||||
|
||||
for bec_name, cfg in data.items():
|
||||
|
||||
user = cfg.get("userParameter")
|
||||
|
||||
# Skip devices without user parameters
|
||||
if not user:
|
||||
continue
|
||||
|
||||
|
||||
tol = user.get("tol", 0.1)
|
||||
|
||||
positions = {
|
||||
k: v for k, v in user.items()
|
||||
if k not in ("type", "tol")
|
||||
}
|
||||
|
||||
allow_arbitrary = (user["type"] == "continuous")
|
||||
|
||||
|
||||
|
||||
pos_dev = PositionDevice(
|
||||
bec_name=bec_name,
|
||||
mot_device = motor_resolver(bec_name),
|
||||
positions=positions,
|
||||
tol=tol,
|
||||
allow_arbitrary=allow_arbitrary,
|
||||
use_mock=bec_name in mock_devices,
|
||||
)
|
||||
|
||||
state_devices[bec_name] = pos_dev
|
||||
return state_devices
|
||||
|
||||
|
||||
|
||||
|
||||
Regular → Executable
+92
-17
@@ -1,6 +1,7 @@
|
||||
from dataclasses import dataclass, field
|
||||
from enum import Enum
|
||||
from typing import Any, Callable
|
||||
from datetime import datetime
|
||||
|
||||
from bec_lib.device import Signal, Positioner
|
||||
|
||||
@@ -24,6 +25,15 @@ class Status(Enum):
|
||||
Status.ERROR: "red",
|
||||
Status.UNKNOWN: "blue",
|
||||
}[self]
|
||||
|
||||
@property
|
||||
def color_scilog(self):
|
||||
return {
|
||||
Status.OK: "green",
|
||||
Status.WARNING: "",
|
||||
Status.ERROR: "red",
|
||||
Status.UNKNOWN: "",
|
||||
}[self]
|
||||
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
@@ -58,7 +68,6 @@ class HealthCheckResult:
|
||||
if self.status == Status.OK:
|
||||
return f"[{self.status.name} {self.name}]"
|
||||
|
||||
|
||||
return (
|
||||
f"[{self.status.name}] "
|
||||
f"{self.description}: {self.message}"
|
||||
@@ -70,15 +79,39 @@ class HealthCheckResult:
|
||||
|
||||
def send_to_scilog(results):
|
||||
|
||||
counts = {
|
||||
Status.OK: 0,
|
||||
Status.WARNING: 0,
|
||||
Status.ERROR: 0,
|
||||
Status.UNKNOWN: 0,
|
||||
}
|
||||
|
||||
for result in results:
|
||||
counts[result.status] += 1
|
||||
|
||||
|
||||
msg = bec.messaging.scilog.new()
|
||||
|
||||
msg.add_text(
|
||||
"Beamline Health Summary",
|
||||
bold = True
|
||||
)
|
||||
|
||||
msg.add_text("\n")
|
||||
for status, count in counts.items():
|
||||
msg.add_text(
|
||||
f"{status.name:<10}: {count}",
|
||||
bold=True,
|
||||
)
|
||||
|
||||
msg.add_text("\n")
|
||||
|
||||
for result in results:
|
||||
msg.add_text(
|
||||
result.formatted_message(),
|
||||
# bold=result.status != Status.OK,
|
||||
color = result.status.color
|
||||
color = result.status.color_scilog
|
||||
)
|
||||
# msg.add_text(result.formatted_message())
|
||||
msg.add_text("\n")
|
||||
msg.add_tags(["beamline health check"])
|
||||
msg.send()
|
||||
@@ -200,7 +233,7 @@ def check_signals(devices, config: BeamlineHealthConfig):
|
||||
description=description,
|
||||
status=Status.ERROR,
|
||||
value=actual,
|
||||
message=f"Signal value {actual} failed validation",
|
||||
message=f"Signal value = {actual}, failed validation",
|
||||
category="signals",
|
||||
)
|
||||
)
|
||||
@@ -220,6 +253,7 @@ def check_signals(devices, config: BeamlineHealthConfig):
|
||||
def check_motors(devices, config: BeamlineHealthConfig):
|
||||
|
||||
results = []
|
||||
ignore = ["id_gap", "smargon"]
|
||||
|
||||
motor_devices = [
|
||||
(name, obj)
|
||||
@@ -229,6 +263,9 @@ def check_motors(devices, config: BeamlineHealthConfig):
|
||||
|
||||
for name, obj in motor_devices:
|
||||
|
||||
if name in ignore:
|
||||
continue
|
||||
|
||||
try:
|
||||
|
||||
data = obj.read()
|
||||
@@ -352,7 +389,26 @@ def check_motors(devices, config: BeamlineHealthConfig):
|
||||
)
|
||||
|
||||
return results
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# General Info
|
||||
# -------------------------------------------------------------------
|
||||
def info():
|
||||
current = dev.sls_current.get()
|
||||
gap = dev.id_gap.position
|
||||
energy = get_current_energy()
|
||||
# state = get_state()
|
||||
print(f"[INFO] Machine: {current:.4g} mA\n"
|
||||
f"[INFO] Undulator gap: {gap:.4g}\n"
|
||||
f"[INFO] Beamline energy: {energy:.6g} eV\n")
|
||||
# f"[INFO] Beamline state: {state}")
|
||||
|
||||
|
||||
# def get_state():
|
||||
# states = []
|
||||
# res = planner.current_state()
|
||||
# for state in res:
|
||||
# states.append(state[0])
|
||||
# return list(set(states))
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Main Check Entry Point
|
||||
@@ -387,7 +443,10 @@ def check2(config: BeamlineHealthConfig | None = None):
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
|
||||
def print_summary(results):
|
||||
def summary_text(results):
|
||||
|
||||
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M")
|
||||
|
||||
|
||||
n_ok = sum(r.status == Status.OK for r in results)
|
||||
|
||||
@@ -397,14 +456,18 @@ def print_summary(results):
|
||||
|
||||
n_unknown = sum(r.status == Status.UNKNOWN for r in results)
|
||||
|
||||
print("\n==============================")
|
||||
print(" Beamline Health Summary")
|
||||
print("==============================")
|
||||
print(f"OK : {n_ok}")
|
||||
print(f"WARNING : {n_warn}")
|
||||
print(f"ERROR : {n_err}")
|
||||
print(f"UNKNOWN : {n_unknown}")
|
||||
print("==============================\n")
|
||||
return (
|
||||
f"==========================================\n"
|
||||
f"Beamline Health Check at {timestamp}\n"
|
||||
f"==========================================\n"
|
||||
f"OK : {n_ok}\n"
|
||||
f"WARNING : {n_warn}\n"
|
||||
f"ERROR : {n_err}\n"
|
||||
f"UNKNOWN : {n_unknown}\n"
|
||||
"==========================================\n"
|
||||
)
|
||||
# return "\n".join(lines)
|
||||
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Filter results
|
||||
@@ -423,11 +486,14 @@ def filter_results(results, statuses = None):
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
|
||||
def run_check(show_all= False):
|
||||
def run_check(show_all= False, scilog=False):
|
||||
|
||||
|
||||
results = check2()
|
||||
|
||||
print_summary(results)
|
||||
print(summary_text(results))
|
||||
|
||||
info()
|
||||
|
||||
problem_results = filter_results(
|
||||
results,
|
||||
@@ -437,7 +503,8 @@ def run_check(show_all= False):
|
||||
Status.UNKNOWN,
|
||||
}
|
||||
)
|
||||
# send_to_scilog(problem_results)
|
||||
if scilog:
|
||||
send_to_scilog(problem_results)
|
||||
|
||||
if not show_all:
|
||||
results = filter_results(
|
||||
@@ -450,6 +517,14 @@ def run_check(show_all= False):
|
||||
)
|
||||
for result in results:
|
||||
print(result)
|
||||
|
||||
disclaimer = "\n======================================================\n" \
|
||||
"This reports: \n 1. If motors are in error state, if moving, or if readback != setpoint" \
|
||||
"\n 2. If camera or BPMs are reading 0 (may or may not be an error)" \
|
||||
"\nN.B. The motor checks are only done if they exist as standard ophyd motors in BEC." \
|
||||
"\nTo see which devices were checked use run_check(show_all=True)."
|
||||
|
||||
print(disclaimer)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
""" "Initialises the sample environment devices, guards,
|
||||
dependencies and planner"""
|
||||
|
||||
# import yaml
|
||||
# from devices import build_devices
|
||||
# from guards import attach_guards
|
||||
# from policies import attach_policies
|
||||
|
||||
|
||||
def init_se_devices():
|
||||
"""Initialises the sample environment devices"""
|
||||
directory = "/sls/x10sa/config/bec/production/pxii_bec/pxii_bec/device_configs/"
|
||||
# directory = "./"
|
||||
filename = "se_devices.yaml"
|
||||
file = directory + filename
|
||||
print(f"Loading devices from {file}")
|
||||
se_devices = build_devices(file)
|
||||
attach_guards(se_devices)
|
||||
attach_policies(se_devices)
|
||||
|
||||
return se_devices
|
||||
|
||||
|
||||
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
"""Planner dependencies"""
|
||||
def planner_deps():
|
||||
"""Define the dependencies between beamline positions"""
|
||||
return {
|
||||
("bs_z", "samp"): [
|
||||
("aerotech_x", "out"),
|
||||
("diag_y", "out"),
|
||||
("coll_y", "out"),
|
||||
],
|
||||
("aerotech_x", "in"): [
|
||||
("diag_y", "out"),
|
||||
("bs_z", "safe"),
|
||||
],
|
||||
("aerotech_x", "out"): [
|
||||
("diag_y", "out"),
|
||||
("bs_z", "safe"),
|
||||
],
|
||||
("diag_y", "scint"): [
|
||||
("aerotech_x", "out"),
|
||||
("bs_z", "safe"),
|
||||
("cryo_pos", "out"),
|
||||
],
|
||||
("diag_y", "i1"): [
|
||||
("aerotech_x", "out"),
|
||||
("bs_z", "safe"),
|
||||
("cryo_pos", "out"),
|
||||
],
|
||||
("bs_pos", "out"): [("bs_z", "safe")],
|
||||
("bs_pos", "in"): [("bs_z", "safe")],
|
||||
("diag_y", "out"): [("bs_z", "safe")],
|
||||
("diag_y", "park"): [("bs_z", "safe")],
|
||||
("coll_y", "out"): [("bs_z", "safe")],
|
||||
("coll_y", "park"): [("bs_z", "safe")],
|
||||
("coll_y", "in"): [("bs_z", "safe")],
|
||||
("coll_y", "intermediate"): [("bs_z", "safe")],
|
||||
}
|
||||
@@ -1,167 +0,0 @@
|
||||
"""Set up the positioned devices"""
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Callable, List, Dict, Optional, Union
|
||||
|
||||
import yaml
|
||||
|
||||
|
||||
@dataclass
|
||||
class PositionDevice:
|
||||
"""Generic device that moves between named or numeric positions"""
|
||||
|
||||
bec_name: str
|
||||
positions: Dict[str, float] = field(default_factory=dict)
|
||||
tol: float = 0.1
|
||||
|
||||
guards: List[Callable[[], None]] = field(default_factory=list)
|
||||
policy: Optional[Callable[[float], None]] = None
|
||||
|
||||
# line below defines if the device is permitted to move to any arbitrary position or not
|
||||
allow_arbitrary: bool = False
|
||||
|
||||
def __post_init__(self):
|
||||
# Use this for BEC
|
||||
self.mot = getattr(dev, self.bec_name)
|
||||
|
||||
# Use this for testing
|
||||
# self.mot = self.MockMotor()
|
||||
|
||||
# Normalize position names
|
||||
self.positions = {k.lower(): v for k, v in self.positions.items()}
|
||||
|
||||
# -------------------------
|
||||
# internal helpers
|
||||
# -------------------------
|
||||
|
||||
def _check_guards(self):
|
||||
for g in self.guards:
|
||||
g()
|
||||
|
||||
def _resolve_target(self, target: Union[str, float]) -> float:
|
||||
"""Convert target into a motor position"""
|
||||
|
||||
if isinstance(target, str):
|
||||
name = target.lower()
|
||||
|
||||
if name not in self.positions:
|
||||
raise ValueError(f"Unknown position '{target}'")
|
||||
|
||||
return self.positions[name]
|
||||
|
||||
if isinstance(target, (float, int)):
|
||||
if not self.allow_arbitrary:
|
||||
raise ValueError(f"{self.bec_name} only accepts named positions")
|
||||
return float(target)
|
||||
|
||||
raise TypeError("Target must be str or float")
|
||||
|
||||
# -------------------------
|
||||
# motion
|
||||
# -------------------------
|
||||
|
||||
def move(self, target: Union[str, float]):
|
||||
"""Unified move interface"""
|
||||
|
||||
pos = self._resolve_target(target)
|
||||
|
||||
self._check_guards()
|
||||
|
||||
if self.policy:
|
||||
self.policy(pos)
|
||||
|
||||
# Use for testing
|
||||
# self.mot.move(pos)
|
||||
|
||||
# Use in BEC
|
||||
scans.umv(self.mot, pos, relative=False)
|
||||
# s = scans.mv(self.mot, pos, relative=False)
|
||||
# s.wait(timeout=5)
|
||||
|
||||
# def set_position(self, target: Union[str, float]):
|
||||
# """Only to be used for testing purposes"""
|
||||
# pos = self._resolve_target(target)
|
||||
# self.mot.move(pos)
|
||||
|
||||
# -------------------------
|
||||
# readback
|
||||
# -------------------------
|
||||
|
||||
@property
|
||||
def actual(self) -> float:
|
||||
"""Return the actual position of the device."""
|
||||
return self.mot.read()[self.bec_name]["value"]
|
||||
# return self.mot.position
|
||||
|
||||
@property
|
||||
def pos(self) -> str:
|
||||
"""Return the closest matching position"""
|
||||
|
||||
for name, pos in self.positions.items():
|
||||
if abs(self.actual - pos) <= self.tol:
|
||||
return name
|
||||
|
||||
return "unknown"
|
||||
|
||||
def is_at(self, position: str) -> bool:
|
||||
"""Return True if the device is at the given position."""
|
||||
position = position.lower()
|
||||
|
||||
if position not in self.positions:
|
||||
raise ValueError(f"Unknown position '{position}'")
|
||||
|
||||
return abs(self.actual - self.positions[position]) <= self.tol
|
||||
|
||||
# -------------------------
|
||||
# Mock Motor Implementation
|
||||
# -------------------------
|
||||
|
||||
class MockMotor:
|
||||
"""Mock implementation of MotorLike for testing and initialization."""
|
||||
|
||||
def __init__(self):
|
||||
self.position = 0.0
|
||||
|
||||
def move(self, value: float):
|
||||
"""Move the motor to the given position."""
|
||||
self.position = value
|
||||
|
||||
def read(self):
|
||||
"""Read the current position of the motor."""
|
||||
return {"value": self.position}
|
||||
|
||||
|
||||
def build_devices(yaml_file):
|
||||
"""Takes the defined positions from the device yaml file
|
||||
and adds them to the PositionDevice class.
|
||||
"""
|
||||
# discrete_devs = []
|
||||
# continuous_devs = []
|
||||
se_devices = {}
|
||||
|
||||
with open(yaml_file, encoding="utf-8") as f:
|
||||
data = yaml.safe_load(f)
|
||||
|
||||
for bec_name, cfg in data.items():
|
||||
# Skip devices without userParameter
|
||||
user = cfg.get("userParameter")
|
||||
|
||||
if not user:
|
||||
continue
|
||||
|
||||
tol = user.get("tol", 0.1)
|
||||
|
||||
positions = {k: v for k, v in user.items() if k not in ("type", "tol")}
|
||||
|
||||
if user["type"] == "discrete":
|
||||
dev = PositionDevice(bec_name, positions, tol=tol, allow_arbitrary=False)
|
||||
# discrete_devs.append(bec_name)
|
||||
se_devices[bec_name] = dev
|
||||
elif user["type"] == "continuous":
|
||||
dev = PositionDevice(bec_name, positions, tol=tol, allow_arbitrary=True)
|
||||
# continuous_devs.append(bec_name)
|
||||
se_devices[bec_name] = dev
|
||||
|
||||
# print(f"Discrete devices: {discrete_devs}")
|
||||
# print(f"Continuous: {continuous_devs}")
|
||||
return se_devices
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
This module manages the initialization of devices."""
|
||||
|
||||
# from guards import attach_guards
|
||||
# from policies import attach_policies
|
||||
# from build_devices import build_devices
|
||||
|
||||
|
||||
class DeviceManager:
|
||||
"""Class for building devices and attaching safety guards and policies."""
|
||||
|
||||
@staticmethod
|
||||
def initialize_devices(state_devices_file, rest_devices_file, mock_devices):
|
||||
"""
|
||||
Initializes sample environment devices from the specified file.
|
||||
"""
|
||||
devices = build_devices(state_devices_file, mock_devices)
|
||||
rest_devices = build_devices(rest_devices_file, mock_devices)
|
||||
devices.update(rest_devices)
|
||||
attach_guards(devices)
|
||||
attach_policies(devices)
|
||||
return devices
|
||||
Regular → Executable
Regular → Executable
+2
-2
@@ -73,9 +73,9 @@ def guards_setup(d):
|
||||
)
|
||||
guards["bs_pos_in"] = AtPositionGuard(d["bs_pos"], position="in")
|
||||
guards["gonx_out"] = MinMaxGuard(
|
||||
d["gon_x"], direction="less_than", limit_value=d["gon_x"].positions["out"]
|
||||
d["aerotech_x"], direction="less_than", limit_value=d["aerotech_x"].positions["out"]
|
||||
)
|
||||
guards["gonx_safe"] = AtPositionGuard(d["gon_x"], position="safe")
|
||||
guards["gonx_safe"] = AtPositionGuard(d["aerotech_x"], position="safe")
|
||||
guards["diag_y_out"] = MinMaxGuard(
|
||||
d["diag_y"], direction="less_than", limit_value=d["diag_y"].positions["out"]
|
||||
)
|
||||
|
||||
Executable
+163
@@ -0,0 +1,163 @@
|
||||
"""Initialise sample environment devices and beamline states"""
|
||||
|
||||
import os
|
||||
from dataclasses import dataclass
|
||||
|
||||
# from devices_manager import DeviceManager
|
||||
# from beamline_state_manager import DefineStatesManager
|
||||
# from dependencies import planner_deps
|
||||
# from beamline_planner import StateChangePlanner
|
||||
|
||||
@dataclass
|
||||
class Environment:
|
||||
|
||||
device_mocks: dict[str, bool] = None
|
||||
beamline: str = None
|
||||
|
||||
beamline_configs = {
|
||||
# "x06sa" : {
|
||||
# "devdir": "/sls/x10sa/config/bec/production/pxi_bec/pxi_bec/device_configs/",
|
||||
# "state": "pxi-state-devices.yaml",
|
||||
# "rest": "pxi-rest-devices.yaml",
|
||||
# "states": "pxi-beamline-states.yaml",
|
||||
# },
|
||||
"x10sa" : {
|
||||
"devdir": "/sls/x10sa/config/bec/production/pxii_bec/pxii_bec/device_configs/",
|
||||
"state": "pxii-state-devices.yaml",
|
||||
"rest": "pxii-rest-devices.yaml",
|
||||
"states": "pxii-beamline-states.yaml",
|
||||
},
|
||||
"x06da" : {
|
||||
"devdir": "/sls/x06da/config/bec/production/pxiii_bec/pxiii_bec/device_configs/",
|
||||
"state": "pxiii-state-devices.yaml",
|
||||
"rest": "pxiii-rest-devices.yaml",
|
||||
"states": "pxiii-beamline-states.yaml",
|
||||
}
|
||||
}
|
||||
|
||||
def __post_init__(self):
|
||||
|
||||
if self.device_mocks is None:
|
||||
self.device_mocks = {
|
||||
"aerotech_x": "real",
|
||||
"aerotech_y": "real",
|
||||
"aerotech_z": "real",
|
||||
"aerotech_u": "real",
|
||||
"bl_bright": "real",
|
||||
"bl_pos": "real",
|
||||
"bs_pos": "real",
|
||||
"bs_z": "real",
|
||||
"coll_y": "real",
|
||||
"cryo_pos": "real",
|
||||
"det_cov": "real",
|
||||
"diag_y": "real",
|
||||
"fl_bright": "real",
|
||||
"smargon_x": "real",
|
||||
"smargon_y": "real",
|
||||
"smargon_z": "real",
|
||||
"smargon_chi": "real",
|
||||
"smargon_phi": "real",
|
||||
"xrf_pos": "mock",
|
||||
}
|
||||
|
||||
mocks = sorted(
|
||||
name
|
||||
for name, backend in self.device_mocks.items()
|
||||
if backend == "mock"
|
||||
)
|
||||
|
||||
reals = sorted(
|
||||
name
|
||||
for name, backend in self.device_mocks.items()
|
||||
if backend == "real"
|
||||
)
|
||||
|
||||
print(f"Mock devices ({len(mocks)}): {mocks}")
|
||||
print(f"Real devices ({len(reals)}): {reals}")
|
||||
|
||||
try:
|
||||
cfg = self.beamline_configs[self.beamline]
|
||||
except KeyError:
|
||||
raise ValueError(
|
||||
f"Unknown beamline '{self.beamline}'"
|
||||
)
|
||||
|
||||
devdir = cfg["devdir"]
|
||||
|
||||
self.state_devices_file = devdir + cfg["state"]
|
||||
self.rest_devices_file = devdir + cfg["rest"]
|
||||
self.states_file = devdir + cfg["states"]
|
||||
|
||||
mock_start_positions = {
|
||||
"aerotech_x": "in",
|
||||
"aerotech_y": "mount",
|
||||
"aerotech_z": "mount",
|
||||
"aerotech_u": "mount",
|
||||
"bl_bright": "off",
|
||||
"bl_pos": "out",
|
||||
"bs_pos": "out",
|
||||
"bs_z": "safe",
|
||||
"coll_y": "park",
|
||||
"cryo_pos": "in",
|
||||
"det_cov": "close",
|
||||
"diag_y": "park",
|
||||
"fl_bright": "off",
|
||||
"smargon_x": "mount",
|
||||
"smargon_y": "mount",
|
||||
"smargon_z": "mount",
|
||||
"smargon_chi": "mount",
|
||||
"smargon_phi": "mount",
|
||||
"xrf_pos": "out",
|
||||
}
|
||||
|
||||
@property
|
||||
def mock_devices(self):
|
||||
mock_names = set()
|
||||
for name, device in self.device_mocks.items():
|
||||
if device == "mock":
|
||||
mock_names.add(name)
|
||||
return mock_names
|
||||
|
||||
def init_beamline_environment():
|
||||
"""
|
||||
Initializes the beamline with real or mock devices.
|
||||
"""
|
||||
|
||||
beamline = os.environ["BEAMLINE"]
|
||||
|
||||
env = Environment(beamline = beamline)
|
||||
|
||||
# Initialize devices
|
||||
device_manager = DeviceManager()
|
||||
devices = device_manager.initialize_devices(
|
||||
env.state_devices_file,
|
||||
env.rest_devices_file,
|
||||
env.mock_devices
|
||||
)
|
||||
|
||||
# Initialize states
|
||||
state_manager = DefineStatesManager()
|
||||
states, allow_modifiers = state_manager.initialize_states(env.states_file)
|
||||
|
||||
# Setup dependencies
|
||||
deps = planner_deps()
|
||||
|
||||
# Setup planner
|
||||
planner = StateChangePlanner(devices, states, allow_modifiers, deps)
|
||||
print("Initializing beamline state planner")
|
||||
|
||||
# Set mock motor starting positions
|
||||
|
||||
for mock_dev, pos in env.mock_start_positions.items():
|
||||
if mock_dev in env.mock_devices:
|
||||
try:
|
||||
devices[mock_dev].set_position(pos)
|
||||
except Exception as e:
|
||||
print(f"{e} error when setting {mock_dev}")
|
||||
|
||||
|
||||
return devices, planner
|
||||
|
||||
|
||||
|
||||
|
||||
Regular → Executable
+21
-17
@@ -1,9 +1,10 @@
|
||||
'''Define guard policies for devices in the beamline.'''
|
||||
"""Define guard policies for devices in the beamline."""
|
||||
|
||||
# from guards import GuardViolation, guards_setup
|
||||
|
||||
|
||||
def is_sample_area_clear_for_beamstop(d):
|
||||
'''Check if the sample area is clear of diag_y, coll_y, and gonx'''
|
||||
"""Check if the sample area is clear of diag_y, coll_y, and gonx"""
|
||||
g = guards_setup(d)
|
||||
if g["diag_y_out"].check() and g["coll_y_out"].check() and g["gonx_out"].check():
|
||||
return True
|
||||
@@ -11,25 +12,27 @@ def is_sample_area_clear_for_beamstop(d):
|
||||
|
||||
|
||||
def is_sample_area_clear_for_gonx(d):
|
||||
'''Check if the sample area is clear of diag_y and bs_z'''
|
||||
"""Check if the sample area is clear of diag_y and bs_z"""
|
||||
g = guards_setup(d)
|
||||
if g["diag_y_out"].check() and g["bs_work_min"].check():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def make_gon_x_policy(d):
|
||||
'''Create the policy for gon_x'''
|
||||
def gon_x_policy(target):
|
||||
cfg = d["gon_x"].positions
|
||||
def make_aerotech_x_policy(d):
|
||||
"""Create the policy for aerotech_x"""
|
||||
|
||||
def aerotech_x_policy(target):
|
||||
cfg = d["aerotech_x"].positions
|
||||
if target >= cfg["out"] and not is_sample_area_clear_for_gonx(d):
|
||||
raise GuardViolation("Sample area is not clear")
|
||||
|
||||
return gon_x_policy
|
||||
return aerotech_x_policy
|
||||
|
||||
|
||||
def make_bs_z_policy(d):
|
||||
'''Create the policy for bs_z'''
|
||||
"""Create the policy for bs_z"""
|
||||
|
||||
def bs_z_policy(target):
|
||||
"""Checks that the target position is within limits"""
|
||||
cfg = d["bs_z"].positions
|
||||
@@ -50,24 +53,25 @@ def make_bs_z_policy(d):
|
||||
|
||||
|
||||
def make_diag_y_policy(d):
|
||||
'''Create the policy for diag_y'''
|
||||
"""Create the policy for diag_y"""
|
||||
|
||||
def diag_y_policy(target):
|
||||
cfg = d["diag_y"].positions
|
||||
# Don't move in if the goniometer is >= 'in'
|
||||
if d["gon_x"].actual >= d["gon_x"].positions["in"] and target > cfg['out']:
|
||||
# Don't move in if the goniometer is in
|
||||
if d["aerotech_x"].actual >= d['aerotech_x'].positions['in'] and target > cfg["out"]:
|
||||
raise GuardViolation(
|
||||
f"Diagnostic device cannot move beyond {cfg['out']} mm when goniometer is not OUT"
|
||||
)
|
||||
if d['cryo_pos'].pos == "in" and target > cfg["out"]:
|
||||
# Don't move if cryocooler is in
|
||||
if d['cryo_pos'].pos == 'in' and target > cfg['out']:
|
||||
raise GuardViolation(
|
||||
f"Diagnostic device cannot move beyond {cfg['out']} mm when cryo is IN"
|
||||
f"Diagnostic device cannot move beyond {cfg['out']} mm when cryocooler is IN"
|
||||
)
|
||||
|
||||
return diag_y_policy
|
||||
|
||||
|
||||
def attach_policies(d):
|
||||
'''Attach the policies to the devices'''
|
||||
"""Attach the policies to the devices"""
|
||||
d["bs_z"].policy = make_bs_z_policy(d)
|
||||
d["gon_x"].policy = make_gon_x_policy(d)
|
||||
d["aerotech_x"].policy = make_aerotech_x_policy(d)
|
||||
d["diag_y"].policy = make_diag_y_policy(d)
|
||||
|
||||
Executable
+254
@@ -0,0 +1,254 @@
|
||||
"""Set up the positioned devices for mock or real motors"""
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Callable, List, Dict, Optional, Union
|
||||
|
||||
import time
|
||||
|
||||
|
||||
class SimpleStatus:
|
||||
"""Makes a mock motor return a status"""
|
||||
|
||||
def __init__(self, motor, target, delay=0.0, success=True, name=""):
|
||||
self.motor = motor
|
||||
self.target = target
|
||||
self.delay = delay
|
||||
self._success = success
|
||||
self.name = name
|
||||
self._done = False
|
||||
|
||||
def wait(self, timeout=None):
|
||||
start = time.time()
|
||||
|
||||
while True:
|
||||
# simulate motion completion
|
||||
if not self._done:
|
||||
if time.time() - start >= self.delay:
|
||||
if self._success:
|
||||
self.motor.position = self.target
|
||||
self._done = True
|
||||
|
||||
if self._done:
|
||||
if not self._success:
|
||||
raise RuntimeError(f"Motor {self.name} failed")
|
||||
return True
|
||||
|
||||
if timeout is not None and (time.time() - start) > timeout:
|
||||
raise TimeoutError(f"Timeout waiting for {self.name}")
|
||||
|
||||
time.sleep(0.01)
|
||||
|
||||
|
||||
class MotorAdapter:
|
||||
"""Motor adapter for setting up mock/real motors"""
|
||||
|
||||
def move(self, pos: float):
|
||||
"""Move the motor to the given position"""
|
||||
raise NotImplementedError
|
||||
|
||||
def move_with_status(self, pos: float):
|
||||
"""Move the motor to the given position with a status"""
|
||||
raise NotImplementedError
|
||||
|
||||
def set_fail(self, value: bool):
|
||||
"""Put the motor into a failure state"""
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
def actual(self) -> float:
|
||||
"""The actual position of the motor"""
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class MockMotorAdapter(MotorAdapter):
|
||||
"""Motor adapter for mock motors"""
|
||||
|
||||
def __init__(self, name: str):
|
||||
self._motor = PositionDevice.MockMotor(name)
|
||||
|
||||
def move(self, pos: float):
|
||||
"""Move the motor to the given position"""
|
||||
self._motor.move(pos)
|
||||
|
||||
def move_with_status(self, pos: float):
|
||||
"""Move the motor to the given position with a status"""
|
||||
if self._motor.fail:
|
||||
return SimpleStatus(
|
||||
motor=self._motor,
|
||||
target=pos,
|
||||
delay=self._motor.delay,
|
||||
success=False,
|
||||
name=self._motor.name,
|
||||
)
|
||||
|
||||
# don't update position immediately
|
||||
return SimpleStatus(
|
||||
motor=self._motor,
|
||||
target=pos,
|
||||
delay=self._motor.delay,
|
||||
success=True,
|
||||
name=self._motor.name,
|
||||
)
|
||||
|
||||
def set_fail(self, value: bool):
|
||||
"""Put the motor into a failure state"""
|
||||
self._motor.fail = value
|
||||
|
||||
def set_delay(self, value: float):
|
||||
self._motor.delay = value
|
||||
|
||||
@property
|
||||
def actual(self) -> float:
|
||||
"""The actual position of the motor"""
|
||||
return self._motor.position
|
||||
|
||||
|
||||
class RealMotorAdapter(MotorAdapter):
|
||||
"""Motor adapter for real motors"""
|
||||
|
||||
def __init__(self, mot, name):
|
||||
self._motor = mot
|
||||
self._name = name
|
||||
|
||||
def move(self, pos: float):
|
||||
"""Move the motor to the given position"""
|
||||
scans.umv(self._motor, pos, relative=False)
|
||||
|
||||
def move_with_status(self, pos: float):
|
||||
"""Move the motor to the given position with a status"""
|
||||
return scans.mv(self._motor, pos, relative=False)
|
||||
# scans.mv(self._motor, pos, relative=False)
|
||||
|
||||
def set_fail(self, value: bool):
|
||||
"""Put the motor into a failure state"""
|
||||
raise NotImplementedError
|
||||
|
||||
@property
|
||||
def actual(self) -> float:
|
||||
"""The actual position of the motor"""
|
||||
return self._motor.read()[self._name]["value"]
|
||||
|
||||
|
||||
@dataclass
|
||||
class PositionDevice:
|
||||
"""Generic device that moves between named or numeric positions"""
|
||||
|
||||
bec_name: str
|
||||
mot_device: any = None
|
||||
positions: Dict[str, float] = field(default_factory=dict)
|
||||
tol: float = 0.1
|
||||
# device_timeout = 3
|
||||
guards: List[Callable[[], None]] = field(default_factory=list)
|
||||
policy: Optional[Callable[[float], None]] = None
|
||||
allow_arbitrary: bool = False
|
||||
use_mock: bool = True
|
||||
|
||||
def __post_init__(self):
|
||||
if self.use_mock:
|
||||
self.mot = MockMotorAdapter(self.bec_name)
|
||||
else:
|
||||
self.mot = RealMotorAdapter(self.mot_device, self.bec_name)
|
||||
# self.mot = getattr(dev, self.bec_name)
|
||||
|
||||
# Normalize position names
|
||||
self.positions = {k.lower(): v for k, v in self.positions.items()}
|
||||
|
||||
def _check_guards(self):
|
||||
"""Check if guards exist"""
|
||||
for g in self.guards:
|
||||
g()
|
||||
|
||||
def _resolve_target(self, target: Union[str, float]) -> float:
|
||||
"""Convert target into a motor position"""
|
||||
|
||||
if isinstance(target, str):
|
||||
name = target.lower()
|
||||
|
||||
if name not in self.positions:
|
||||
raise ValueError(f"Unknown position '{target}'")
|
||||
|
||||
return self.positions[name]
|
||||
|
||||
if isinstance(target, (float, int)):
|
||||
if not self.allow_arbitrary:
|
||||
raise ValueError(f"{self.bec_name} only accepts named positions")
|
||||
return float(target)
|
||||
|
||||
raise TypeError("Target must be str or float")
|
||||
|
||||
def move(self, target: Union[str, float]):
|
||||
"""Move devices"""
|
||||
pos = self._resolve_target(target)
|
||||
|
||||
self._check_guards()
|
||||
|
||||
if self.policy:
|
||||
self.policy(pos)
|
||||
|
||||
self.mot.move(pos)
|
||||
|
||||
def mv(self, target: Union[str, float]):
|
||||
"""move devices with a timeout"""
|
||||
|
||||
pos = self._resolve_target(target)
|
||||
|
||||
self._check_guards()
|
||||
|
||||
if self.policy:
|
||||
self.policy(pos)
|
||||
|
||||
# status.wait(self.device_timeout)
|
||||
return self.mot.move_with_status(pos)
|
||||
# self.mot.move_with_status(pos)
|
||||
|
||||
def set_position(self, target: Union[str, float]):
|
||||
"""Only to be used for testing purposes, bypasses guards"""
|
||||
pos = self._resolve_target(target)
|
||||
self.mot.move(pos)
|
||||
|
||||
@property
|
||||
def actual(self) -> float:
|
||||
"""Return the actual position of the device."""
|
||||
# return self.mot.read()[self.bec_name]["value"]
|
||||
return self.mot.actual
|
||||
|
||||
@property
|
||||
def pos(self) -> str:
|
||||
"""Return the closest matching position"""
|
||||
|
||||
for name, pos in self.positions.items():
|
||||
if abs(self.actual - pos) <= self.tol:
|
||||
return name
|
||||
|
||||
return "unknown"
|
||||
|
||||
#
|
||||
|
||||
def is_at(self, target: Union[str, float]) -> bool:
|
||||
"""Return True if the device is at the given position."""
|
||||
|
||||
pos = self._resolve_target(target)
|
||||
return abs(self.actual - pos) <= self.tol
|
||||
|
||||
# -------------------------
|
||||
# Mock Motor Implementation
|
||||
# -------------------------
|
||||
|
||||
class MockMotor:
|
||||
"""Mock motor implementation"""
|
||||
|
||||
def __init__(self, name: str):
|
||||
self.name = name
|
||||
self.position = 0.0
|
||||
self._target = self.position
|
||||
self.fail = False
|
||||
self.delay = 0
|
||||
|
||||
#
|
||||
def move(self, pos: float):
|
||||
"""Move the motor to the given position."""
|
||||
if self.fail:
|
||||
return
|
||||
# raise RuntimeError(f"Motor {self.name} failed")
|
||||
time.sleep(self.delay)
|
||||
self.position = pos
|
||||
@@ -168,23 +168,23 @@ class BPMScans:
|
||||
}
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class MirrorConfig:
|
||||
"""Define the names of the mirror channels"""
|
||||
# @dataclass(frozen=True)
|
||||
# class MirrorConfig:
|
||||
# """Define the names of the mirror channels"""
|
||||
|
||||
hfm = {
|
||||
"bu_name": dev.hfm_bu.name,
|
||||
"bd_name": dev.hfm_bd.name,
|
||||
"z_name": dev.samcam_xsig.name,
|
||||
"x_device": dev.hfm_bu,
|
||||
"y_device": dev.hfm_bd,
|
||||
}
|
||||
vfm = {
|
||||
"bu_name": dev.vfm_bu.name,
|
||||
"bd_name": dev.vfm_bd.name,
|
||||
"z_name": dev.samcam_ysig.name,
|
||||
"x_device": dev.vfm_bu,
|
||||
"y_device": dev.vfm_bd,
|
||||
}
|
||||
# hfm = {
|
||||
# "bu_name": dev.hfm_bu.name,
|
||||
# "bd_name": dev.hfm_bd.name,
|
||||
# "z_name": dev.samcam_xsig.name,
|
||||
# "x_device": dev.hfm_bu,
|
||||
# "y_device": dev.hfm_bd,
|
||||
# }
|
||||
# vfm = {
|
||||
# "bu_name": dev.vfm_bu.name,
|
||||
# "bd_name": dev.vfm_bd.name,
|
||||
# "z_name": dev.samcam_ysig.name,
|
||||
# "x_device": dev.vfm_bu,
|
||||
# "y_device": dev.vfm_bd,
|
||||
# }
|
||||
|
||||
|
||||
|
||||
Regular → Executable
+22
-29
@@ -1,38 +1,31 @@
|
||||
"""Test state changes"""
|
||||
|
||||
import random
|
||||
import time
|
||||
|
||||
def test_mv():
|
||||
tol = 0.1
|
||||
if abs(dev.coll_y.position) < tol:
|
||||
value = 40
|
||||
else:
|
||||
value = 0
|
||||
print(f"Moving coll_y to {value}")
|
||||
s = scans.mv(dev.coll_y, value, relative=False)
|
||||
s.wait(timeout = 3)
|
||||
|
||||
def test_states():
|
||||
d = init_se_devices()
|
||||
states, allow_modifiers = get_states()
|
||||
deps = planner_deps()
|
||||
planner = StateManager(d, states, allow_modifiers, deps)
|
||||
states_to_test = [
|
||||
BeamlineState.ROBOT_SAMPLE_EXCHANGE,
|
||||
BeamlineState.DATA_COLLECTION,
|
||||
BeamlineState.MANUAL_SAMPLE_EXCHANGE,
|
||||
BeamlineState.XTAL_SNAPSHOT,
|
||||
|
||||
]
|
||||
previous = None
|
||||
def state_test():
|
||||
d, planner = init_beamline_environment()
|
||||
tested_states = []
|
||||
for i in range(10):
|
||||
choices = [ s for s in states_to_test if s != previous]
|
||||
states_to_test = [BeamlineState.BEAMSTOP_ALIGNMENT,
|
||||
BeamlineState.DATA_COLLECTION,
|
||||
BeamlineState.MAINTENANCE,
|
||||
BeamlineState.ROBOT_SAMPLE_EXCHANGE,
|
||||
BeamlineState.SAMPLE_ALIGNMENT,
|
||||
# BeamlineState.DC_XRF,
|
||||
BeamlineState.FLUX_MEASUREMENT,
|
||||
BeamlineState.XTAL_SNAPSHOT,
|
||||
BeamlineState.MANUAL_SAMPLE_EXCHANGE,
|
||||
BeamlineState.BEAM_VISUALISATION]
|
||||
previous = None
|
||||
for i in range(20):
|
||||
choices = [s for s in states_to_test if s != previous]
|
||||
current = random.choice(choices)
|
||||
print(f"Moving to state {current}")
|
||||
print(f"Testing {current}")
|
||||
planner.move_to(current)
|
||||
tested_states.append(current)
|
||||
time.sleep(5)
|
||||
tested_states.append(current.name)
|
||||
previous = current
|
||||
print(f"Tested states: {tested_states}")
|
||||
planner.move_to(BeamlineState.MANUAL_SAMPLE_EXCHANGE)
|
||||
|
||||
print("\n".join(tested_states))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user