workaround

This commit is contained in:
gac-maloja
2022-10-12 17:32:05 +02:00
parent ee17250afa
commit 0b49d68236

View File

@ -1,5 +1,6 @@
from epics import PV
from slic.core.adjustable import Adjustable, PVAdjustable
from slic.core.task import Task
from slic.utils import json_load
from slic.utils import unpickle
from models.parallel_model import parallel2gap
@ -98,17 +99,18 @@ class UndShiftRadialBase(PVAdjustable): #TODO: better name?
def __init__(self, ID, accuracy=0.001):
super().__init__(ID + "-SET", ID + "-TL", accuracy=accuracy)
self.pv_on = PV(ID + "-ONOFF")
self.pv_on = PV(ID + "-ON")
self.pv_go = PV(ID + "-GO")
def set_target_value(self, value):
t = super().set_target_value(value)
print('wait1')
sleep(0.9)
print('wait2')
f = super().set_target_value
t = Task(
lambda: f(value)
)
t.start()
sleep(0.3)
self.pv_on.put(1)
print('wait3')
sleep(0.9)
sleep(0.3)
self.pv_go.put(1)
t.wait()
@ -169,8 +171,8 @@ if __name__ == "__main__":
ups = UndPhases("SATUN-PHASES", params)
sleep(1)
print(ups.phases[0], ups.phases[0].shift)
ups.phases[0].set_target_value(phase).wait()
print(ups.phases[0], ups.phases[0].shift)
# ups.phases[0].set_target_value(phase).wait()
# print(ups.phases[0], ups.phases[0].shift)