21 lines
526 B
Python
21 lines
526 B
Python
import random
|
|
|
|
positioner = DummyPositioner("positioner")
|
|
|
|
class Sensor(Readable):
|
|
def __init__(self):
|
|
self.index = -1
|
|
def read(self):
|
|
#time.sleep(0.001)
|
|
self.index +=1
|
|
return self.index
|
|
#noise = (random.random() - 0.5) / 10.0
|
|
#return math.sin(time.time()) + noise
|
|
sensor = Sensor()
|
|
|
|
|
|
ret = lscan(positioner, sensor, scan_start, scan_stop, scan_steps, 0.01)
|
|
av = mean(ret.getReadable(0))
|
|
set_exec_pars(open=False)
|
|
print ret.path
|
|
set_return([av, ret.path + sensor.name]) |