예제 #1
0
    def __init__(self):
        grc_wxgui.top_block_gui.__init__(self, title="My First Msg 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.precog_msg_to_stdout_0 = precog.msg_to_stdout()
        self.my_first_msg_block_0 = dt.my_first_msg_block()
        self.heart_beat_0_0 = precog.heart_beat(1, "hello", "world")
        self.heart_beat_0 = precog.heart_beat(1, "hello", "world")

        ##################################################
        # Connections
        ##################################################
        self.connect((self.heart_beat_0, 0), (self.my_first_msg_block_0, 0))
        self.connect((self.my_first_msg_block_0, 0),
                     (self.precog_msg_to_stdout_0, 0))
        self.connect((self.heart_beat_0_0, 0), (self.my_first_msg_block_0, 1))
예제 #2
0
    def __init__(self):
        grc_wxgui.top_block_gui.__init__(self, title="My Second Msg Block")

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = 25e6

        ##################################################
        # Blocks
        ##################################################
        self.wxgui_fftsink2_0 = fftsink2.fft_sink_c(
            self.GetWin(),
            baseband_freq=0,
            y_per_div=10,
            y_divs=10,
            ref_level=0,
            ref_scale=2.0,
            sample_rate=samp_rate,
            fft_size=1024,
            fft_rate=15,
            average=False,
            avg_alpha=None,
            title="FFT Plot",
            peak_hold=False,
        )
        self.Add(self.wxgui_fftsink2_0.win)
        self.usrp_source = uhd.usrp_source(
            device_addr="",
            stream_args=uhd.stream_args(
                cpu_format="fc32",
                channels=range(1),
            ),
        )
        self.usrp_source.set_samp_rate(samp_rate)
        self.usrp_source.set_center_freq(105e6, 0)
        self.usrp_source.set_gain(15, 0)
        self.usrp_source.set_antenna("RX2", 0)
        self.my_second_msg_block_0 = dt.my_second_msg_block(
            "95e6,605e6,915e6,880e6,1986e6")
        self.heart_beat_0_0 = precog.heart_beat(5, "hello", "world")
        self.heart_beat_0 = precog.heart_beat(1, "hello", "world")
        self.gr_null_sink_0 = gr.null_sink(gr.sizeof_char * 1)
        self.extras_pmt_rpc_0 = gr_extras.pmt_rpc(obj=self, result_msg=False)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.heart_beat_0, 0), (self.my_second_msg_block_0, 0))
        self.connect((self.heart_beat_0_0, 0), (self.my_second_msg_block_0, 1))
        self.connect((self.my_second_msg_block_0, 1),
                     (self.extras_pmt_rpc_0, 0))
        self.connect((self.usrp_source, 0), (self.wxgui_fftsink2_0, 0))
        self.connect((self.my_second_msg_block_0, 0), (self.gr_null_sink_0, 0))
예제 #3
0
	def __init__(self):
		grc_wxgui.top_block_gui.__init__(self, title="My Second Msg Block")

		##################################################
		# Variables
		##################################################
		self.samp_rate = samp_rate = 25e6

		##################################################
		# Blocks
		##################################################
		self.wxgui_fftsink2_0 = fftsink2.fft_sink_c(
			self.GetWin(),
			baseband_freq=0,
			y_per_div=10,
			y_divs=10,
			ref_level=0,
			ref_scale=2.0,
			sample_rate=samp_rate,
			fft_size=1024,
			fft_rate=15,
			average=False,
			avg_alpha=None,
			title="FFT Plot",
			peak_hold=False,
		)
		self.Add(self.wxgui_fftsink2_0.win)
		self.usrp_source = uhd.usrp_source(
			device_addr="",
			stream_args=uhd.stream_args(
				cpu_format="fc32",
				channels=range(1),
			),
		)
		self.usrp_source.set_samp_rate(samp_rate)
		self.usrp_source.set_center_freq(105e6, 0)
		self.usrp_source.set_gain(15, 0)
		self.usrp_source.set_antenna("RX2", 0)
		self.my_second_msg_block_0 = dt.my_second_msg_block("95e6,605e6,915e6,880e6,1986e6")
		self.heart_beat_0_0 = precog.heart_beat(5,"hello","world")
		self.heart_beat_0 = precog.heart_beat(1,"hello","world")
		self.gr_null_sink_0 = gr.null_sink(gr.sizeof_char*1)
		self.extras_pmt_rpc_0 = gr_extras.pmt_rpc(obj=self, result_msg=False)

		##################################################
		# Connections
		##################################################
		self.connect((self.heart_beat_0, 0), (self.my_second_msg_block_0, 0))
		self.connect((self.heart_beat_0_0, 0), (self.my_second_msg_block_0, 1))
		self.connect((self.my_second_msg_block_0, 1), (self.extras_pmt_rpc_0, 0))
		self.connect((self.usrp_source, 0), (self.wxgui_fftsink2_0, 0))
		self.connect((self.my_second_msg_block_0, 0), (self.gr_null_sink_0, 0))
