[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Performing callback function in GRC
From: |
Josh Blum |
Subject: |
Re: [Discuss-gnuradio] Performing callback function in GRC |
Date: |
Mon, 27 May 2013 19:59:26 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 |
On 05/27/2013 07:54 AM, Florian Schlembach wrote:
> I am trying to build a flow graph in GNU Radio Companion consisting of a
> USRP source block and a FFT sink. During runtime, I would like to send a
> user settings register to the USRP.
> Fortunately, everything is already employed so I only need to build some
> sort of variable control. By now, that already works out quite well
> using the WX GUI Widgets. A user settings command basically be send to
> the USRP using the
>
> void set_user_register(const uint8_t addr, const uint32_t data, size_t
> mboard)
>
> function that is part of the USRP source block. When changing the two
> variables $user_reg_addr and $user_reg_data, GRC invokes the callback
> function that I have defined in the file
> gnuradio/gr-uhd/grc/gen_uhd_usrp_blocks.py:
>
> <callback>set_user_register(\$user_reg_addr,
> \$user_reg_data,uhd.ALL_MBOARDS)</callback>
>
> If I now change either $user_reg_addr or $user_reg_data, the callback
> function is executed, which is not intended. In turn, I first would like
> to execute the callback function after I have modified *both* variables.
>
> Is there a convenient way to execute the callback function on a button
> click or something similar?
Perhaps it would work better to treat the input as one variable. Use a
tuple of numbers instead. You can make a text entry widget w/ converter
type "Evaluate".
The callback would probably look more like this:
<callback>set_user_register(*\$user_reg_args)</callback>
-josh
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio