Commit 0dd3c7a3 authored by bliss administrator's avatar bliss administrator
Browse files

check eneund.controller.approx before programming motion

parent ad101cb1
......@@ -587,15 +587,19 @@ class ID26StepXAS(ID26Measurement):
# get a list of "tracked" undulators:
undu_list = []
motion = ()
for one_undu in setup_globals.get_available_undulators():
print(one_undu.name)
if (one_undu.name[0] == 'u' and one_undu.track() == True):
undu_list = undu_list+ [one_undu.name]
# calculate desired gap openings for each "tracked" undulator and save into "xas_pos" Position Instance
for undname in undu_list:
pos = setup_globals.name_to_obj(undname).position
calc_position = ENEUND.controller.undu.energy2undulator(setup_globals.name_to_obj(undname),energy_target)
xas_pos.position(setup_globals.name_to_obj(undname),calc_position)
motion += (setup_globals.name_to_obj(undname), calc_position)
if abs(calc_position-pos) > ENEUND.controller.approx:
xas_pos.position(setup_globals.name_to_obj(undname),calc_position)
motion += (setup_globals.name_to_obj(undname), calc_position)
xas_pos.move(*motion)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment