summaryrefslogtreecommitdiff
path: root/grc/core/params
Commit message (Collapse)AuthorAgeFilesLines
* grc: don't blacklist default fg idJosh Morman2022-01-061-1/+1
| | | | Signed-off-by: Josh Morman <jmorman@gnuradio.org>
* grc: pep8 formattingJosh Morman2021-11-243-34/+55
| | | | Signed-off-by: Josh Morman <jmorman@gnuradio.org>
* grc: Write "ID", not "Id"Håkon Vågsether2021-10-111-1/+1
| | | | Signed-off-by: Håkon Vågsether <hauk142@gmail.com>
* grc: Raise error for unfilled parametersSolomon Tan2021-09-271-1/+1
| | | | | | | | Issue 5032 results from an unfilled parameter erroneously indicated as filled with a default value of 0. This PR makes grc indicate an error when there is an unfilled parameter by returning None. Signed-off-by: Solomon Tan <solomonbstoner@yahoo.com.au>
* grc: allow short and byte as valid types in an enumJeff Long2021-07-191-1/+1
| | | | Signed-off-by: Jeff Long <willcode4@gmail.com>
* grc: introduce gui_hint for cpp code generationVolker Schroer2021-07-191-12/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Make exception for epy in blacklist idSolomon Tan2021-05-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: update id blackist with importsVolker Schroer2021-04-152-10/+9
| | | | Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
* grc: fix widget whitout GUI_hint may superpose to otherChristophe Seguinot2021-03-101-1/+4
| | | | Signed-off-by: Christophe Seguinot <christophe.seguinot@univ-lille.fr>
* grc: fix pylint C0326: wrong number of spacesClayton Smith2020-10-201-2/+2
|
* grc: fix pylint C0303: Trailing whitespaceClayton Smith2020-10-202-2/+2
|
* grc: remove sixClayton Smith2020-10-052-10/+6
|
* 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: Add dir_select parameter typeYamakaja2020-07-231-2/+2
| | | | | | | | This commit adds a new parameter type to GNURadio Companion that allows you to select directories using a gui. This functionality is very similar to that of the previously available "file_open" and "file_save" parameter types, and mainly differs by calling GTKs file chooser with FileChooserAction.SELECT_FOLDER.
* grc: add python snippets to GRCJosh Morman2020-02-101-3/+7
| | | | | | | | | | | 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-274-52/+8
|
* grc: loosen the validation of block in function probeJosh Morman2020-01-031-2/+4
| | | | | | | | | | | | The block_id parameter for the block being probed was being validated as a block_id. But there is a use case where this can be blank to call a function on the flowgraph object itself. Changed the block_id dtype to "name" just like function_name. Could have just changed it to raw and done no validation, but that doesn't get displayed very nicely in the grc block Fixes #2966
* grc: validate gui hintsJosh Morman2019-11-011-0/+7
| | | | | | | committing the fix suggested by @haakov Make gui_hint collisions show up as validation errors Fixes #2287
* grc: Add sensible defaults to Options blockHåkon Vågsether2019-07-281-1/+1
|
* grc: function_probe_block extra quotes with block_idJosh Morman2019-05-282-1/+12
| | | | | | | | | | Due to the way stringify_flag is called, the block_id, function_name and function_args are all given extra quotes which cause issues when generating the python source change/add new dtypes for function_probe Fixes #1783
* grc: parse suffixes for numeric valuesaru312019-02-141-0/+34
| | | | | Previously only python scientific notation was supported. Now engineering notation e.g. k,M,G is supported as input format as well.
* grc: Validate vectors before validating their elementsHåkon Vågsether2018-11-221-0/+3
|
* grc: Fix problems with option_attributesHåkon Vågsether2018-11-221-0/+5
| | | | | | 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
|
* Remove e.message from param.pyHåkon Vågsether2018-08-181-1/+1
|
* Fix wrong GUI hintsVolker Schroer2018-08-181-1/+4
| | | | | | | grc 3.8 should treat window@index or window@index :i,j,k,l differently to what grc 3.7 does.
* grc: check evaluated parameter for correctnessAndrej Rode2017-12-041-4/+4
|
* grc: move some of the param checkers to separate fileSebastian Koslowski2017-11-092-116/+141
|
* grc: refactor: move Param cls to core.paramsSebastian Koslowski2017-11-083-0/+553