summaryrefslogtreecommitdiff
path: root/grc/core/generator
Commit message (Collapse)AuthorAgeFilesLines
* cmake: replace deprecated distutilsVolker Schroer2021-12-201-1/+1
| | | | | | | | | | | * gnuradio: replace deprecated distutils Check if python packaging is available Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com> * Add packaging requirement Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
* grc: modify and cleanup bokeh server loopNotou2021-12-071-48/+10
| | | | | Remake of the commits proposed to maint-3.8 to support the latest versions of bokeh. Signed-off-by: Cyrille Morin <barthy42@laposte.net>
* grc: pep8 formattingJosh Morman2021-11-246-80/+127
| | | | Signed-off-by: Josh Morman <jmorman@gnuradio.org>
* grc: Implement grcc --output switch for hierarchical blocksJaredD2021-09-274-19/+38
| | | | | | | | | | | | | | | | | | | | | | | | | * grc: Implement --output functionality for grcc Reference gnradio Issue #2799. This commit adjusts some logic and code to enable the --output switch for grcc. Prior to this commit, grcc would only output to the GRC_HIER_PATH. The commit adjusts the various Generators in grc/core/generator to consistently use output_dir for the output directory. If it's None, then take from the platform.config.hier_block_lib_dir attribute which can be set via the GRC_HIER_PATH env var. The cpp_top_block generator was also modified to remote its __init__ function which appeared identical to its base TopBlockGenerator. I did not test c++ GRC output. * Make output directory if does not exist * Duplicate TopBlockGenerator __init__ without .py extension; base class object * Typo in os.makedirs kwarg * Added _warnings method from TopBlockGenerator Signed-off-by: Jared Dulmage <jared.dulmage@caliola.com>
* grc: generate cpp hier code switch to std::shared_ptrVolker Schroer2021-09-021-1/+1
| | | | | | | gnuradio >= 3.9 uses std::shared_ptr instead of boost::shared_ptr This is fixed here. See too: #4951 Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
* grc cpp generation: Establish the possibility to add find packagesVolker Schroer2021-09-023-2/+27
| | | | | | | | | Flowgraphs may use oot modules. When generating cpp code an oot module may require a package that is not provided by gnuradio. So I propose to add an additional entry parameters in the cpp template to provide a list of package names. Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
* grc: Fix cpp hier param yaml templateSolomon Tan2021-08-231-5/+5
| | | | | | | | | | | The following issues are fixed for the cpp hier block parameter yaml template generation. 1. The key of the `data` dictionary containing the parameters should be `parameters` instead of `param`. 2. Fix the yaml template for the parameter to generate `${param}` instead of `$param` in the yaml file. Signed-off-by: Solomon Tan <solomonbstoner@yahoo.com.au>
* grc: introduce gui_hint for cpp code generationVolker Schroer2021-07-192-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment some qtgui windows do support only very simple gui hints, as the parse_gui_hint in param.py generates independently of the output language only python code. This is fixed here, so the gui_hint() can be used in cpp code generation. To test more complex gui hints the qtgui_tab_widget was extended to cpp. After that compiling the generated cpp code for some examples led to /usr/include/python3.9/object.h:206:23: Fehler: expected unqualified-id before »;« token 206 | PyType_Slot *slots; /* terminated by slot==0. */ This is a known error and can be fixed by ifdef ENABLE_PYTHON pragma push_macro("slots") undef slots include "Python.h" pragma pop_macro("slots") endif instead of simply ifdef ENABLE_PYTHON include "Python.h" endif which was applied to the corresponding gr-qtgui header files. Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
* grc: generating a simple cpp qt-gui flowgraph failsVolker Schroer2021-06-212-0/+4
| | | | | | | | | Generating cpp code for the simple flowgraph described in #2688 fails as an include statement and a required link lib is missing. This pr fixes this issue. More complex flowgraphs will still fail. Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
* global: remove iostream from all files not use cout|cerr|cin|clogMarcus Müller2021-06-171-1/+0
| | | | Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* grc: fix Wrong order in the generated .py caused by uncorrect function ↵Christophe Seguinot2021-06-011-8/+0
| | | | | | | | | | without_gui_hint(block) Signed-off-by: Christophe Seguinot <christophe.seguinot@univ-lille.fr> grc: fix Wrong order in the generated .py caused by uncorrect function without_gui_hint(block) Signed-off-by: Christophe Seguinot <christophe.seguinot@univ-lille.fr>
* grc: validate gui hintsChristophe Seguinot2021-03-101-3/+3
| | | | Signed-off-by: Christophe Seguinot <christophe.seguinot@univ-lille.fr>
* grc: validate gui hintsChristophe Seguinot2021-03-101-6/+2
| | | | Signed-off-by: Christophe Seguinot <christophe.seguinot@univ-lille.fr>
* grc: order blocks with GUI Hint firstChristophe Seguinot2021-03-101-0/+12
| | | | Signed-off-by: Christophe Seguinot <christophe.seguinot@univ-lille.fr>
* grc: remove gnuradio prefix from linked librarieskarel2021-03-031-1/+1
| | | | | | this allows OOT modules to be linked, as those will not link with the prefix Signed-off-by: karel <5636152+karel@users.noreply.github.com>
* grc: Call connect() for hier blocks that don't have portsHåkon Vågsether2021-02-112-0/+7
| | | | Signed-off-by: Håkon Vågsether <hakon.vagsether@gmail.com>
* cppgen: Use correct required version in CMakeListsHåkon Vågsether2021-02-011-1/+1
| | | | Signed-off-by: Håkon Vågsether <hauk142@gmail.com>
* grc: prefix generated modules with flowgraph idSebastian Koslowski2021-02-011-1/+1
| | | | ...so they play nice with epy modules generated from other fg in the same dir
* grc: save epy blocks/modules to hier_block_dirSebastian Koslowski2021-02-012-21/+19
|
* grc: In flowgraph, use closeEvent() to stop flow graph and not aboutToQuitSylvain Munaut2021-01-121-5/+6
| | | | | | | | | | | | | | | | | | | | | So originally I introduced the aboutToQuit() stuff in the hope to cleanly shutdown the flow graph, including the Qt widgets blocks before the Qt stuff is torn down. Turns out that in aboutToQuit some stuff is already invalid, especially in OpenGL and so causes SegFault on exit. Instead this patch modify the logic so that we stop the flow graph before Qt even begin disabling things. The two shutdown path that exits are : - The sig_handler in case we get TERM or INT signals - The closeEvent() of the main window This makes sure that both path call tb.stop() tb.wait() and also any snippet 'main_after_stop'. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* grc: Move snippets prep earlier in the fileSylvain Munaut2021-01-121-24/+28
| | | | | | | They are going to be needed in the closeEvent() Qt stuff and this is earlier in the file ... Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* grc: indent multiline connections in py flowgraphMike Walters2020-12-181-1/+1
| | | | | | | | This fixes flowgraph generation when using connection templates with multiple lines. Previously it would only indent the first line and subsequent lines would have no indentation, causing a python error. Signed-off-by: Mike Walters <mike@flomp.net>
* Bump the C++ standard version to C++14Marcus Müller2020-12-171-1/+1
| | | | Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* cppgen: Update to modern CMakeHåkon Vågsether2020-11-074-27/+21
|
* Fix typos throughout the codeluzpaz2020-10-291-2/+2
| | | | | | | * Fix various typos Found via `codespell v2.0.dev` `codespell -q 3 -L ans,fo,hist,inout,ist,ith,nd,sinc,uint -S ./volk`
* grc: fix pylint C0326: wrong number of spacesClayton Smith2020-10-203-3/+3
|
* grc: fix pylint C0303: Trailing whitespaceClayton Smith2020-10-204-10/+10
|
* grc: remove sixClayton Smith2020-10-053-7/+3
|
* python: Remove unnecessary 'from __future__ import'Oleksandr Kravchuk2020-08-033-3/+0
| | | | | | | | | | | | | | | | All of the removed `from __future__ import` were needed in older versions of Python (mostly 2.5.x and below) but later became mandatory in most versions of Python 3 hence are not necessary anymore. More specifically, according to __future__.py[1]: - unicode_literals is part of Python since versions 2.6.0 and 3.0.0; - print_function is part of Python since versions 2.6.0 and 3.0.0; - absolute_import is part of Python since versions 2.5.0 and 3.0.0; - division is part of Python since versions 2.2.0 and 3.0.0; Get rid of those unnecessary imports to slightly clean up the codebase. [1] https://github.com/python/cpython/blob/master/Lib/__future__.py
* grc: Fix hier block io_signature generationJohannes Demel2020-06-251-2/+2
| | | | | | GRC used `gr.io_signaturev` to generate hierarchical block signatures. This was only a SWIG alias to `gr.io_signature.makev`. Now, the generator calls `gr.io_signature.makev` directly.
* grc: remove dead codeClayton Smith2020-05-281-8/+0
|
* grc: Fix C++ code generationTerry May2020-02-185-22/+84
| | | | | | | | | | | | | | | | | | | | | | | - Added support for C++ std::map<> from python dict - Fixed default initialization of parameters in main() - Added missing include for realtime scheduling - Added default CMake option for std=c++11 as this is required for gnuradio >= 3.8 - Fixed mako template to add initialization to parameter declarations in main() - Fixed C++ constructor initialization list generation - Fixed parameter type determination when an lvalue is used in an rvalue expression - Improved determining type of C++ variables - Added C++ support for gr_complex parameters - Fixed C++ generation of nested container types - Added C++ support for virtual source/sink - Moved cmake CMAKE_CXX_STANDARD 11 option from options.yml to CMakeLists.txt.mako - Fixed qtqui_sink to allow multiple instances - Revised virtual connection processing in cpp_top_block.py Reviewed-By: Håkon Vagsether <hauk142@gmail.com>
* grc: Remove unused template definitionIgor Freire2020-02-151-7/+0
|
* grc: Fix eng_float default on argparse templateIgor Freire2020-02-151-1/+1
| | | | | | | | | The import of eng_notation was removed in 678a7c2ad, and so float parameter blocks were leading to flowgraph compilation error. Since eng_notation is still imported in the generated python script, we can put the call to num_to_str in the generated script, instead of calling it during script generation.
* grc: add python snippets to GRCJosh Morman2020-02-102-3/+42
| | | | | | | | | | | This feature adds the ability to insert arbitrary code into the python flowgraph. It gives a little more low-level flexibility for quickly modifying flowgraphs and adding custom bits of code rather than having to go and edit the generated py file One example is synchronizing multiple USRP objects - sometimes you want different sync than what is offered in the multi-usrp object, so you can put a bit of code in the snippet block to do the custom synchronization
* Update license header to SPDX formatdevnulling2020-01-273-39/+6
|
* grc: Add handling of catch_exceptions top_block paramScott Torborg2020-01-052-4/+5
| | | | | | Adds an additional option to the flowgraph's "Generate Options" in GRC called "Catch block exceptions", under the Advanced tab. This parameter controls the catch_exceptions flag passed to top block instantiation.
* Disable Python 2kMarcus Müller2020-01-041-9/+0
| | | | | | | | | | - Update SWIG settings - Update CMake - Remove Python2 references Note: This does not touch a lot of Python files, and many Python files will still work with Python 2 after this commit. However, we won't allow that in our CMake, and the support will be gone too.
* Module name correction for bokehgui Notou2019-11-011-3/+3
|
* Remove cpp generation function hard tabwcampbell2019-09-281-2/+2
| | | | Signed-off-by: wcampbell <wcampbell1995@gmail.com>
* grc: enable advanced parametersBastian Bloessl2019-09-191-12/+12
| | | | cpu affinity, max/min out buf size
* grc/cppgen: Use cli-style CMake optionsHåkon Vågsether2019-07-292-4/+13
| | | | | In other words, use "-DKEY1=VAL1 -DKEY2=VAL2" instead of "KEY1=VAL1; KEY2=VAL2"
* grc: Use yaml.safe_load() instead of yaml.load()Håkon Vågsether2019-07-211-1/+1
| | | | yaml.load() has been deprecated: https://msg.pyyaml.org/load
* grc/cppgen: Fix a bug where GRC would write to the wrong directoryHåkon Vågsether2019-07-211-8/+10
|
* grc: add busports back into 3.8Josh Morman2019-07-152-6/+48
| | | | | | | | Bus ports had not been added back in since the refactor of grc Hopefully this fully enables busports though there are still some issues with the gr-fec flowgraphs Fixes #2277
* grc: better qt flowgraph shutdownBastian Bloessl2019-06-191-1/+30
|
* runtime: port ctrlport monitor to 3.8 and qt5Bastian Bloessl2019-06-191-7/+9
|
* Add missing quotes in themes parameter of option blockVolker Schroer2019-04-191-1/+1
|
* grc: fix generation of hier2 block in case of multiple message portsVolker Schroer2019-03-311-2/+0
| | | | | | | | | | | | If a hier2 block contains more than one ( input or output ) message port GRC generates a wrong yml description of this block. If you restart GRC, GRC terminates with an error messages is no longer usable. This can be verified with the example here: "gr-blocks/examples/msg_passing/hier" This example is running in 3.7 without any problems. The modification in platform.py avoids the termination of grc if there is an error in the flowgraph to be loaded.
* grc: Add missing GRC version to cpp_top_block.pyHåkon Vågsether2019-02-171-2/+2
| | | | Without this fix, GRC isn't able to generate C++ flowgraphs.