summaryrefslogtreecommitdiff
path: root/grc/blocks/variable_function_probe.xml
diff options
context:
space:
mode:
authorJosh Blum2011-03-06 11:18:27 -0800
committerJosh Blum2011-03-06 11:18:27 -0800
commit7070c10d7ac59adcd597c18ec2c83b1b59ed87e9 (patch)
treeaf1d8cebe59fb1aacd03f73485ec4584a6c2f5ef /grc/blocks/variable_function_probe.xml
parent19c0865b4b6c94f86679151e9f52c99331b1f0b9 (diff)
downloadgnuradio-7070c10d7ac59adcd597c18ec2c83b1b59ed87e9.tar.gz
gnuradio-7070c10d7ac59adcd597c18ec2c83b1b59ed87e9.tar.bz2
gnuradio-7070c10d7ac59adcd597c18ec2c83b1b59ed87e9.zip
grc: rework the probe blocks and how they fit into grc
Removed the source on all probe blocks. Advertise the probe-able function in the docs. Added missing signal probe block. Removed probe function and variable sink blocks. Removed all supporting grc_gnuradio python files. Added variable_function_probe block that can probe arbitrary functions on a block. All the code needed by the function probe is available is the make tag. To display the value of a probe block, use the variable probe block, and a gui widget. To disply the value of a stream, do the same but use the signal probe block. Simple see :-) If more types other than floats need to be read from the stream, the signal probe should be extended.
Diffstat (limited to 'grc/blocks/variable_function_probe.xml')
-rw-r--r--grc/blocks/variable_function_probe.xml51
1 files changed, 51 insertions, 0 deletions
diff --git a/grc/blocks/variable_function_probe.xml b/grc/blocks/variable_function_probe.xml
new file mode 100644
index 000000000..695d2f56c
--- /dev/null
+++ b/grc/blocks/variable_function_probe.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##Variable function probe
+###################################################
+ -->
+<block>
+ <name>Function Probe</name>
+ <key>variable_function_probe</key>
+ <import>import time</import>
+ <import>import threading</import>
+ <var_make>self.$(id) = $(id) = $value</var_make>
+ <make>#slurp
+def _$(id)_probe():
+ while True:
+ self.set_$(id)(self.$(block_id()).$(function_name())())
+ time.sleep(1.0/($poll_rate))
+_$(id)_thread = threading.Thread(target=_$(id)_probe)
+_$(id)_thread.daemon = True
+_$(id)_thread.start()</make>
+ <callback>self.set_$(id)($value)</callback>
+ <param>
+ <name>Value</name>
+ <key>value</key>
+ <value>0</value>
+ <type>raw</type>
+ </param>
+ <param>
+ <name>Block ID</name>
+ <key>block_id</key>
+ <value>my_block_0</value>
+ <type>string</type>
+ </param>
+ <param>
+ <name>Function Name</name>
+ <key>function_name</key>
+ <value>get_number</value>
+ <type>string</type>
+ </param>
+ <param>
+ <name>Poll Rate (Hz)</name>
+ <key>poll_rate</key>
+ <value>10</value>
+ <type>real</type>
+ </param>
+ <doc>
+Periodically probe a function and set its value to this variable.
+
+To poll a stream for a level, use this with the probe signal block.
+ </doc>
+</block>