added tweak in motor

This commit is contained in:
2020-05-14 22:16:54 +02:00
parent f06b041baa
commit 034be1f852
+13 -5
View File
@@ -210,7 +210,7 @@ class MotorRecord:
if not step_value:
step_value = pv.get()
print(f"Tweaking {self.name} at step size {step_value}", end="\r")
help = "q = exit; up = step*2; down = step/2, left = neg dir, right = pos dir\n"
help = help + "g = go abs, s = set"
print(f"tweaking {self.name}")
@@ -220,11 +220,16 @@ class MotorRecord:
oldstep = 0
k = KeyPress()
cll = colorama.ansi.clear_line()
class Printer:
def print(self,**kwargs):
print(cll + f"stepsize: {self.stepsize}; current: {kwargs['value']}", end="\r")
def print(self, **kwargs):
print(
cll + f"stepsize: {self.stepsize}; current: {kwargs['value']}",
end="\r",
)
p = Printer()
print(' ')
print(" ")
p.stepsize = step_value
p.print(value=self.get_current_value())
self.add_value_callback(p.print)
@@ -235,7 +240,7 @@ class MotorRecord:
oldstep = step_value
k.waitkey()
if k.isu():
step_value= step_value * 2.0
step_value = step_value * 2.0
pv.put(step_value)
elif k.isd():
step_value = step_value / 2.0
@@ -270,6 +275,9 @@ class MotorRecord:
print(help)
print(f"final position: {self.get_current_value()}")
def tweak(self, *args, **kwargs):
return self._tweak_ioc(*args, **kwargs)
class ChangerOld:
def __init__(self, target=None, parent=None, mover=None, hold=True, stopper=None):