New ScreenPanel
This commit is contained in:
39
script/TestRecordNull.py
Executable file
39
script/TestRecordNull.py
Executable file
@@ -0,0 +1,39 @@
|
||||
index = 0
|
||||
class AnalogInput(ReadonlyRegisterBase):
|
||||
def doRead(self):
|
||||
global index
|
||||
index = index+1
|
||||
if index<5:
|
||||
return None
|
||||
return sin.read()
|
||||
|
||||
class Waveform(ReadonlyRegisterBase, ReadonlyRegisterArray):
|
||||
def doRead(self):
|
||||
global index
|
||||
index = index+1
|
||||
if index<5:
|
||||
return None
|
||||
return arr.read()
|
||||
|
||||
def getSize(self):
|
||||
return arr.size
|
||||
|
||||
class Image(ReadonlyRegisterBase, ReadonlyRegisterMatrix):
|
||||
def doRead(self):
|
||||
global index
|
||||
index = index+1
|
||||
if index<5:
|
||||
return None
|
||||
return matrix.read()
|
||||
|
||||
def getWidth(self):
|
||||
return matrix.width
|
||||
|
||||
def getHeight(self):
|
||||
return matrix.height
|
||||
|
||||
add_device(AnalogInput("tst"), True)
|
||||
add_device(Waveform("tst2"), True)
|
||||
add_device(Image("tst3"), True)
|
||||
|
||||
tscan(tst3, 10, 0.1)
|
||||
Reference in New Issue
Block a user