summaryrefslogtreecommitdiff
path: root/grc/core/blocks
Commit message (Collapse)AuthorAgeFilesLines
* grc: pep8 formattingJosh Morman2021-11-247-52/+85
| | | | Signed-off-by: Josh Morman <jmorman@gnuradio.org>
* grc: Add no_quotes() convenience function (callable from templates)Håkon Vågsether2021-09-071-0/+11
| | | | Signed-off-by: Håkon Vågsether <hauk142@gmail.com>
* grc cpp generation: Establish the possibility to add find packagesVolker Schroer2021-09-021-0/+1
| | | | | | | | | 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: core Block: deprecated propertyMarcus Müller2021-06-011-7/+29
| | | | Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* grc: Fix vector length bugSolomon Tan2021-05-241-0/+1
| | | | | | | Make all ports follow the `vlen` of their master port the same way it is for `dtype`. Fixes #4634. Signed-off-by: Solomon Tan <solomonbstoner@yahoo.com.au>
* grc: Make exception for epy in blacklist idSolomon Tan2021-05-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I refer to the mailing list thread on May 8 2021 regarding "Embedded Python Block Tutorial Param ID Error". The bug is caused by #4522 as names of embedded python blocks such as `epy_block_0` are blacklisted because of "blocks" in the argument `black_listed_ids`. It affects both embedded python blocks and modules. This commit fixes the bug by granting exemption for these two types of blocks from id validation. This commit makes the regex more strictly follow the naming convention of epy blocks and modules so that only these will be fast-tracked through the id validation. The naming convention appears to be a "epy" prefix, followed by "block" or "module", and a number suffix. This regex also takes into account the user copying-and-pasting the epy blocks resulting in id names like `epy_block_0_0` and `epy_block_0_0_0`. Instead of checking for epy blocks or modules using the naming convention in the id like commit ac383d1 does, this commit checks by looking at the block's key. All epy blocks and modules are identified with the key `epy_block` and `epy_module` respectively. This commit fixes the bug by changing the import name such that it does not coincide with the generated id for epy blocks and modules. This means that there no longer needs to be an exception case in the validation id function for epy blocks and modules. This commit fixes the bug by giving epy blocks and modules a new attribute that grants them exemption from blacklist id validation. Unlike v1, v2 and v3, this does not depend on the naming convention of the block ids or block keys, which could change in the future, making the code less of a hassle to maintain. Improved on v5 (commit b85da80) with the following changes. 1. Changed `exempt_from_id_validation` from an instance variable to a class variable since all instances of epy blocks and modules are affected by the bug mentioned in v5. 2. Changed `hasattr` to `getattr` to prevent the bug where a block is exempted from id validation when `exempt_from_id_validation=False`. Improved from v6 (commit e66ed85). This grants the exemption to blocks/modules only after they are marked for blacklist. This change makes sure that the id exemption is used only to prevent the blacklisting bug. The blocks/modules will still go through other forms of id validation such as the naming convention check. Signed-off-by: Solomon Tan <solomonbstoner@yahoo.com.au>
* grc: Fix option_attributes check on inherited typeIgor Freire2021-04-191-3/+3
| | | | | | | | | | Run the option_attributes validation routine on the extended dictionary, i.e., after inheriting the properties from the base_key parameter. By doing so, if the dtype property is inherited, the _validate_option_attributes still sees it and does not throw a key error. Signed-off-by: Igor Freire <igor@blockstream.com>
* grc: prefix generated modules with flowgraph idSebastian Koslowski2021-02-011-4/+13
| | | | ...so they play nice with epy modules generated from other fg in the same dir
* grc: clean-up flags in epy moduleSebastian Koslowski2021-02-011-3/+3
|
* grc: Fix message port show/hide problem due to bus logic updateDavid Pi2020-12-171-2/+5
| | | | | | | | update_bus_logic() is called when disabling a bus, it doesn't check if it's been previously enabled. This causes it to restore port.hidden with a None which ultimately is converted to False. So it never hides the message ports. Also, filter message ports from buses.
* grc: fix pylint C0330: wrong hanging indentationClayton Smith2020-10-201-1/+1
|
* grc: fix pylint C0326: wrong number of spacesClayton Smith2020-10-203-6/+6
|
* grc: fix pylint C0303: Trailing whitespaceClayton Smith2020-10-206-6/+6
|
* grc: remove sixClayton Smith2020-10-052-28/+23
|
* python: Remove unnecessary 'from __future__ import'Oleksandr Kravchuk2020-08-038-8/+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: fixup: dynamically update namespaces from blocks (#3317)Sebastian Koslowski2020-05-161-4/+6
|
* grc: dynamically update namespaces from blocksJacob Gilbert2020-05-151-1/+16
| | | | amongst other things, allows assert statements to use items within namespaces the blocks import
* grc: Enable strict_undefined to ease Mako template debuggingHåkon Vågsether2020-04-211-1/+1
|
* grc: workaround to allow epy blocks/modules to loadJosh Morman2020-03-261-2/+5
| | | | | | | | | | | The underlying issue is that the built in blocks all end up getting the 'cpp' flag, which is not valid for the embedded python blocks To fix this some work needs to be done in the "Flags" class, as all the flags added to classes that get accumulated in the build_ins list get added to all the classes See register_build_in
* Allow grc to load flowgraphs with missing blocksTerry May2020-03-121-2/+2
|
* grc: Fix C++ code generationTerry May2020-02-183-42/+98
| | | | | | | | | | | | | | | | | | | | | | | - 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: add python snippets to GRCJosh Morman2020-02-101-0/+4
| | | | | | | | | | | 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-278-104/+16
|
* grc: embedded python module show_id flagJosh Morman2019-11-061-1/+4
| | | | | | It is necessary to have access to the show_id flag for a python module in grc to be able to access it elsewhere. This adds the flag when the module object is created in the block library.
* grc: embedded python parameter values disappearChris2019-11-011-4/+4
|
* GRC: update cloned port's dtypeGlenn Richardson2019-09-201-0/+1
|
* grc: clean up todos from busportsJosh Morman2019-07-211-6/+4
| | | | Couple of leftover todos from the copy of busports code from 3.7
* grc: add busports back into 3.8Josh Morman2019-07-151-2/+221
| | | | | | | | 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: introduce flag 'show_id' to show block idBastian Bloessl2019-06-293-2/+6
| | | | useful for variable and parameter blocks, but maybe others too
* fixup! Modifying dummy block and error messagesDerek Kozel2019-03-131-4/+3
| | | | | An older version of PR 2278 was accidently merged by me. This fixup brings in the correct changes to dummy.py
* Modifying dummy block and error messagesVolker Schroer2019-03-131-7/+4
|
* Correctly building dummy blockVolker Schroer2019-03-131-2/+8
|
* grc: fix block flagsSebastian Koslowski2019-02-172-3/+11
|
* grc: fixes in epy and virtual blocks (fixes #2039)Sebastian Koslowski2019-02-123-62/+36
|
* grc: Fix missing default code in python block and python modulePiotr Krysik2019-02-101-2/+2
|
* grc: Fix Python Module blockHåkon Vågsether2019-01-071-1/+6
| | | | | Before this fix, it was not possible to add a 'Python Module' to a GRC flow graph, it would just throw exceptions when you tried.
* grc: only use cpp_templates if block has a cpp flagAndrej Rode2018-12-301-1/+2
| | | | | Avoid erroring out for block that don't have C++ constructors (e.g. virtual sinks).
* Small fixes to get the C++ generator working againHåkon Vågsether2018-12-181-0/+2
|
* Added C++ support to gr-analog, gr-blocks and grcHåkon Vågsether2018-12-182-3/+10
|
* Add C++ generationHåkon Vågsether2018-11-233-4/+110
|
* grc: Fix problems with option_attributesHåkon Vågsether2018-11-222-4/+21
| | | | | | Enabling the option_attributes to be accessed by the rest of the block's parameters by using a new string subtype. Also adding validation.
* grc: Improve exception handling (bare and unnecessary)Brennan Ashton2018-11-151-1/+1
|
* Fix an error when adding virtual blocks to the flowgraphHåkon Vågsether2018-10-271-5/+17
|
* grc: refactor: move Param cls to core.paramsSebastian Koslowski2017-11-081-1/+0
|
* grc: move port and param init to block builderSebastian Koslowski2017-11-083-82/+91
|
* grc: disable auto-conversion and implement json cacheSebastian Koslowski2017-11-082-4/+7
|
* [grc] fix conversion of <check> and rename them to assertsSebastian Koslowski2017-10-012-9/+9
|
* [grc] python3: fix stream port indexes (fixes ↵Sebastian Koslowski2017-09-301-3/+2
| | | | 4340e4fe836d525ce30cd0a884400b77222a1848)
* Fixing GRC not saving the ID of the Options blockHåkon Vågsether2017-08-031-1/+1
|
* grc: added yaml/mako supportSebastian Koslowski2017-06-298-0/+1010
Includes basic converter from XML/Cheetah to YAML/Mako based block format.