Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Multithreading 如何向现有可视化工具提供GNU Radio中sync_块的值?_Multithreading_Matplotlib_Wxpython_Gnuradio - Fatal编程技术网

Multithreading 如何向现有可视化工具提供GNU Radio中sync_块的值?

Multithreading 如何向现有可视化工具提供GNU Radio中sync_块的值?,multithreading,matplotlib,wxpython,gnuradio,Multithreading,Matplotlib,Wxpython,Gnuradio,这是问题的继续。我知道从块线程调用plotting函数是有问题的,因为它可能与WX Gui线程冲突 谁能给我看一个非常简单的代码片段,它使用现有的可视化工具而不是在块线程中绘制input\u items的值 以下是GNU无线电同步块的概要,该块接收要在输入项中绘制的值: import numpy from gnuradio import gr class xyz(gr.sync_block): def __init__(self, multiple): gr.sync_

这是问题的继续。我知道从块线程调用plotting函数是有问题的,因为它可能与WX Gui线程冲突

谁能给我看一个非常简单的代码片段,它使用现有的可视化工具而不是在块线程中绘制
input\u items
的值

以下是GNU无线电同步块的概要,该块接收要在
输入项中绘制的值

import numpy
from gnuradio import gr

class xyz(gr.sync_block):
    def __init__(self, multiple):
        gr.sync_block.__init__(self,
            name="xyz",
            in_sig=[<+numpy.float+>],
            out_sig=[<+numpy.float+>])

    def work(self, input_items, output_items):
        in0 = input_items[0]
        out = output_items[0]
        .....
        # How to pass the value of input_items to an existing visualizer which plots a graph based on these values on the GUI
        .....
        out[:] = in0
        return len(output_items[0])
导入numpy
从gnuradio导入gr
xyz类(gr.sync_块):
定义初始化(自,多个):
gr.sync_块._初始__;(自),
name=“xyz”,
in_sig=[],
out_sig=[])
def工作(自身、输入项、输出项):
in0=输入_项[0]
输出=输出项目[0]
.....
#如何将输入项的值传递给现有的可视化工具,该可视化工具根据GUI上的这些值绘制图形
.....
out[:]=in0
返回len(输出_项[0])
此外,建议将哪个现有绘图块(在gnuradio/gr wxgui中)用作参考