Search code examples
gnuradiognuradio-companion

Differences in display of parameters between GNU Radio 3.7 and 3.8


I am porting multi-rtl to GNU Radio 3.8. I've actually done all the porting and I already have a program that works. Now only a few cosmetic changes are missing, such as new examples. When I wanted to make a new example, I realized that the block is displayed for me differently than in the picture. Here is this picture from documentation (original program): enter image description here

Here is how this block is displayed for me (in my ported program): enter image description here

It's even expected behavior. Here are parameters of this block (they're generated for each n in this way):

-   id: sync_gain${n}
    label: "Ch${n}: Sync RF Gain (dB)"
    category: Synchronization
    dtype: real
    default: 10
    hide: ${"$"}{ 'part' if nchan > ${n} else 'all' }
-   id: freq${n}
    label: "Ch${n}: Frequency (Hz)"
    category: RF Options
    dtype: real
    default: 100e6
    hide: ${"$"}{ 'none' if nchan > ${n} else 'all' }
-   id: gain${n}
    label: "Ch${n}: RF Gain (dB)"
    category: RF Options
    dtype: real
    default: 10
    hide: ${"$"}{ 'part' if nchan > ${n} else 'all' }
-   id: gain_mode${n}
    label: "Ch${n}: Gain Mode"
    category: RF Options
    dtype: bool
    default: False
    hide: ${"$"}{ 'part' if nchan > ${n} else 'all' }
    options: [ False, True ]
    option_labels: [ Manual, Automatic ]
-   id: id_string${n}
    label: "Ch${n}: ID string"
    dtype: string
    default: "${n}"
    hide: ${"$"}{ 'part' if nchan > ${n} else 'all' }

The only parameter with the hide option set to none is "Ch $ {n}: Frequency (Hz)" so it's also only parameter that is displayed "outside". It's normal. However, I do not understand why the equivalent of this code in gnuradio 3.7 is displayed differently. Here's GNU Radio 3.7 code that I think is equivalent:

<param>
  <name>Ch$(n): Sync RF Gain (dB)</name>
  <key>sync_gain$(n)</key>
  <value>10</value>
  <type>real</type>
  <hide>\#if \$nchan() > $n then 'part' else 'all'#</hide>
  <tab>Synchronization</tab>
</param>
<param>
  <name>Ch$(n): Frequency (Hz)</name>
  <key>freq$(n)</key>
  <value>100e6</value>
  <type>real</type>
  <hide>\#if \$nchan() > $n then 'none' else 'all'#</hide>
  <tab>RF Options</tab>
</param>
<param>
  <name>Ch$(n): RF Gain (dB)</name>
  <key>gain$(n)</key>
  <value>10</value>
  <type>real</type>
  <hide>\#if \$nchan() > $n then 'part' else 'all'#</hide>
  <tab>RF Options</tab>
</param>
<param>
  <name>Ch$(n): Gain Mode</name>
  <key>gain_mode$(n)</key>
  <value>False</value>
  <type>bool</type>
  <hide>\#if \$nchan() > $n then 'part' else 'all'#</hide>
  <option>
    <name>Manual</name>
    <key>False</key>
  </option>
  <option>
    <name>Automatic</name>
    <key>True</key>
  </option>
  <tab>RF Options</tab>
</param>
<param>
  <name>Ch$(n): ID string</name>
  <key>id_string$(n)</key>
  <value>"$(n)"</value>
  <type>string</type>
  <hide>\#if \$nchan() > $n then 'part' else 'all'#</hide>
</param>

Why are they displayed differently?


Solution

  • Why are they displayed differently?

    Probably some bug in your gnuradio 3.7 version. I just tested it with gnuradio 3.7.13.5 and the displayed block is similar to your gnuradio 3.8 example.

    enter image description here

    If you want to see all parameters change 'part' to 'none'. See also https://wiki.gnuradio.org/index.php/YAML_GRC#Parameters