[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Python OOT Block Selectable Types
From: |
Martin Braun |
Subject: |
Re: [Discuss-gnuradio] Python OOT Block Selectable Types |
Date: |
Thu, 12 May 2016 11:11:28 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
You can either make this a block argument (i.e., you ask the user to
pass in numpy.float32 or whatever), or, to keep consistent with the C++
way of doing things, you can make a block argument called 'sizeof' and
then create a dict that maps sizes to numpy.<FOO> values, and use that
to set in_sig.
M
On 05/11/2016 02:04 PM, Richard Bell wrote:
> I've created a python based OOT block and I want to give the user the
> ability to select the input/output type. I know how to do this for C++
> based blocks, but I'm stuck on what to do with the python blocks
> signature, as it doesn't ask for the item_size like the C++ blocks do. I
> have to give it something explicit like
>
> in_sig = [numpy.float32]
>
> How do I write the generic sig that depends on what the user selected in
> GRC?
>
> Note: The algorithm in the body of this block doesn't change depending
> on type selected. It's a simple block.
>
> Thanks,
> Rich
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>