GRC: Hierarchical Blocks: Several Source- and Sink-Pads

Is GRC able to create Hierarchical Blocks with more than one Sink /
Source?

I tried to create such a Hierarchical Block in the following way which
failed:

In a blank GRC-File, I assigned in the Options-Block ID
(hierblocktest), Title (hier block test), Generate Options (Hier
Block) and Category (Custom).

I added two Pad Sources and two Pad Sinks, connected them
(connect(source1,sink1), connect(source2,sink2)), generated the flow
graph and restarted GRC.

To test the block, I added it to a new sheet. The Block is displayed
as if it had just one Sink and one Source.

I am using GNU Radio Companion 3.3git-696-g1ae689ff.

I added the ability to have multiple pads a few months ago. I believe
that
it works. Make sure that your git clone is recent enough ( im not sure
about
the version) and make sure that there is not this issue of multiple
gnuradio
installs (and possibly importing old grc modules).

-Josh

On Thu, Apr 8, 2010 at 1:41 PM, Christian Rohlfing <

I fetched the gnuradio code yesterday and installed it on Ubuntu 9.10.
It’s the only gnuradio install.

Here are the generated .py and .py.xml files and the .grc-file:

#!/usr/bin/env python
##################################################

Gnuradio Python Flow Graph

Title: testhierblock

Generated: Fri Apr 9 01:43:43 2010

##################################################

from gnuradio import gr
from gnuradio.gr import firdes

class testhierblock(gr.hier_block2):

def init(self):
gr.hier_block2.init(
self, “testhierblock”,
gr.io_signaturev(2, 2, [gr.sizeof_gr_complex1,
gr.sizeof_gr_complex
1]),
gr.io_signaturev(2, 2, [gr.sizeof_gr_complex1,
gr.sizeof_gr_complex
1]),
)

##################################################
# Variables
##################################################
self.samp_rate = samp_rate = 32000

##################################################
# Blocks
##################################################

##################################################
# Connections
##################################################
self.connect((self, 0), (self, 0))
self.connect((self, 0), (self, 0))

def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate

<?xml version='1.0' encoding='ASCII'?> testhierblock testhierblock Custom execfile("/home/christian/.grc_gnuradio/testhierblock.py") testhierblock() in complex 1 out complex 1

/home/christian/.grc_gnuradio/testhierblock.py

<?xml version='1.0' encoding='ASCII'?>

<flow_graph>
Fri Apr 9 01:45:18 2010

options

id
testhierblock


_enabled
True


title
testhierblock


author



description



window_size
1280, 1024


generate_options
hb


category
Custom


run_options
prompt


run
True


realtime_scheduling



_coordinate
(10, 10)


_rotation
0



variable

id
samp_rate


_enabled
True


value
32000


_coordinate
(10, 170)


_rotation
0



pad_source

id
pad_source_0


_enabled
True


label
in


type
complex


vlen
1


_coordinate
(198, 11)


_rotation
0



pad_sink

id
pad_sink_0


_enabled
True


label
out


type
complex


vlen
1


_coordinate
(412, 11)


_rotation
0



pad_sink

id
pad_sink_1


_enabled
True


label
out


type
complex


vlen
1


_coordinate
(413, 66)


_rotation
0



pad_source

id
pad_source_1


_enabled
True


label
in


type
complex


vlen
1


_coordinate
(198, 66)


_rotation
0



<source_block_id>pad_source_0</source_block_id>
<sink_block_id>pad_sink_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>


<source_block_id>pad_source_1</source_block_id>
<sink_block_id>pad_sink_1</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>

</flow_graph>

Am 08.04.2010 um 21:15 schrieb Josh B.:

Alright well, it looks like it needs fixing. I cant look at this until
sunday. Thanks for finding the problem! -Josh

On Fri, Apr 9, 2010 at 1:24 AM, Christian Rohlfing

FYI, this has been fixed and merged into the master.
http://gnuradio.org/cgit/gnuradio.git/commit/?id=a4ac44d7adbd9c6cdd107ec7985e294fea81845a

-Josh