discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] GRC QT widget call function upon value change?


From: Marcus D. Leech
Subject: Re: [Discuss-gnuradio] GRC QT widget call function upon value change?
Date: Sat, 21 Apr 2018 16:25:20 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 04/21/2018 04:20 PM, Louis Brown wrote:
Is there a way to make a GRC widget, such as the QT GUI Chooser, call a function when it changes value?

I have some serial port writing functions defined in a Python Module block. I set the GUI Chooser options to write_serial(0), write_serial(1), etc.. The problem is the functions are evaluated only once during top_block execution, not when the Chooser value is changed.

I have tried a Function Probe to pass the Chooser value to my write_serial() once a second, but the Function Probe does not update with the new Chooser value.

Is there some trick to this?

Thanks,
Lou

Leverage the dependency evaluator.

Let's say your choose widget is called "foo".

Create a variable, "bar", in the value field:

your_function(foo)

Every time time that foo changes, it'll call your_function(foo), to satisfy the dependency that "bar" has on "foo".






reply via email to

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