Hello all,
I am not sure whether this is strange behaviour or I am misunderstanding
what you can do with hier_blocks.
Problem is best described with an example:
from gnuradio import gr
class h_block(gr.hier_block2):
def init(self):
gr.hier_block2.init(self,
“h_block”,
gr.io_signature(1,1,gr.sizeof_float),
gr.io_signature(0,0,0))
hblock2 = h_block2()
self.connect(self, hblock2)
class h_block2(gr.hier_block2):
def init(self):
gr.hier_block2.init(self,
“h_block2”,
gr.io_signature(1,1,gr.sizeof_float),
gr.io_signature(0,0,0))
self.connect(self, gr.multiply_const_ff(1), gr.null_sink(4))
class temp(gr.top_block):
def init(self):
gr.top_block.init(self)
source = gr.null_source(4)
hblock = h_block()
self.connect(source, hblock)
self.start()
if name == “main”:
app = temp()
When I run the above example I get:
sdrts@sdrts:~/sdrts/test$ python gr3.2_test.py
Traceback (most recent call last):
File “gr3.2_test.py”, line 29, in
app = temp()
File “gr3.2_test.py”, line 26, in init
self.start()
File
“/opt/gnuradio/trunk//lib/python2.5/site-packages/gnuradio/gr/top_block.py”,
line 95, in start
self._tb.start()
File
“/opt/gnuradio/trunk//lib/python2.5/site-packages/gnuradio/gr/gnuradio_swig_py_runtime.py”,
line 1411, in start
return _gnuradio_swig_py_runtime.gr_top_block_sptr_start(*args,
**kwargs)
RuntimeError: multiply_const_ff(4): insufficient connected output ports
(1
needed, 0 connected)
sdrts@sdrts:~/sdrts/test$
There is no error if in h_block2 the connect line is just
self.connect(self,
gr.null_sink(4)).
I am running an ubuntu 8.10 server, same output on 3.1.3, 3.2 and trunk.
Thoughts?
Kieran