diff options
author | Johnathan Corgan | 2011-03-14 20:07:36 -0700 |
---|---|---|
committer | Johnathan Corgan | 2011-03-14 20:07:36 -0700 |
commit | 22deb62a872413bdeff63e4fb565b4bcce2c6508 (patch) | |
tree | 79571572f1f130b5153019d70d31b2c868cf0b97 /grc/blocks/variable_function_probe.xml | |
parent | f3d373492fe415ced2bbf0be3f8e6da66576fcdc (diff) | |
parent | 4d5096c8b084c5832256dc2cd8bb617ee93d94a4 (diff) | |
download | gnuradio-22deb62a872413bdeff63e4fb565b4bcce2c6508.tar.gz gnuradio-22deb62a872413bdeff63e4fb565b4bcce2c6508.tar.bz2 gnuradio-22deb62a872413bdeff63e4fb565b4bcce2c6508.zip |
Merge remote branch 'jblum/mergeme/qtgui/grc' into next
* jblum/mergeme/qtgui/grc: (27 commits)
qtgui: removed python directory that was added, never used
qtgui-grc: added suport in main template for theme icon
qtgui-grc: minor tweaks to the various things
qtgui-grc: added read-only thermo widget to range block
qtgui-grc: fix for list option working in chooser block
qtgui-grc: added check for pyqwt in config
grc: added function args to probe block and documentation
grc: rework the probe blocks and how they fit into grc
qtgui-grc: moved slider to range, added knob and gui tweaks
qtgui-grc: use a vboxlayout for the top_layout
qtgui-grc: made slider widget components (counter/slider) optional
qtgui-grc: add engineering notation to entry and label + other tweaks
qtgui-grc: enable start/stop control through qt widgets
qtgui-grc: rename the text entry and label blocks
grc-qtgui: creaded check box widget with qtgui, cleanup label code
grc-qtgui: added variable text box and static text widgets
grc-qtgui: pick correct signal overload for variable chooser
grc-qtgui: added radio button support, tweaks, more options
grc-qtgui: work on variable chooser block
grc: work on generator for gui flowgraphs to simplify generation
...
Diffstat (limited to 'grc/blocks/variable_function_probe.xml')
-rw-r--r-- | grc/blocks/variable_function_probe.xml | 70 |
1 files changed, 70 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..269966c70 --- /dev/null +++ b/grc/blocks/variable_function_probe.xml @@ -0,0 +1,70 @@ +<?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: + val = self.$(block_id()).$(function_name())($(function_args())) + try: self.set_$(id)(val) + except AttributeError, e: pass + 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>Function Args</name> + <key>function_args</key> + <value></value> + <type>string</type> + <hide>#if $function_args() then 'none' else 'part'#</hide> + </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. + +Set the values for block ID, function name, and function args appropriately: \ +Block ID should be the ID of another block in this flow graph. \ +Function name should be the name of a class method on that block. \ +Function args are the parameters passed into that function. \ +For a function with no arguments, leave function args blank. \ +When passing a string for the function arguments, quote the string literal: '"arg"'. + +The values will used literally, and generated into the following form: +self.block_id.function_name(function_args) + +To poll a stream for a level, use this with the probe signal block. + </doc> +</block> |