Commit 2b8de02e authored by augustin_s's avatar augustin_s 🐍
Browse files

added switch for enabling/disabling CHIC adjustment

parent dddb64a1
......@@ -15,7 +15,7 @@ N_UND_CHIC = 14
class Undulators(Adjustable):
def __init__(self, n_unds, n_und_ref, chic_fudge_offset=0, scaled=True, ID="ATHOS_UNDULATORS", name="Athos Undulators", units="eV"):
def __init__(self, n_unds, n_und_ref, chic_fudge_offset=0, adjust_chic=True, scaled=True, ID="ATHOS_UNDULATORS", name="Athos Undulators", units="eV"):
super().__init__(ID, name=name, units=units)
self.n_unds = n_unds = list(n_unds)
......@@ -34,6 +34,7 @@ class Undulators(Adjustable):
self.adjs = {name: Undulator(name) for name in und_names}
self.chic = CHIC(chic_fudge_offset, name, units)
self.adjust_chic = adjust_chic
self.scaled = scaled
self.convert = ConverterEK()
......@@ -73,9 +74,10 @@ class Undulators(Adjustable):
t = a.set_target_value(k_new, hold=False)
tasks.append(t)
wait_for_all(tasks)
print("CHIC adjustment follows")
self.chic.set_target_value(value, hold=False).wait() #TODO: test whether an additional sleep is needed
print("CHIC adjustment done")
if self.adjust_chic:
print("CHIC adjustment follows")
self.chic.set_target_value(value, hold=False).wait() #TODO: test whether an additional sleep is needed
print("CHIC adjustment done")
return self._as_task(change, hold=hold)
......
Markdown is supported
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