This commit is contained in:
32
script/test/TestPipelineStream.py
Normal file
32
script/test/TestPipelineStream.py
Normal file
@@ -0,0 +1,32 @@
|
||||
add_device(PipelineStream("p","localhost:8889", "simulation_sp"), True)
|
||||
set_exec_pars(save=False)
|
||||
#tscan(p.channels,10,0.1)
|
||||
|
||||
|
||||
#Sync with stopped stream
|
||||
p.update() #First update to create children devices
|
||||
x_profile= p.getChannel("x_profile")
|
||||
tscan((p,x_profile),3,0.1)
|
||||
|
||||
|
||||
|
||||
#Async on running stream
|
||||
p.monitored=True
|
||||
p.stream.waitValueChange(-1)
|
||||
|
||||
|
||||
class StreamImage(ReadableMatrix):
|
||||
def read(self):
|
||||
return Convert.reshape(p.getValue("image") , (self.getHeight(), self.getWidth()))
|
||||
|
||||
def getWidth(self):
|
||||
return p.getValue("width")
|
||||
|
||||
def getHeight(self):
|
||||
return p.getValue("height")
|
||||
|
||||
mscan(p, StreamImage(), 5)
|
||||
|
||||
|
||||
#Sync on running stream
|
||||
tscan(p.channels,5,0.5)
|
||||
Reference in New Issue
Block a user