This commit is contained in:
2015-05-12 14:55:01 +02:00
parent 031a4bd76c
commit 2fde7bbfc9
2 changed files with 66 additions and 0 deletions

26
script/local.py Normal file
View File

@@ -0,0 +1,26 @@
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()