[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 03/11: blocks: adding a variable tag_object
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 03/11: blocks: adding a variable tag_object to help build tags. |
Date: |
Sun, 5 Apr 2015 23:58:07 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 81929b6cc8258ca022fabe6013ddc043452cd21c
Author: Tom Rondeau <address@hidden>
Date: Sun Apr 5 16:20:18 2015 -0400
blocks: adding a variable tag_object to help build tags.
Edit boxes to set the tag's offset, key, value, and source id to make
it easier to create and use tags in a flwograph. the gr-blocks example
vector_source_with_tags.grc has been updated to use this.
---
gr-blocks/examples/vector_source_with_tags.grc | 329 +++++++++++++++++--------
gr-blocks/grc/blocks_block_tree.xml | 4 +
gr-blocks/grc/blocks_tag_object.xml | 55 +++++
3 files changed, 289 insertions(+), 99 deletions(-)
diff --git a/gr-blocks/examples/vector_source_with_tags.grc
b/gr-blocks/examples/vector_source_with_tags.grc
index e266b91..e797f17 100644
--- a/gr-blocks/examples/vector_source_with_tags.grc
+++ b/gr-blocks/examples/vector_source_with_tags.grc
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='ASCII'?>
-<?grc format='1' created='3.7.6'?>
+<?grc format='1' created='3.7.7'?>
<flow_graph>
<timestamp>Mon Sep 22 11:59:58 2014</timestamp>
<block>
@@ -53,66 +53,20 @@
<value></value>
</param>
<param>
- <key>alias</key>
+ <key>thread_safe_setters</key>
<value></value>
</param>
<param>
- <key>_coordinate</key>
- <value>(10, 10)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>tag1</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>gr.tag_utils.python_to_tag((1, pmt.intern('mark'),
pmt.PMT_T))</value>
- </param>
- <param>
<key>alias</key>
<value></value>
</param>
<param>
- <key>_coordinate</key>
- <value>(16, 267)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>tag0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>gr.tag_utils.python_to_tag((0, pmt.intern('mark'), pmt.PMT_T,
pmt.intern("src")))</value>
- </param>
- <param>
- <key>alias</key>
+ <key>comment</key>
<value></value>
</param>
<param>
<key>_coordinate</key>
- <value>(16, 203)</value>
+ <value>(10, 10)</value>
</param>
<param>
<key>_rotation</key>
@@ -138,6 +92,10 @@
<value></value>
</param>
<param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
<key>_coordinate</key>
<value>(184, 11)</value>
</param>
@@ -165,6 +123,10 @@
<value></value>
</param>
<param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
<key>_coordinate</key>
<value>(280, 11)</value>
</param>
@@ -216,59 +178,12 @@
<value>0</value>
</param>
<param>
- <key>_coordinate</key>
- <value>(272, 123)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blocks_tag_debug</key>
- <param>
- <key>id</key>
- <value>blocks_tag_debug_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>name</key>
- <value></value>
- </param>
- <param>
- <key>filter</key>
- <value>""</value>
- </param>
- <param>
- <key>num_inputs</key>
- <value>1</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>display</key>
- <value>True</value>
- </param>
- <param>
- <key>alias</key>
- <value></value>
- </param>
- <param>
- <key>affinity</key>
+ <key>comment</key>
<value></value>
</param>
<param>
<key>_coordinate</key>
- <value>(456, 195)</value>
+ <value>(272, 123)</value>
</param>
<param>
<key>_rotation</key>
@@ -322,6 +237,10 @@
<value>0</value>
</param>
<param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
<key>_coordinate</key>
<value>(16, 107)</value>
</param>
@@ -389,6 +308,10 @@
<value>0.10</value>
</param>
<param>
+ <key>ctrlpanel</key>
+ <value>False</value>
+ </param>
+ <param>
<key>entags</key>
<value>True</value>
</param>
@@ -669,6 +592,10 @@
<value></value>
</param>
<param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
<key>_coordinate</key>
<value>(456, 107)</value>
</param>
@@ -677,6 +604,210 @@
<value>0</value>
</param>
</block>
+ <block>
+ <key>variable_tag_object</key>
+ <param>
+ <key>id</key>
+ <value>tag0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>offset</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>key</key>
+ <value>pmt.intern("mark")</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>pmt.PMT_T</value>
+ </param>
+ <param>
+ <key>src</key>
+ <value>pmt.intern("src")</value>
+ </param>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(16, 195)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_qtgui_range</key>
+ <param>
+ <key>id</key>
+ <value>tag1_offset</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Tag 1 Offset</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>2</value>
+ </param>
+ <param>
+ <key>start</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>stop</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>step</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>widget</key>
+ <value>counter_slider</value>
+ </param>
+ <param>
+ <key>orient</key>
+ <value>Qt.Horizontal</value>
+ </param>
+ <param>
+ <key>min_len</key>
+ <value>200</value>
+ </param>
+ <param>
+ <key>gui_hint</key>
+ <value></value>
+ </param>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(256, 323)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_tag_object</key>
+ <param>
+ <key>id</key>
+ <value>tag1</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>offset</key>
+ <value>tag1_offset</value>
+ </param>
+ <param>
+ <key>key</key>
+ <value>pmt.intern("mark2")</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>pmt.from_long(12345)</value>
+ </param>
+ <param>
+ <key>src</key>
+ <value>pmt.intern("tag1")</value>
+ </param>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(112, 195)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>blocks_tag_debug</key>
+ <param>
+ <key>id</key>
+ <value>blocks_tag_debug_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>float</value>
+ </param>
+ <param>
+ <key>name</key>
+ <value></value>
+ </param>
+ <param>
+ <key>filter</key>
+ <value>""</value>
+ </param>
+ <param>
+ <key>num_inputs</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>vlen</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>display</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>affinity</key>
+ <value></value>
+ </param>
+ <param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(456, 195)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
<connection>
<source_block_id>blocks_throttle_0</source_block_id>
<sink_block_id>qtgui_time_sink_x_0</sink_block_id>
diff --git a/gr-blocks/grc/blocks_block_tree.xml
b/gr-blocks/grc/blocks_block_tree.xml
index 383ec87..cc7b4b8 100644
--- a/gr-blocks/grc/blocks_block_tree.xml
+++ b/gr-blocks/grc/blocks_block_tree.xml
@@ -221,4 +221,8 @@
<block>blocks_vco_f</block>
<block>blocks_vco_c</block>
</cat>
+ <cat>
+ <name>Variables</name>
+ <block>variable_tag_object</block>
+ </cat>
</cat>
diff --git a/gr-blocks/grc/blocks_tag_object.xml
b/gr-blocks/grc/blocks_tag_object.xml
new file mode 100644
index 0000000..f5813d3
--- /dev/null
+++ b/gr-blocks/grc/blocks_tag_object.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+## Tag Object: creates a tag
+###################################################
+ -->
+<block>
+ <name>Tag Object</name>
+ <key>variable_tag_object</key>
+ <var_make>self.$(id) = $(id) = gr.tag_utils.python_to_tag(($offset, $key,
$value, $src))</var_make>
+ <make></make>
+
+ <param>
+ <name>Offset</name>
+ <key>offset</key>
+ <value>0</value>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Key</name>
+ <key>key</key>
+ <value>pmt.intern("key")</value>
+ <type>raw</type>
+ </param>
+
+ <param>
+ <name>Value</name>
+ <key>value</key>
+ <value>pmt.intern("value")</value>
+ <type>raw</type>
+ </param>
+
+ <param>
+ <name>Source ID</name>
+ <key>src</key>
+ <value>pmt.intern("src")</value>
+ <type>raw</type>
+ </param>
+
+ <doc>
+ This block creates a tag object. 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.
+
+ 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))
+ </doc>
+</block>
- [Commit-gnuradio] [gnuradio] branch master updated (fa2abde -> cce2347), git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 10/11: Merge remote-tracking branch 'tom/qtgui/time_auto_and_stop', git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 08/11: Merge remote-tracking branch 'mmueller/runtime_hier_block2_signage', git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 09/11: Merge remote-tracking branch 'mmueller/remove_aadvarkness', git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 11/11: Merge remote-tracking branch 'osh/tpc_add', git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 03/11: blocks: adding a variable tag_object to help build tags.,
git <=
- [Commit-gnuradio] [gnuradio] 02/11: fec: TPC now runs happily, encoder produces uint8_t instead of float, decoder GRC def now fixed, git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 04/11: fec: TPC adding standard headers, git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 05/11: Fixed up the int/size_t handling in hb2's new max/min_output... methods, git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 07/11: qtgui: adds single-shot autoscale button and stop button to time sink control panel., git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 01/11: fec: adding TPC encoder and decoder, git, 2015/04/05
- [Commit-gnuradio] [gnuradio] 06/11: removed doxyxml example, git, 2015/04/05