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
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio