|
From: | Ron Economos |
Subject: | Re: 3.9 Setup for OOT development |
Date: | Thu, 4 Feb 2021 15:49:30 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
If you're converting from GNU Radio 3.7, you can automatically convert your .xml files into .yml files with the command:
gr_modtool update --complete
Just run it in the old OOT directory and copy over the .yml files to your new OOT. It does a very good (although not always perfect) job of converting.
Ron
I made some progress on this and now I have my OOT module/block working on Ubuntu 20.4, GNU Radio 3.9, written in C++, with callbacks and variable # of inputs.
There are two key things to report.First is the workflow. None of the tutorials on the wiki (that I found) were complete, but eventually I got it working as follows:
cd <your desired base for modules>gr_modtool newmod/* < choose modulename > */cd gr-modulenamegr_modtool add/* < answer questions about blockname > *//* < edit files:./include/modulename/blockname.h./lib/blockname_impl.h./lib/blockname_impl.cc./grc/modulename_blockname.block.yml> */gr_modtool bind blocknamemkdir buildcd buildcmake ../makesudo make installsudo ldconfig
NB - the 'bind' step must be done AFTER you edit the blockname.h file, and BEFORE you run cmake. So, if you make a mistake in the blockname.h file, you have to delete the build directory and go back to the bind step in the above sequence.
Second, the description of how to configure the yml file did not address variable number of inputs, nor callbacks. Here is a working example that shows both:
id: stream_selectlabel: Selectcategory: '[Stream]'
templates:imports: import streammake: stream.select(${qty}, ${ins})callbacks:- set_ins(${ins})
# 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: qtylabel: 'Number of Inputs'dtype: intdefault: 2
- id: inslabel: 'Input Selector'dtype: intdefault: 0
# 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: indtype: floatmultiplicity: ${ qty }
outputs:- label: outdtype: float
# 'file_format' specifies the version of the GRC yml format used in the file# and should usually not be changed.file_format: 1
NB - I should have used a better id for the second parameter (ins) - do not confuse that with the in and out definitions.
Hope that helps,Gavin
[Prev in Thread] | Current Thread | [Next in Thread] |