discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Hierarchical block with multiple points-of-entry


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Hierarchical block with multiple points-of-entry
Date: Mon, 18 Apr 2005 12:58:51 -0700
User-agent: Mutt/1.5.6i

On Mon, Apr 18, 2005 at 01:50:12PM -0400, Rahul Dhar wrote:
> Is it possible to create a hierarchical block with two blocks as the
> "head" block?  For example, I want to do the following:
> 
> USRP Rx -> Demodulator -> ...
> USRP Rx -> Signal power calculator
> 
> The Demodulator and Signal power shpuld be the head blocks of a
> hierarchical block.  Is there some magic with the syntax to tell
> gr.hier_block.__init__ that it should have two heads, or is that just
> not allowed?
> 
> Thanks,
> -Rahul

Good question.

Short answer: no, but it's not hard to add for the simple case.

If you look at hier_block.py you'll see that there are two main classes:
An abstract base class hier_block_base and a concrete class
hier_block.

The abstract class defines resolve_input_port to return a sequence of
endpoints, so the low level interface supports what you want.

The only complication comes in ensuring that if you have multiple head
blocks, that they have input io_signatures that are compatible.  If their
input signatures are identical, then clearly there's no problem.  If
they're not identical, but there is some kind of compatible
intersection, then that ought to be possible too.

Handling the case where all the head io_signature are identical
shouldn't be a problem.

Basically you want to accept a head that is either a single item or
a tuple of items.  If it was a tuple of items, confirm that they
have identical input io_signatures, else raise an error.

Hopefully, this is enough of a clue for you to figure out how to get
what you want.  Looking forward to your patch ;-)

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]