discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Grabbing object references in GRC


From: Marcus D. Leech
Subject: [Discuss-gnuradio] Grabbing object references in GRC
Date: Sat, 29 Jun 2013 14:33:12 -0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

One of the things I've wanted to do for some time is the ability to pass a reference to a flow-graph object to "helper" Python code that I often import into my flow-graphs. Such "helper" code is often called upon to do things like calculate filter coefficients, or other variable settings where the setting equation/algorithm is a little too cumbersome to be expressed insde a parameter field directly. I also use such "helper" code to do things like
  logging low-rate data from a function_probe.

The function probe stuff, internally, basically aquires a reference to the target block in the flow-graph, and calls an arbitrary method off that
  object, at some programmable rate.

I'd like to be able to make that more general, so that I could pass such an object reference to my "helper" functions without having to edit
  the generated Python.

I *think* it should be fairly straightforward to define a new type of variable that simply holds a reference to an object, and which can be passed around like other variables in GRC, and in particular passed into one of my "helper" functions.

The particular use-case I have in front of me now is the ability to set gpio pins, which is currently not really possible from GRC flow-graphs, since you have to acquire a dboard_iface object first, which in turn means you need a handle to the containing multi_usrp object.

Discuss :)


--
Marcus Leech
Principal Investigator
Shirleys Bay Radio Astronomy Consortium
http://www.sbrac.org




reply via email to

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