Runtime Updating Variables: Difference between revisions
Mattcarrick (talk | contribs) No edit summary |
Mattcarrick (talk | contribs) No edit summary |
||
Line 23: | Line 23: | ||
[[File:SetRangeProperties.png|500px]] | [[File:SetRangeProperties.png|500px]] | ||
You will notice the message, ''ID "frequency" is not unique.'' This is because there is a variable and QT GUI Range both using the name ''frequency'', which will be addressed shortly. Click ''OK'' to save the properties. | |||
Right click on the variable block and select ''Disable'', or press ''D'': | |||
[[File:DisableVariableBlock.png|700px]] | |||
The block is now ignored and the error is resolved. | |||
[[File:VariableBlockDisabled.png|700px]] | |||
Revision as of 16:19, 4 January 2022
This section will describe how to update variables while a flowgraph is running using QT GUI Widgets. Please review the previous tutorial, Variables in Flowgraphs, for an introduction to variables.
QT GUI Range
The GNU Radio block library comes with a handful of QT GUI widgets which allow a user to interact and change a flowgraph while it is running. The QT GUI Range creates a slider bar that can be used to update a variable.
Search for range in the block library:
Drag and drop the QT GUI Range block into the workspace:
The QT GUI Range acts similarly to a variable block. The default parameters for the QT GUI Range need to be set. Double-click on it to edit the properties. The QT GUI Range block will replace the frequency variable, so first change the Id field to frequency.
The Default Value is the value when the flowgraph starts. This can be set to 0. The Start and Stop are the start and stop values of the slider. Enter -samp_rate/2 as the start value, and samp_rate/2 as the stop value. The Step value is the resolution of the slider. In this example the Step is set to 100 Hz:
You will notice the message, ID "frequency" is not unique. This is because there is a variable and QT GUI Range both using the name frequency, which will be addressed shortly. Click OK to save the properties.
Right click on the variable block and select Disable, or press D:
The block is now ignored and the error is resolved.
TODO: using other QT blocks