Script execution

This commit is contained in:
gac-x03da
2020-03-10 11:58:56 +01:00
parent 9956bfa952
commit 2b860f7da4

View File

@@ -1,9 +1,8 @@
import ch.psi.pshell.device.ControlledSpeedable as ControlledSpeedable
import ch.psi.pshell.device.Speedable as Speedable
class PseudoMotor(RegisterBase, ControlledSpeedable):
class PseudoMotor(RegisterBase, Speedable):
def __init__(self):
self.velocity = self.getDefaultSpeed()
self.readback = 0.0
self.setpoint = 0.0
self.settime = time.time()
@@ -20,21 +19,11 @@ class PseudoMotor(RegisterBase, ControlledSpeedable):
self.setpoint = val
def getSpeed(self):
return self.velocity
def setSpeed(self, speed):
self.velocity=speed
def getDefaultSpeed(self):
return 1.0
def getMinSpeed(self):
return 0.1
def getMaxSpeed(self):
return 10.0
return 3.0
positioner = PseudoMotor()
add_device(positioner, True);
cscan(positioner, MachineCurrent, 0, 10, 1.0, time=5.0)
show_panel(positioner)
cscan(positioner, MachineCurrent, 0, 10, 1.0)