discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: OOT block with variable sink types


From: Jeff Long
Subject: Re: OOT block with variable sink types
Date: Mon, 9 May 2022 17:28:44 -0400

From the framework's point of view, only item size is defined, not type. So, it is up to the block code and the GRC yaml files to coordinate user selection of a type and block interpretation of a type. This can be tricky if two types have the same size, e.g., complex int16 vs. real float.

Some of the C++ blocks use templates to make whatever_ff vs whatever_cc. You could make separate blocks in Python that subclass a common one, using some decorator trickery maybe.

The sink constructor could take a type, in Python, then the block can do the appropriate thing on instantiation.

The important thing to understand is that, unless templating is used, I/O types are managed "out-of-band".

Take a look at gr-blocks/lib/file_sink_impl.cc for an example of a sink with a variable type (that is not templated).

On Mon, May 9, 2022 at 5:08 PM Price, Rodney D. <Price-Rodney@zai.com> wrote:

Hi,

 

I have a Python OOT block that right now has a sink with complex type. I’d like to give the user the option to change that to float or int. Many blocks do this, and I’ve looked at the source code (C++), but I haven’t been able to suss out how it’s being done. Is there some straightforward way to give the user options on the type of streams in and out?

 

Thanks,

-Rod Price

 


This message is intended only for the use of the individual or entity to which it is addressed and may contain ZETA Associates confidential or proprietary information. If you are not the intended recipient, any use, dissemination, or distribution of this communication is prohibited. If you have received this communication in error, please notify the sender and delete all copies.

reply via email to

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