예제 #4
0
	def __init__(self, rate=1e6, tx_gain=15, samp_per_sym=4, freq=915e6, dest_addr=86, arq_timeout=.10, max_arq_attempts=10, rx_freq=915e6, rx_gain=15, args="", ampl=0.7, port="12345", radio_addr=0, rx_ant="TX/RX"):
		grc_wxgui.top_block_gui.__init__(self, title="Simple Trx 2")

		##################################################
		# Parameters
		##################################################
		self.rate = rate
		self.tx_gain = tx_gain
		self.samp_per_sym = samp_per_sym
		self.freq = freq
		self.dest_addr = dest_addr
		self.arq_timeout = arq_timeout
		self.max_arq_attempts = max_arq_attempts
		self.rx_freq = rx_freq
		self.rx_gain = rx_gain
		self.args = args
		self.ampl = ampl
		self.port = port
		self.radio_addr = radio_addr
		self.rx_ant = rx_ant

		##################################################
		# Variables
		##################################################
		self.samp_rate = samp_rate = rate

		##################################################
		# Blocks
		##################################################
		self.virtual_channel_formatter_0 = precog.virtual_channel_formatter(dest_addr,1)
		self.simple_mac_0 = precog.simple_mac(radio_addr,arq_timeout,max_arq_attempts)
		self.radio_hier_0 = radio_hier(
			rx_gain=rx_gain,
			ampl=ampl,
			tx_gain=tx_gain,
			rx_freq=rx_freq,
			args=args,
			samp_per_sym=samp_per_sym,
			tx_freq=freq,
			rate=rate,
			rx_ant=rx_ant,
		)
		self.heart_beat_0 = precog.heart_beat(0.001,"W","")
		self.extras_socket_msg_0 = gr_extras.socket_msg("TCP", "127.0.0.1", port, 0)

		##################################################
		# Connections
		##################################################
		self.connect((self.heart_beat_0, 0), (self.simple_mac_0, 2))
		self.connect((self.simple_mac_0, 0), (self.radio_hier_0, 0))
		self.connect((self.radio_hier_0, 0), (self.simple_mac_0, 0))
		self.connect((self.extras_socket_msg_0, 0), (self.virtual_channel_formatter_0, 0))
		self.connect((self.virtual_channel_formatter_0, 0), (self.simple_mac_0, 1))
		self.connect((self.simple_mac_0, 1), (self.extras_socket_msg_0, 0))
