Hi Steffen,

You're missing that the embedded Python Block should work just like any other block. If you want to read a button state or accept a message then you'll need to add a parameter to the Python block and pass in the button's ID (variable) to it or add a message port to the block.

The Embedded Python Block tutorial does a good job covering the message side and adding a parameter is part of the default Python Block template.
https://wiki.gnuradio.org/index.php/Embedded_Python_Block

As a related note, in the very latest maint-3.8 and master codebases there are now Python Snippets for injecting Python code directly into the generated program. It's useful for a variety of situations, but the ones you're describing here are already usually handled well by the existing features.

Cheers,
Derek

On 05/03/2020 13:13, Steffen Kiel wrote:
Hello!

I am new to using GNU radio, and i would like to implement some custom features. I would like to access functions like the get_push_button to read its state, or read a message box etc.
Is this even possible from the epy block?

I could also implement this directly in the top_block.py file, but my problem is that if i want to change something in the GUI, this file is overwritten, and the custom code will be erased. Or am i missing something?



Reply via email to