[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuradio-discuss
Subject:    Problems specifying GUI Hints in hierarchical blocks
From:       Ville Eerola <ville.eerola () iki ! fi>
Date:       2022-06-13 13:30:24
Message-ID: 7d8e881c-e76d-caba-45e9-dfb6f7027896 () iki ! fi
[Download RAW message or body]

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

[Attachment #3 (text/html)]

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-text-html" lang="x-unicode"> 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.<br>
      <br>
      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. <br>
      <br>
      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.<br>
      <br>
      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. <br>
      <br>
      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.<br>
      <br>
      I'm looking any suggestions about how to tackle my problem.<br>
      <br>
      Regards, Ville<br>
      <br>
    </div>
  </body>
</html>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic