|
From: | Gavin Jacobs |
Subject: | Re: 3.9 Setup for OOT development |
Date: | Sat, 23 Jan 2021 23:34:42 +0000 |
@Criss Swaim - you were partly right. The problem was in the yml file, but not because I skipped that makeyaml step. The 'gr_modtool add' step
provides a template yml file, which is a better starting point than the output of 'gr_modtool makeyaml'. The output of the latter does not include the "templates" section.
So, I used the instructions found here
and here
That made some progress! Now I can get the module/block onto the flowgraph and connect the inputs & outputs.
But when I try to execute the flow graph I get this error:
Generating: '/home/gavin/GNU_Stuff/GRC/U39/U39.py'
Executing: /usr/bin/python3 -u /home/gavin/GNU_Stuff/GRC/U39/U39.py
Warning: failed to XInitThreads()
Traceback (most recent call last):
File "/home/gavin/GNU_Stuff/GRC/U39/U39.py", line 35, in <module>
import tooltest
ModuleNotFoundError: No module named 'tooltest'
Note: the XInitThreads happens all the time and other flowgraphs work fine inspite of it.
Next I compared my yml file (see below) to the in-tree ABS block and discovered that all the gnuradio blocks have a new keyword "flags" and a new section called "cpp_templates:", so I copied those to my file. But of course, that didn't help because it points
to the location of the gnuradio modules/blocks, and I need to edit it - but I don't quite see what I should put in there.
So, questions:
Thanks,
Gavin
Here is my yml file:
id: tooltest_wire
label: wire
category: '[tooltest]'
flags: [ python, cpp ]
templates:
imports: import tooltest
make: tooltest.wire(${k})
cpp_templates:
includes: ['#include <gnuradio/blocks/tooltest_wire.h>']
declarations: 'blocks::tooltest_wire:sptr ${id};'
make: 'this->${id} = blocks::tooltest_wire::make(${k});'
# 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: k
label: Scale Factor
dtype: float
default: '1'
# 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: in
domain: stream
dtype: float
outputs:
- label: out
domain: stream
dtype: float
# 'file_format' specifies the version of the GRC yml format used in the file
# and should usually not be changed.
file_format: 1
|
[Prev in Thread] | Current Thread | [Next in Thread] |