added Eugenio's phase-shifter/CHIC calculation (still disabled)

This commit is contained in:
2021-06-22 14:38:55 +02:00
parent 5bee44bfd1
commit 6f6c8ee7b4
2 changed files with 25 additions and 4 deletions

View File

@ -20,9 +20,10 @@ und_name_cal = "SATUN12-UIND030"
class Undulators(Adjustable):
def __init__(self, scaled=True):
super().__init__(name="z Athos Undulators", units="eV")
def __init__(self, scaled=True, name="Athos Undulators", units="eV"):
super().__init__(name=name, units=units)
self.adjs = {name: Undulator(name) for name in und_names}
self.chic = CHIC(name, units)
self.scaled = scaled
@ -63,6 +64,8 @@ class Undulators(Adjustable):
t = a.set_target_value(k_new, hold=False)
tasks.append(t)
wait_for_all(tasks)
print("Warning: CHIC adjustment is still commented!")
# self.chic.set_target_value(value) #TODO: test whether an additional sleep is needed
return self._as_task(change, hold=hold)
@ -150,3 +153,21 @@ class ScalerEK:
class CHIC(PVAdjustable):
def __init__(self, name, units):
name += " CHIC Energy"
super().__init__("SATUN-CHIC:PHOTON-ENERGY", name=name)
self.pvs.start = PV("SATUN-CHIC:APPLY-DELAY-OFFSET-PHASE")
self.units = units
def set_target_value(self, value):
value /= 1000
super().set_target_value(value)
self.pv_start.put(1)
def get_current_value(self):
return super().get_current_value() * 1000