mirror of
https://github.com/gnuradio/gnuradio-companion.git
synced 2025-12-10 17:46:12 -06:00
grc: fixes crash when using function probe with bokehgui
This commit is contained in:
parent
196db50915
commit
891750b4dc
@ -31,12 +31,22 @@ templates:
|
||||
import time
|
||||
import threading
|
||||
var_make: self.${id} = ${id} = ${value}
|
||||
make: "\ndef _${id}_probe():\n while True:\n <% obj = 'self' + ('.'\
|
||||
\ + block_id if block_id else '') %>\n val = ${obj}.${function_name}(${function_args})\n\
|
||||
\ try:\n self.set_${id}(val)\n except AttributeError:\n\
|
||||
\ pass\n time.sleep(1.0 / (${poll_rate}))\n_${id}_thread\
|
||||
\ = threading.Thread(target=_${id}_probe)\n_${id}_thread.daemon = True\n_${id}_thread.start()\n\
|
||||
\ "
|
||||
make: |+
|
||||
def _${id}_probe():
|
||||
while True:
|
||||
<% obj = 'self' + ('.' + block_id if block_id else '') %>
|
||||
val = ${obj}.${function_name}(${function_args})
|
||||
try:
|
||||
try:
|
||||
self.doc.add_next_tick_callback(functools.partial(self.set_${id},val))
|
||||
except AttributeError:
|
||||
self.set_${id}(val)
|
||||
except AttributeError:
|
||||
pass
|
||||
time.sleep(1.0 / (${poll_rate}))
|
||||
_${id}_thread = threading.Thread(target=_${id}_probe)
|
||||
_${id}_thread.daemon = True
|
||||
_${id}_thread.start()
|
||||
callbacks:
|
||||
- self.set_${id}(${value})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user