diff options
author | Håkon Vågsether <haakonsv@gmail.com> | 2017-12-21 00:07:28 +0100 |
---|---|---|
committer | Håkon Vågsether <haakonsv@gmail.com> | 2018-12-18 23:17:34 +0100 |
commit | 612c65091a748eb85a8dea2d9414f0486777fb17 (patch) | |
tree | bb83a329c3f15ddfa3b2f19abc24f38c5638e356 /grc/core/blocks/block.py | |
parent | bac53b29f7008b33667a7c2c481ace02d73f3264 (diff) |
Added C++ support to gr-analog, gr-blocks and grc
Diffstat (limited to 'grc/core/blocks/block.py')
-rw-r--r-- | grc/core/blocks/block.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/grc/core/blocks/block.py b/grc/core/blocks/block.py index 4df3ec9663..19b16b53d6 100644 --- a/grc/core/blocks/block.py +++ b/grc/core/blocks/block.py @@ -169,9 +169,14 @@ class Block(Element): """check if this block supports the selected output language""" current_output_language = self.parent.get_option('output_language') - if current_output_language == 'cpp' and 'has_cpp' not in self.flags: + if current_output_language == 'cpp': + if 'cpp' not in self.flags: self.add_error_message("This block does not support C++ output.") + if self.key == 'parameter': + if not self.params['type'].value: + self.add_error_message("C++ output requires you to choose a parameter type.") + def _validate_var_value(self): """or variables check the value (only if var_value is used)""" if self.is_variable and self.value != 'value': @@ -266,6 +271,8 @@ class Block(Element): a list of strings """ def make_callback(callback): + if self.is_variable: + return callback if 'this->' in callback: return callback return 'this->{}->{}'.format(self.name, callback) |