summaryrefslogtreecommitdiff
path: root/grc/core
Commit message (Collapse)AuthorAgeFilesLines
* grc: don't blacklist default fg idJosh Morman2022-01-062-1/+2
| | | | Signed-off-by: Josh Morman <jmorman@gnuradio.org>
* 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-2436-282/+454
| | | | Signed-off-by: Josh Morman <jmorman@gnuradio.org>
* grc: Dependent variables sometimes fail to evaluateVolker Schroer2021-10-271-2/+7
| | | | | | | | | | | | | fixes #4788 fixes #5100 fixes #5108 Tested with the coresponding examples. Now disabling or deleting the symbol_rate block in #4788 correctly updates the depending blocks Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
* grc: Removed unused code in gnuradio/platform.pyAdarsh Singh2021-10-141-7/+1
| | | Signed-off-by: Adarsh <singhadarsh100@gmail.com>
* grc: typo in Connection.pyJeff Long2021-10-141-1/+1
| | | | | | | default for dict is just an extra arg, no default= keyword Signed-off-by: Jeff Long <willcode4@gmail.com> (cherry picked from commit 553248575079794236923ad3aa03cda03ed902d0) Signed-off-by: Jeff Long <willcode4@gmail.com>
* grc: Don't fail when type lookup fails by defaulting to an empty set.Ryan Volz2021-10-141-1/+3
| | | | Signed-off-by: Ryan Volz <ryan.volz@gmail.com>
* grc: Look up type aliases as a set instead of a single value.Ryan Volz2021-10-122-20/+18
| | | | | | | | | | | After #5127, we inadvertently had duplicate dictionary keys, meaning the last entry is the only one that actually existed and some desired aliases were missing. This changes the ALIAS_OF dictionary to ALIASES_OF where the values are now a set of aliases instead of a single string value. The one use of the ALIAS_OF dictionary was changed to operate on the returned set. Signed-off-by: Ryan Volz <ryan.volz@gmail.com>
* grc: Write "ID", not "Id"Håkon Vågsether2021-10-111-1/+1
| | | | Signed-off-by: Håkon Vågsether <hauk142@gmail.com>
* grc: Add aliases for "sc16==short" and "sc8==byte".Ryan Volz2021-10-051-0/+4
| | | | | | | | | | When type checking was added for GRC connections, the valid connections between a block with the "sc16" type (e.g. UHD blocks) and a block with the "short" type and a vector length of 2 (e.g. ishort->complex) now fail. Adding these aliases fixes that as a stop-gap until a better solution can be found. Signed-off-by: Ryan Volz <ryan.volz@gmail.com>
* grc: Implement grcc --output switch for hierarchical blocksJaredD2021-09-275-25/+43
| | | | | | | | | | | | | | | | | | | | | | | | | * 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: 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: 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: 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-025-2/+29
| | | | | | | | | 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: fix the evaluation of interdependent variablesVolker Schroer2021-08-071-1/+0
| | | | | | | | The gr-digital/examples/tx_ofdm.grc fails to evaluate the header_formater variable. This pr fixes #4937 Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
* grc: allow short and byte as valid types in an enumJeff Long2021-07-192-2/+2
| | | | Signed-off-by: Jeff Long <willcode4@gmail.com>
* grc: introduce gui_hint for cpp code generationVolker Schroer2021-07-193-16/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: update disabled blocks if they depend on othersVolker Schroer2021-07-191-1/+2
| | | | | | | | | | | | | | | | | | | | | If we want disabled blocks to be updated properly, we have to consider all blocks when updating the fg not only the enabled. This does the patch of Flowgraph.py and fixes #4788. But a problem remains. If you use the example in #4788 and disable the symbol_rate block, only the samp_rate block 'turns to red'. The other blocks don't change. Only if you open and close an arbitrary block, the other blocks are updated. This is fixed by clearing the namespace in renew_namespace in FlowGraph.py. Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com> grc: update disabled blocks 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: use new cache filename to avoid confusion with earlier cachesMarcus Müller2021-06-041-1/+2
| | | | Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* GRC: cache now time-dependent, version-sensitiveMarcus Müller2021-06-042-9/+35
| | | | | | | | | | | | | | | | | | Complete Cache will be discarded if current cache file * has no version info * version older than version in cacheversion.in (i.e. after an update) Cached entry will be reloaded from yaml if * missing * cached-at property smaller than modification time of yaml file (half second tolerance, due to inelegant floating point modification time handling in python) Also, a bit of debug logging. Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* grc: cache: remove unused functionMarcus Müller2021-06-041-9/+0
| | | | Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* grc: cache: remove useless importMarcus Müller2021-06-041-2/+0
| | | | | | io.open is just an alias for builtin open Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* grc: handle variables of type raw correctlyVolker Schroer2021-06-012-2/+2
| | | | | | | | | | | | | | | | | | At the moment grc does not validate variables, as they are of type raw. So they are always treated as valid, which leads to some problems, see: #4519. A approach to fix #4519 is #4531. This approach improves the situation, but has still some problems. param.py provides a validator function for dtype raw, but this is not used, as dtypes.py provides no validator function for dtype raw. This fix clears the error messages in base.rewrite not in base.elements.validate, so the error messages are kept. In addition this makes it possible, to make the code in VariableEditor.py smoother. The error messages are kept on switching the different tabs in VariableEditor. Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
* 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: core Block: deprecated propertyMarcus Müller2021-06-011-7/+29
| | | | Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* grc: Be more informative when missing "options" block.Ryan Volz2021-06-011-1/+14
| | | | | | | | | | | This raises an RuntimeError describing that GRC could not find the built-in blocks rather than raising a KeyError on "options", which left users with little to go on. This error has come up in various situations involving an incorrect blocks path (due to mixing GR versions causing the configuration files to point to the wrong installation) or simply the blocks not being installed. Signed-off-by: Ryan Volz <ryan.volz@gmail.com>
* 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-152-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: update id blackist with importsVolker Schroer2021-04-153-10/+22
| | | | Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
* grc: match data type aliases as well as typesJeff Long2021-04-102-1/+18
| | | | Signed-off-by: Jeff Long <willcode4@gmail.com>
* grc: Check connection types, whether they matchVolker Schroer2021-04-091-0/+5
| | | | Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
* GRC Fix Date String in About dialogMarcus Müller2021-03-241-2/+1
| | | | Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
* 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: 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-012-5/+14
| | | | ...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: 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>