예제 #5
0
	def __init__(self):
		grc_wxgui.top_block_gui.__init__(self, title="My First Msg 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.precog_msg_to_stdout_0 = precog.msg_to_stdout()
		self.my_first_msg_block_0 = dt.my_first_msg_block()
		self.heart_beat_0_0 = precog.heart_beat(1,"hello","world")
		self.heart_beat_0 = precog.heart_beat(1,"hello","world")

		##################################################
		# Connections
		##################################################
		self.connect((self.heart_beat_0, 0), (self.my_first_msg_block_0, 0))
		self.connect((self.my_first_msg_block_0, 0), (self.precog_msg_to_stdout_0, 0))
		self.connect((self.heart_beat_0_0, 0), (self.my_first_msg_block_0, 1))
예제 #6
0
파일: mux_work.py 프로젝트: antiface/gr-dt
    def __init__(self):
        grc_wxgui.top_block_gui.__init__(self, title="Mux Work")
        _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.virtual_channel_mux_0 = precog.virtual_channel_mux(4)
        self.virtual_channel_demux_0 = precog.virtual_channel_demux(3)
        self.precog_msg_to_stdout_0 = precog.msg_to_stdout()
        self.heart_beat_0 = precog.heart_beat(1, "key", "value1")

        ##################################################
        # Connections
        ##################################################
        self.connect((self.virtual_channel_mux_0, 0), (self.virtual_channel_demux_0, 0))
        self.connect((self.virtual_channel_demux_0, 0), (self.precog_msg_to_stdout_0, 0))
        self.connect((self.heart_beat_0, 0), (self.virtual_channel_mux_0, 0))
예제 #7
0
파일: mux_work.py 프로젝트: jmalsbury/gr-dt
	def __init__(self):
		grc_wxgui.top_block_gui.__init__(self, title="Mux Work")
		_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.virtual_channel_mux_0 = precog.virtual_channel_mux(4)
		self.virtual_channel_demux_0 = precog.virtual_channel_demux(3)
		self.precog_msg_to_stdout_0 = precog.msg_to_stdout()
		self.heart_beat_0 = precog.heart_beat(1,"key","value1")

		##################################################
		# Connections
		##################################################
		self.connect((self.virtual_channel_mux_0, 0), (self.virtual_channel_demux_0, 0))
		self.connect((self.virtual_channel_demux_0, 0), (self.precog_msg_to_stdout_0, 0))
		self.connect((self.heart_beat_0, 0), (self.virtual_channel_mux_0, 0))
예제 #8
0
    def __init__(
        self,
        args="",
        rx_gain=15,
        max_arq_attempts=10,
        ampl=0.7,
        dest_addr=86,
        arq_timeout=0.10,
        radio_addr=0,
        samp_per_sym=4,
        rate=1e6,
        tx_gain=15,
        freq=915e6,
        port="12347",
        rx_freq=915e6,
        tx_freq=915e6,
        rx_antenna="TX/RX",
    ):
        grc_wxgui.top_block_gui.__init__(self, title="Simple Trx")
        _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png"
        self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))

        ##################################################
        # Parameters
        ##################################################
        self.args = args
        self.rx_gain = rx_gain
        self.max_arq_attempts = max_arq_attempts
        self.ampl = ampl
        self.dest_addr = dest_addr
        self.arq_timeout = arq_timeout
        self.radio_addr = radio_addr
        self.samp_per_sym = samp_per_sym
        self.rate = rate
        self.tx_gain = tx_gain
        self.freq = freq
        self.port = port
        self.rx_freq = rx_freq
        self.tx_freq = tx_freq
        self.rx_antenna = rx_antenna

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = rate

        ##################################################
        # Blocks
        ##################################################
        self.virtual_channel_formatter_0 = precog.virtual_channel_formatter(dest_addr, 1)
        self.simple_mac_0 = precog.simple_mac(radio_addr, arq_timeout, max_arq_attempts)
        self.radio_hier_0 = radio_hier(
            rate=samp_rate,
            tx_gain=tx_gain,
            rx_freq=rx_freq,
            args=args,
            rx_gain=rx_gain,
            tx_freq=tx_freq,
            rx_ant=rx_antenna,
            ampl=ampl,
            samp_per_sym=samp_per_sym,
        )
        self.heart_beat_0 = precog.heart_beat(0.001, "W", "")
        self.extras_socket_msg_0 = gr_extras.socket_msg("TCP", "127.0.0.1", port, 0)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.extras_socket_msg_0, 0), (self.virtual_channel_formatter_0, 0))
        self.connect((self.simple_mac_0, 1), (self.extras_socket_msg_0, 0))
        self.connect((self.virtual_channel_formatter_0, 0), (self.simple_mac_0, 1))
        self.connect((self.heart_beat_0, 0), (self.simple_mac_0, 2))
        self.connect((self.radio_hier_0, 0), (self.simple_mac_0, 0))
        self.connect((self.simple_mac_0, 0), (self.radio_hier_0, 0))
예제 #9
0
    def __init__(self,
                 rate=1e6,
                 tx_gain=15,
                 samp_per_sym=4,
                 freq=915e6,
                 dest_addr=86,
                 arq_timeout=.10,
                 max_arq_attempts=10,
                 rx_freq=915e6,
                 rx_gain=15,
                 args="",
                 ampl=0.7,
                 port="12345",
                 radio_addr=0,
                 rx_ant="TX/RX"):
        grc_wxgui.top_block_gui.__init__(self, title="Simple Trx 2")

        ##################################################
        # Parameters
        ##################################################
        self.rate = rate
        self.tx_gain = tx_gain
        self.samp_per_sym = samp_per_sym
        self.freq = freq
        self.dest_addr = dest_addr
        self.arq_timeout = arq_timeout
        self.max_arq_attempts = max_arq_attempts
        self.rx_freq = rx_freq
        self.rx_gain = rx_gain
        self.args = args
        self.ampl = ampl
        self.port = port
        self.radio_addr = radio_addr
        self.rx_ant = rx_ant

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = rate

        ##################################################
        # Blocks
        ##################################################
        self.virtual_channel_formatter_0 = precog.virtual_channel_formatter(
            dest_addr, 1)
        self.simple_mac_0 = precog.simple_mac(radio_addr, arq_timeout,
                                              max_arq_attempts)
        self.radio_hier_0 = radio_hier(
            rx_gain=rx_gain,
            ampl=ampl,
            tx_gain=tx_gain,
            rx_freq=rx_freq,
            args=args,
            samp_per_sym=samp_per_sym,
            tx_freq=freq,
            rate=rate,
            rx_ant=rx_ant,
        )
        self.heart_beat_0 = precog.heart_beat(0.001, "W", "")
        self.extras_socket_msg_0 = gr_extras.socket_msg(
            "TCP", "127.0.0.1", port, 0)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.heart_beat_0, 0), (self.simple_mac_0, 2))
        self.connect((self.simple_mac_0, 0), (self.radio_hier_0, 0))
        self.connect((self.radio_hier_0, 0), (self.simple_mac_0, 0))
        self.connect((self.extras_socket_msg_0, 0),
                     (self.virtual_channel_formatter_0, 0))
        self.connect((self.virtual_channel_formatter_0, 0),
                     (self.simple_mac_0, 1))
        self.connect((self.simple_mac_0, 1), (self.extras_socket_msg_0, 0))
