Tag Object: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
(Created page with "Category:Block Docs Category:Stub Docs This is the template for the "Page-per-block Docs". This first section should describe what the block...")
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Block Docs]]
[[Category:Block_Docs]]
[[Category:Stub Docs]]
This block creates a tag object.  
This is the template for the [[:Category:Block_Docs|"Page-per-block Docs"]].  This first section should describe what the block does and how to use it, using however many paragraphs necessary.  Note that the title of the wiki page should match the block's name in GRC, i.e. the one defined in the block's .grc file.  Look at the [[FFT]] Block for a good example.


As this is a basic template, it's also in the [[:Category:Stub_Docs|"Stub Docs category"]]. Please improve it.
The tag objects are created using the python_to_tag Python function to make it easy to generate a tag_t in Python. The call looks like:
        gr.tag_utils.python_to_tag(($offset, $key, $value, $src))


== Parameters ==
== Parameters ==
(''R''): <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span>
(''R''): <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span>


; Param 1 (''R'')
; id (''R'')
: Description of parameter, provide any tips or recommended values. Note that the name of the parameter above should match the param's label that shows up in grc (e.g. Sample Rate).
: ID of the tag, can be used to reference it in other blocks.
 
; Offset (''R'')
; Param 2
: While tags are based on an absolute offset, this is based on a relative offset that must be appropriately translated by the block using it. For example, this is used by the vector_source blocks, which will treat a 0 offset in the tag as the first item in the stream when the vector starts or repeats.
: blah blah blah
; Key (''R'')
: Name of the tag.
; Value (''R'')
: Value to give to the tag (can be a number, a boolean or a string).
; Source ID (''R'')
: Name of the source of the tag, is sometimes used by certain blocks.


== Example Flowgraph ==
== Example Flowgraph ==


Insert description of flowgraph here, then show a screenshot of the flowgraph and the output if there is an interesting GUI.  Currently we have no standard method of uploading the actual flowgraph to the wiki or git repo, unfortunately.  The plan is to have an example flowgraph showing how the block might be used, for every block, and the flowgraphs will live in the git repo.
[[File:Vector_source_with_tags.png]]


== Source Files ==
== Source Files ==


; C++ fileshttps://wiki.gnuradio.org/index.php/SISO
; C++ files
 
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio TODO]



Latest revision as of 19:20, 29 November 2020

This block creates a tag object.

The tag objects are created using the python_to_tag Python function to make it easy to generate a tag_t in Python. The call looks like:

       gr.tag_utils.python_to_tag(($offset, $key, $value, $src))

Parameters

(R): Run-time adjustable

id (R)
ID of the tag, can be used to reference it in other blocks.
Offset (R)
While tags are based on an absolute offset, this is based on a relative offset that must be appropriately translated by the block using it. For example, this is used by the vector_source blocks, which will treat a 0 offset in the tag as the first item in the stream when the vector starts or repeats.
Key (R)
Name of the tag.
Value (R)
Value to give to the tag (can be a number, a boolean or a string).
Source ID (R)
Name of the source of the tag, is sometimes used by certain blocks.

Example Flowgraph

Vector source with tags.png

Source Files

C++ files
TODO
Header files
TODO
Public header files
TODO
Block definition
TODO