Files
ncs/script/local.py
boccioli_m f4607f105a Creation
2015-05-20 11:39:56 +02:00

27 lines
496 B
Python

#det.data.monitored=True
import random
class SimulatedOutput(Writable):
def getName(self):
return "SimulatedOutput"
def write(self, value):
pass
class SimulatedInput(Readable):
def __init__(self):
self.x = 0.0
def getName(self):
return "SimulatedInput"
def read(self):
self.x = self.x + 0.2
noise = (random.random() - 0.5) / 20.0
return math.sin(self.x) + noise
sout = SimulatedOutput()
sinp = SimulatedInput()