I'm trying to implement a multi-channel receiver with GNU Radio. Each
channel has a number of tunable parameters, that I want to be available
to the user to control via a GUI.
I'm doing the design using the GNU Radio Companion. So far, I have been
able to build a demonstration version of the receiver with a small
number of simplified channels that are created as one non-hierarchical
flowgraph. I'm using a QT GUI Tab Widget to contain the GUI elements of
the receiver in organized groups. One of the tabs is used to contain the
GUI controls (GT GUI Entry, QT Toggle Switch, QT Gui Range, etc) for the
channel parameters. There is one row for each channel and I can use the
GUI Hints fields to place the the controls where I want them to go.
This seems to work, but as the complexity of the channels will grow, and
the number of channels will increase, the top level flowgraph will
become unmanageable and unmaintainable. Also, the probability of making
errors in creating the many channels will grow.
I was thinking to use the hierarchical blocks to implement the channels
and then just instantiating the required number of those channels in the
top level. I'd like to find a way to either include the GUI controls for
the channels in the hierarchical blocks or some other suitable way to
implement them. But I have not been able to find a way to pass the GUI
Hint parameters from the top level block to the instantiated
hierarchical blocks. I also tried to investigate if it would be possible
to programmatically generate the GUI Hints based on some parameters
passed to the hierarchical blocks. Reading what documentation I have
been able to find about the GUI Hint parameter has not helped me so far.
It is even unclear to me what datatype should be used for it. GRC seems
to have some built-in verification for the GUI Hints, which seem to
prevent using a Variable or a Parameter to provide the value for the GUI
Hint field.
I have tried to read the Python code generated by GRC and it seems to me
that the GRC generates the GUI by itself and the whatever GUI Hints are
written for the widgets are not visible directly in the generated code.
Matybe the GUI Hint fields do not get processed by the Python
interpreter and have no access to any variable / parameter values. It is
also not clear to me how the GRC handles hierarchical QT GUI blocks. I
have not found any examples or tutorials about them. If such a block is
instantiated to some top block, is it even possible to specify the GUI
element placement in the hierarchical blocks with GUI Hints. At least it
seems impossible to specify a tab name, where the tab is defined at the
top level block, since GRC prevents generating the code if the tab name
is undefined in the hierarchical block level.
Somebody has suggested to solve the GUI problems by using QT Designer to
design the GUI and then hand editing the code generated by GRC to merge
the QT GUI design file and the GRC generated Python code, but after each
modification to the flowgraph, this needs to be repeated. There must be
e better way.
I'm looking any suggestions about how to tackle my problem.
Regards, Ville