Back to manulal CHIC
This commit is contained in:
33
undulator.py
33
undulator.py
@@ -9,8 +9,8 @@ from slic.core.scanner.scanbackend import wait_for_all #, stop_all
|
||||
|
||||
# 14 is the CHIC
|
||||
n_unds = [
|
||||
6, 13,
|
||||
15, 16, 17, 18, 19, 20, 21
|
||||
6, 7, 8, 9, 10, 11, 12, 13,
|
||||
15, 16, 17, 18, 19, 20, 21, 22
|
||||
]
|
||||
|
||||
und_names = [f"SATUN{n:02}-UIND030" for n in n_unds]
|
||||
@@ -64,17 +64,10 @@ class Undulators(Adjustable):
|
||||
t = a.set_target_value(k_new, hold=False)
|
||||
tasks.append(t)
|
||||
wait_for_all(tasks)
|
||||
print("CHIC adjustment is automatic")
|
||||
|
||||
if abs(delta)>0.001 :
|
||||
print("E changed: waiting 10 sec for CHIC")
|
||||
sleep(10)
|
||||
else :
|
||||
sleep(2)
|
||||
print("No E change: wainting 2 sec for CHIC")
|
||||
|
||||
#self.chic.set_target_value(value, hold=False) #TODO: test whether an additional sleep is needed
|
||||
#print("CHIC adjustment done")
|
||||
print("CHIC adjustment follows")
|
||||
self.chic.set_target_value(value, hold=False).wait() #TODO: test whether an additional sleep is needed
|
||||
sleep(10)
|
||||
print("CHIC adjustment done")
|
||||
|
||||
return self._as_task(change, hold=hold)
|
||||
|
||||
@@ -180,11 +173,9 @@ class CHIC(PVAdjustable):
|
||||
def change():
|
||||
sleep(1)
|
||||
print("CHIC setvalue")
|
||||
print(value)
|
||||
self.pvs.setvalue.put(value, wait=False)
|
||||
sleep(1)
|
||||
self.pvs.setvalue.put(value, wait=True)
|
||||
print("CHIC start")
|
||||
self.pvs.start.put(1, wait=False)
|
||||
self.pvs.start.put(1, wait=True)
|
||||
#TODO: test whether an additional sleep is needed
|
||||
sleep(1)
|
||||
|
||||
@@ -194,6 +185,14 @@ class CHIC(PVAdjustable):
|
||||
def get_current_value(self):
|
||||
return super().get_current_value() * 1000
|
||||
|
||||
class Mono(PVAdjustable):
|
||||
|
||||
def __init__(self, name, accuracy=0.01):
|
||||
pvname_setvalue = name + ":SetEnergy"
|
||||
pvname_readback = name + ":photonenergy"
|
||||
super().__init__(pvname_setvalue, pvname_readback=pvname_readback, accuracy=accuracy, active_move=True, name=name)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user