About how to write c++ based signal processing block

Hi Gurus,

To learn how to write the signal processing block over C++, I downloaded
the gr-how-to-write-a-block and successfully build the block and passed
the
test.
But my question is, for a block writer who is not familiar with the
complex
building tree, like the makefile writing, can the future block writing
just
be simply based on the building framework provided by the
gr-how-to-write-a-block example? I mean, I do not want to dig too much
the
makefile, but just reuse the current example with minor modification, to
meet all the requirements from the new block generating.

Thanks,

Alex,
Dreams can come true just believe.

On Wed, Feb 15, 2012 at 11:15:55AM -0600, Alex Z. wrote:

all the requirements from the new block generating.
Sure that’s OK.
You can also use gr_modtool.py (available at
https://cgran.org/wiki/devtools)
which does all the Makefile editing for you.

If you’re using the autotools version of howto-write-a-block (which
apparently you are), you need the older version.

MB


Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association

Hi Martin,

i have used gr_modtool.py to create custom blocks and all these new
blocks
are working fine. Thanks to u for this good utility.

I have python/gnuradio installed on two machines. Same version of
gr_modtool.py (downloaded yesterday) works fine on one but on second
machine, it creates new module but when we try to add some block, it
exits
with following error.

[email protected]:~/Desktop/blocks$ gr_modtool.py newmod mydsp
Module directory is “./gr-mydsp”.
Creating directory…
Copying howto example…
Unpacking…
Replacing occurences of ‘howto’ to ‘mydsp’…
Done.
Use ‘gr_modtool add’ to add a new block to this currently empty module.
[email protected]:~/Desktop/blocks$ cd gr-mydsp/
[email protected]:~/Desktop/blocks/gr-mydsp$ gr_modtool.py add
Operating in directory .
GNU Radio module name identified: mydsp
Enter code type: sync
Code is of type: sync
Enter name of block/code (without module name prefix): algorithm1_ff
Block/code identifier: algorithm1_ff
Full block/code identifier is: mydsp_algorithm1_ff
Enter valid argument list, including default arguments: int x
Add Python QA code? [Y/n] y
Add C++ QA code? [Y/n] n
Traversing lib…
Adding file ‘mydsp_algorithm1_ff.h’…
Adding file ‘mydsp_algorithm1_ff.cc’…
Traceback (most recent call last):
File “/usr/local/bin/gr_modtool.py”, line 2315, in
main()
File “/usr/local/bin/gr_modtool.py”, line 2312, in main
modtool.run()
File “/usr/local/bin/gr_modtool.py”, line 748, in run
self._run_lib()
File “/usr/local/bin/gr_modtool.py”, line 787, in _run_lib
ed.append_value(‘add_library’, fname_cc)
File “/usr/local/bin/gr_modtool.py”, line 503, in append_value
count=1, flags=re.MULTILINE)
TypeError: sub() got an unexpected keyword argument ‘flags’
[email protected]:~/Desktop/blocks/gr-mydsp$

Thanks,
Adeel

On Fri, Feb 17, 2012 at 02:01:36AM -0500, Adeel A. wrote:

Traceback (most recent call last):
TypeError: sub() got an unexpected keyword argument ‘flags’
Hi Adeel,

Ben R. pointed this out to me yesterday: gr_modtool.py needs Python
2.7. I argued that anyone using the CMake version of the blocks would
have access to 2.7… guess I was wrong.
I’m afraid I can’t post a fix to this right now (would mean some
rewriting), but I’ll add a version check so the error message becomes
more useful.

MB


Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs