discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Message Passing


From: Activecat
Subject: Re: [Discuss-gnuradio] Message Passing
Date: Wed, 14 May 2014 17:35:22 +0800


On Wed, May 14, 2014 at 5:26 PM, Martin Braun <address@hidden> wrote:
There's no msg_connect() call here -- that would be your problem.
M

I build the flowgraph using GRC. How to make correction?
The complete top_block.py is as follows.

#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Top Block
# Generated: Wed May 14 17:30:37 2014
##################################################

from gnuradio import blocks
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from grc_gnuradio import wxgui as grc_wxgui
from optparse import OptionParser
import activecat
import wx

class top_block(grc_wxgui.top_block_gui):

    def __init__(self):
        grc_wxgui.top_block_gui.__init__(self, title="Top Block")
        _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png"
        self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 32000

        ##################################################
        # Blocks
        ##################################################
        self.blocks_head_0 = blocks.head(gr.sizeof_int*1, 10)
        self.blocks_divide_xx_0 = blocks.divide_ii(1)
        self.activecat_message_source1_0 = activecat.message_source1()
        self.activecat_message_sink1_0 = activecat.message_sink1()
        self.activecat_integer_sink3_0 = activecat.integer_sink3(False, True, "Integer1")

        ##################################################
        # Connections
        ##################################################
        self.connect((self.blocks_divide_xx_0, 0), (self.blocks_head_0, 0))
        self.connect((self.blocks_head_0, 0), (self.activecat_integer_sink3_0, 0))
        self.connect((self.activecat_message_source1_0, 0), (self.blocks_divide_xx_0, 0))
        self.connect((self.activecat_message_sink1_0, 0), (self.blocks_divide_xx_0, 1))


# QT sink close method reimplementation

    def get_samp_rate(self):
        return self.samp_rate

    def set_samp_rate(self, samp_rate):
        self.samp_rate = samp_rate

if __name__ == '__main__':
    import ctypes
    import sys
    if sys.platform.startswith('linux'):
        try:
            x11 = ctypes.cdll.LoadLibrary('libX11.so')
            x11.XInitThreads()
        except:
            print "Warning: failed to XInitThreads()"
    parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
    (options, args) = parser.parse_args()
    tb = top_block()
    tb.Start(True)
    tb.Wait()


reply via email to

[Prev in Thread] Current Thread [Next in Thread]