QT GUI Toggle Button: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
(initial creation)
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:


== Parameters ==
== Parameters ==
(''R''): <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span>
<b>(''R''):</b> <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span>


; Id
; Id
Line 13: Line 13:


; Label
; Label
: dtype: string
: default: ""
: the name for the LED
: the name for the LED


; Type
; Type
: dtype: enum
: default: Integer
: options: [Float, Integer, String, Boolean]
: options: [Float, Integer, String, Boolean]


Line 26: Line 22:


; Initial State
; Initial State
: dtype: enum
: default: Released
: options: [Released, Pressed]
: options: [Released, Pressed]


Line 37: Line 31:


; Message Property Name
; Message Property Name
: dtype: string
: default: value
: default: value


; Released Background
; Released Background
: dtype: enum
: default: default
: options: [default, silver, gray, black, white, red, green, blue, navy, yellow, orange, purple, lime, aqua, teal]
: options: [default, silver, gray, black, white, red, green, blue, navy, yellow, orange, purple, lime, aqua, teal]


; Released Font Color
; Released Font Color
: dtype: enum
: default: default
: options: see above
: options: see above


; Pressed Background
; Pressed Background
: dtype: enum
: default: default
: options: see above
: options: see above


; Pressed Font Color
; Pressed Font Color
: dtype: enum
: default: default
: options: see above
: options: see above


Line 76: Line 61:
== Source Files ==
== Source Files ==


; C++ files
; Python files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-qtgui/python/qtgui/togglebutton.py]
 
; Header files
: [https://github.com/gnuradio/gnuradio TODO]
 
; Public header files
: [https://github.com/gnuradio/gnuradio TODO]


; Block definition
; Block definition
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-qtgui/grc/qtgui_togglebutton.block.yml]


[[Category:Block Docs]]
[[Category:Block Docs]]

Latest revision as of 10:27, 18 November 2022

This block creates a variable toggle button. Leave the label blank to use the variable id as the label.

A toggle button selects between two values of similar type, but will stay depressed until clicked again. The variable will take on one value or the other depending on whether the button is pressed or released.

This button also will produce a state message matching the set values.
Added in 3.9

Parameters

(R): Run-time adjustable

Id
The variable name
Label
the name for the LED
Type
options: [Float, Integer, String, Boolean]
Default Value
default: 0
Initial State
options: [Released, Pressed]
Pressed
default: 1
Released
default: 0
Message Property Name
default: value
Released Background
options: [default, silver, gray, black, white, red, green, blue, navy, yellow, orange, purple, lime, aqua, teal]
Released Font Color
options: see above
Pressed Background
options: see above
Pressed Font Color
options: see above

See GUI Hint for how to position the GUI within a window.

Example Flowgraph

This flowgraph can be found at [1]

Test led fg.png

Example Output

The Msg Based State widget is the Toggle Button.

Test led out.png

Source Files

Python files
[2]
Block definition
[3]