On 08/19/2011 02:11 PM, Jordan Otomo wrote:
> Hi,
> 
> I'm having issues creating a GRC block in an "out-of-tree-project"
> that will generate a few lines of python code and update a python
> variable (similar to the "variable_function_probe").  In my project,
> the <var_make> and <make> tags do not seem to behave as they do in
> the "variable_function_probe."  GRC does not appear to be recognizing
> <var_make>, and <make> generates "self.my_block_0 = " (as expected).
> Are there any limitations preventing me from using the <var_make>
> tag?  Also, how can I get <make> to not generate "self.my_block_0 = "
> as it does for the "variable_function_probe"?
> 

GRC will recognize a block as a variable if it passes the regexp
"_variable_matcher = re.compile('^(variable\w*)$')", in other words, if
the key starts with the string "variable"

If grc recognizes the block as a variable, it will eval the var_make,
#for $var in $variables
                $indent($var.get_var_make())
#end for

> I've tried copying 'variable_function_probe.xml' and 'variable.xml'
> into my project and they do not behave as they do when they're in the
> gnuradio directory.  Thus, I'm wondering if I need to designate my
> block as being a special "Variable" type block.  Any help would be
> greatly appreciated.
> 

There is nothing special about the directory an xml file is in. As long
as grc is told to import it. If you actually copied the file and it was
imported twice, grc would print an error

http://gnuradio.org/redmine/projects/gnuradio/wiki/GNURadioCompanion#Installing-the-XML-Block-Definition

-josh

_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to