[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: |
Tue, 28 May 2013 12:15:16 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 |
On 05/28/2013 04:32 AM, Florian Schlembach wrote:
>> 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
>>
>
> Thanks, thats already a good solution. However, I would like to select
> the user_reg_addr from another Checkbox Widget (e.g. to select a
> specific function). Assuming an evaluated $user_reg_args by
> [user_reg_addr,1], it always executes the callback on an update of
> user_reg_addr, which is kinda obvious.
> Thus, I always need to type in the value *and* the address into the text
> field by hand. Although this would be acceptable, it is not so handy.
>
> I am wondering if there is some sort of a conditional execution of the
> callback in the python-xml framework?
>
I guess at some point, the builtin GRC functionality isnt smart enough.
I think you could obtain this with some custom python code. For example,
howabout a custom xml for grc that calls
self.my_usrp_source_block_id.set_user_reg, but all caches the address so
it doesnt give extra calls when the user makes gui changes.
You can put pretty much anything inside those <make></make> tags, so I
am imagining a class with a callback that does the right logic.
-josh