예제 #10
0
    def __init__(self,
                 rate=1e6,
                 tx_gain=15,
                 samp_per_sym=4,
                 freq=915e6,
                 arq_timeout=.10,
                 max_arq_attempts=10,
                 rx_freq=915e6,
                 rx_gain=15,
                 args="",
                 ampl=0.7,
                 port1="12345",
                 port2="12346",
                 radio_addr=0,
                 dest_addr_1=86,
                 dest_addr_2=87):
        grc_wxgui.top_block_gui.__init__(self, title="Simple Trx")
        _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png"
        self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY))

        ##################################################
        # Parameters
        ##################################################
        self.rate = rate
        self.tx_gain = tx_gain
        self.samp_per_sym = samp_per_sym
        self.freq = freq
        self.arq_timeout = arq_timeout
        self.max_arq_attempts = max_arq_attempts
        self.rx_freq = rx_freq
        self.rx_gain = rx_gain
        self.args = args
        self.ampl = ampl
        self.port1 = port1
        self.port2 = port2
        self.radio_addr = radio_addr
        self.dest_addr_1 = dest_addr_1
        self.dest_addr_2 = dest_addr_2

        ##################################################
        # Variables
        ##################################################
        self.samp_rate = samp_rate = rate

        ##################################################
        # Blocks
        ##################################################
        self.virtual_channel_mux_0 = precog.virtual_channel_mux(2)
        self.virtual_channel_formatter_0_0 = precog.virtual_channel_formatter(
            dest_addr_2, 1)
        self.virtual_channel_formatter_0 = precog.virtual_channel_formatter(
            dest_addr_1, 1)
        self.virtual_channel_demux_0 = precog.virtual_channel_demux(2)
        self.simple_mac_0 = precog.simple_mac(radio_addr, arq_timeout,
                                              max_arq_attempts)
        self.radio_hier_0 = radio_hier(
            rx_gain=rx_gain,
            ampl=ampl,
            tx_gain=tx_gain,
            rx_freq=rx_freq,
            args=args,
            samp_per_sym=samp_per_sym,
            tx_freq=freq,
            rate=rate,
            rx_ant='TX/RX',
        )
        self.heart_beat_0 = precog.heart_beat(0.001, "W", "")
        self.extras_socket_msg_0_0 = gr_extras.socket_msg(
            "TCP", "127.0.0.1", port2, 0)
        self.extras_socket_msg_0 = gr_extras.socket_msg(
            "TCP", "127.0.0.1", port1, 0)

        ##################################################
        # Connections
        ##################################################
        self.connect((self.heart_beat_0, 0), (self.simple_mac_0, 2))
        self.connect((self.simple_mac_0, 0), (self.radio_hier_0, 0))
        self.connect((self.radio_hier_0, 0), (self.simple_mac_0, 0))
        self.connect((self.extras_socket_msg_0, 0),
                     (self.virtual_channel_formatter_0, 0))
        self.connect((self.extras_socket_msg_0_0, 0),
                     (self.virtual_channel_formatter_0_0, 0))
        self.connect((self.virtual_channel_demux_0, 1),
                     (self.extras_socket_msg_0, 0))
        self.connect((self.simple_mac_0, 1), (self.virtual_channel_demux_0, 0))
        self.connect((self.virtual_channel_demux_0, 0),
                     (self.extras_socket_msg_0_0, 0))
        self.connect((self.virtual_channel_mux_0, 0), (self.simple_mac_0, 1))
        self.connect((self.virtual_channel_formatter_0_0, 0),
                     (self.virtual_channel_mux_0, 0))
        self.connect((self.virtual_channel_formatter_0, 0),
                     (self.virtual_channel_mux_0, 1))