[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Question about GNU Radio Companion - Calling an e
Re: [Discuss-gnuradio] Question about GNU Radio Companion - Calling an external function from a QT GUI Push Button
Mon, 15 Jul 2019 17:05:54 +0000
* write a Python class that has a function that takes an argument, and
calls the external function you want
* write a GRC block definition (GNU Radio 3.7: XML file, GNU Radio 3.8:
YAML), wrapping that class
* in that, define a property that has a callback; use the function
you've defined above
* add the block to your flow graph
* use the ID of your push button in the aforementioned property.
I see no way of doing that with stock GNU Radio blocks.
On Mon, 2019-07-15 at 19:34 +0300, Vladimir Marinov wrote:
> I'm working on a project with GNU Radio Companion and I have a question about
> how calling an external function ( defined in a separate .py file ) might be
> My goal is to be able to create a QT Push Button, which when pressed would
> call the function.
> I was initially hoping to use the QT Push Button Block from GNU Radio
> Companion and somehow set its callback function to be the desired one. Now,
> after reading through the docs and looking through the settings for the block
> in GNU Radio Companion, as I understand it the Push Button Block is
> essentially a variable with two different values depending on if the button
> is pressed or not. Am I missing something or is it not possible for the block
> to call some other external function of my own.
> I know that this could be fixed by creating an Out-Of-Tree block, or by
> modifying the python file that GNU Radio Companion generates, but as this
> project is going to be used for educational purposes, I would prefer to keep
> it as simple as possible ( if possible only within the standard blocks from
> GNU Radio Companion).
> Any tips would be very appreciated. Thanks for your time!
> Best Regards,
> Discuss-gnuradio mailing list
Description: S/MIME cryptographic signature