print name of undulator if it arrives; changed the undulator K accuracy
This commit is contained in:
@ -88,7 +88,7 @@ class Undulators(Adjustable):
|
|||||||
|
|
||||||
def change():
|
def change():
|
||||||
#TODO: replace by set_all_target_values_and_wait when print not needed anymore
|
#TODO: replace by set_all_target_values_and_wait when print not needed anymore
|
||||||
tasks = []
|
tasks = {}
|
||||||
for (name, a), k_old, k_new in zip(self.adjs.items(), ks_current, ks_target):
|
for (name, a), k_old, k_new in zip(self.adjs.items(), ks_current, ks_target):
|
||||||
delta = k_old - k_new
|
delta = k_old - k_new
|
||||||
print(f"{name}: {k_old}\t->\t{k_new}\t({delta})")
|
print(f"{name}: {k_old}\t->\t{k_new}\t({delta})")
|
||||||
@ -96,8 +96,14 @@ class Undulators(Adjustable):
|
|||||||
print(f"{name} skipped since target K is nan")
|
print(f"{name} skipped since target K is nan")
|
||||||
continue
|
continue
|
||||||
t = a.set_target_value(k_new, hold=False)
|
t = a.set_target_value(k_new, hold=False)
|
||||||
tasks.append(t)
|
tasks[name] = t
|
||||||
wait_for_all(tasks)
|
# wait_for_all(tasks)
|
||||||
|
for n, t in tasks.items():
|
||||||
|
print("waiting for ", n)
|
||||||
|
t.wait()
|
||||||
|
print("target reached ", n)
|
||||||
|
|
||||||
|
print("starting radial motors")
|
||||||
|
|
||||||
# make sure new K values have been written TODO: needed?
|
# make sure new K values have been written TODO: needed?
|
||||||
sleep(2) # check if this can be shortened back to 0.5
|
sleep(2) # check if this can be shortened back to 0.5
|
||||||
@ -156,7 +162,7 @@ class Undulators(Adjustable):
|
|||||||
|
|
||||||
class Undulator(PVAdjustable):
|
class Undulator(PVAdjustable):
|
||||||
|
|
||||||
def __init__(self, name, accuracy=0.0005):
|
def __init__(self, name, accuracy=0.1):
|
||||||
pvname_setvalue = name + ":K_SET"
|
pvname_setvalue = name + ":K_SET"
|
||||||
pvname_readback = name + ":K_READ"
|
pvname_readback = name + ":K_READ"
|
||||||
super().__init__(pvname_setvalue, pvname_readback=pvname_readback, accuracy=accuracy, active_move=True, name=name, internal=True)
|
super().__init__(pvname_setvalue, pvname_readback=pvname_readback, accuracy=accuracy, active_move=True, name=name, internal=True)
|
||||||
|
Reference in New Issue
Block a user