probe threads: set daemon
[debian/gnuradio] / grc / data / platforms / python / blocks / gr_probe_density_b.xml
1 <?xml version="1.0"?>
2 <!--
3 ###################################################
4 ##Probe Density
5 ###################################################
6  -->
7 <block>
8         <name>Probe Density</name>
9         <key>gr_probe_density_b</key>
10         <import>from gnuradio import gr</import>
11         <import>import threading</import>
12         <import>import time</import>
13         <make>gr.probe_density_b($alpha)
14 def _$(id)_run():
15         while True:
16                 time.sleep($update_interval)
17                 print "$(id) Density:", self.$(id).density()
18 _$(id)_thread = threading.Thread(target=_$(id)_run)
19 _$(id)_thread.setDaemon(True)
20 _$(id)_thread.start()</make>
21         <callback>set_alpha($alpha)</callback>
22         <param>
23                 <name>Alpha</name>
24                 <key>alpha</key>
25                 <type>real</type>
26         </param>
27         <param>
28                 <name>Update Interval (s)</name>
29                 <key>update_interval</key>
30                 <value>1.0</value>
31                 <type>real</type>
32         </param>
33         <sink>
34                 <name>in</name>
35                 <type>byte</type>
36         </sink>
37 </block>