diff --git a/script/local.py b/script/local.py new file mode 100644 index 0000000..3fd9ad4 --- /dev/null +++ b/script/local.py @@ -0,0 +1,32 @@ +#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() + + +positioner1 = create_channel_device('TESTIOC:TESTCALCOUT:Input', type = 'd') +detector1 = create_channel_device('TESTIOC:TESTCALCOUT:Output', type = 'd') +detector2 = create_channel_device('TESTIOC:TESTSINUS:SinCalc', type = 'd') \ No newline at end of file