Talk:Guided Tutorial GNU Radio in C++

From GNU Radio
Jump to: navigation, search
gr_modtool changes in 3.8
gr_modtool nm doesn't exist anymore. Use newmod
Module creation adds a MANIFEST.md file now, in the format used by CGRAN.
Block creation asks for a copyright owner

Suggestion of YAML section:

Step 4 bis: Flesh out the YAML file

Since version 3.8, GNU Radio has replaced the The .yml provides the user interface between the OOT module displayed in the GRC and the source code. Moreover, the YAML file defines an interface to pass the parameters specific for the module. Hence, to access the module inside GRC, it is important to modify the .yml files manually. The YAML file for our block is named as tutorial_my_qpsk_demod_cb.block.yml inside the grc/ folder. Presently, the gr_modtool's version looks like:

Default version:

id: tutorial_my_qpsk_demod_cb
label: my_qpsk_demod_cb
category: '[tutorial]'

templates:
  imports: import tutorial
  make: tutorial.my_qpsk_demod_cb(${gray_code})

#  Make one 'parameters' list entry for every parameter you want settable from the GUI.
#     Keys include:
#     * id (makes the value accessible as \$keyname, e.g. in the make entry)
#     * label (label shown in the GUI)
#     * dtype (e.g. int, float, complex, byte, short, xxx_vector, ...)
parameters:
- id: ...
  label: ...
  dtype: ...
- id: ...
  label: ...
  dtype: ...

#  Make one 'inputs' list entry per input and one 'outputs' list entry per output.
#  Keys include:
#      * label (an identifier for the GUI)
#      * domain (optional - stream or message. Default is stream)
#      * dtype (e.g. int, float, complex, byte, short, xxx_vector, ...)
#      * vlen (optional - data stream vector length. Default is 1)
#      * optional (optional - set to 1 for optional inputs. Default is 0)
inputs:
- label: ...
  domain: ...
  dtype: ...
  vlen: ...
  optional: ...

outputs:
- label: ...
  domain: ...
  dtype: ...
  vlen: ...
  optional: ...

#  'file_format' specifies the version of the GRC yml format used in the file
#  and should usually not be changed.
file_format: 1


The parameter gray_code can be put under the parameters tag.

Adding parameter tag:

parameters:
- id: gray_code
  label: Gray Code
  dtype: bool
  default: 'True' 


Like the work function, the datatypes for the input and output ports represented by input and output tags should be modified.

Modifying source and sink tag:

  
inputs:
- label: in
  dtype: complex
  
outputs:
- label: out
  dtype: byte


After all the necessary modification the "tutorial_my_qpsk_demod_cb.block.yml" looks like this:

Modified version:

id: tutorial_my_qpsk_demod_cb
label: My QPSK Demodulator
category: '[tutorial]'

templates:
  imports: import tutorial
  make: tutorial.my_qpsk_demod_cb(${gray_code})

parameters:
- id: gray_code
  label: Gray Code
  dtype: bool
  default: 'True'

inputs:
- label: in
  dtype: complex
outputs:
- label: out
  dtype: byte.

file_format: 1