discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] How to add code to a gnuradio_companion variable


From: Kai Garrels
Subject: Re: [Discuss-gnuradio] How to add code to a gnuradio_companion variable setter
Date: Tue, 15 Aug 2017 19:35:25 +0200

Hi, 

thanks for all the hints I received.

Based on that, I managed to do a rude hack with the XML file and an embedded python module.
It works, but it just doesn't feel right :)

What I try to achieve; control an external radio via TCP commands based on the frequency (or other) variable in the flowgraph.

So I will investigate an OOT python block based on messages, sounds really more reasonable.

Which GUI blocks can send messages?

PS:
Yes, I struggled with GRC's real name. I use an alias "grc", and was not sure if everybody knows what I mean.
And then typos...




Am 15.08.2017 um 18:00 schrieb address@hidden:


Message: 5
Date: Mon, 14 Aug 2017 22:27:52 +0200
From: Marcus M?ller <address@hidden>
To: <address@hidden>
Subject: Re: [Discuss-gnuradio] How to add code to a
gnuradio_companion variable setter
Message-ID: <address@hidden>
Content-Type: text/plain; charset="utf-8"; format=flowed

Hi kai,

short version:

1. make an out-of-tree module
2. add new block ? python or cpp, doesn't matter, should be of type 
"noblock" if you really just want to do anything.
3. modify the XML file describing that block for the GNU Radio 
Companion, so that it has a parameter with a 
<callback>methodname($parametername)</callback> field.
4. do what you want in yourblock.methodname(parameter)
5. build and install that module

You'll find an intro on how to use gr_modtool to generate out-of-tree 
modules in the "Guided Tutorials" on http://tutorials.gnuradio.org .

BUT: I **Really** would discourage trying to do what you're doing. Use 
message passing instead. What is it that you want to build? I'm almost 
certain what you're trying to achieve can be done in different, less 
"complicated" manners.

Best regards,
Marcus

PS: we say "GRC" or "GNU Radio companion", because it's the "graphical 
companion to GNU Radio"; "gnu radio_companion" just seems wrong :)



reply via email to

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