Exemplo n.º 1
0
    def test_msg_source(self):
        print("\n===  Test 2,  with GWN msg_source\n")
        tst_msg = "--- FROM message source TO msg_sink"
        blk_src = msg_source(msg_count=4, interval=1.0)
        blk_sink = msg_sink()

        self.tb.msg_connect((blk_src, blk_src.ports_out[0].port),
                            (blk_sink, blk_sink.ports_in[0].port))

        #self.tb.run()  # for flowgraphs that will stop on its own!
        self.tb.start()

        time.sleep(5)

        self.tb.stop()
        self.tb.wait()

        return
Exemplo n.º 2
0
    def test_msg_source(self):
        blk_src = msg_source(msg_count=4, interval=1.0, \
          payload='An exampla payload')
        blk_src.timers[0].debug = False  # True
        #blk_src.timers[0].start()
        blk_dbg = blocks.message_debug()

        self.tb.msg_connect((blk_src, blk_src.ports_out[0].port),
                            (blk_dbg, "print"))

        #self.tb.run()  # for flowgraphs that will stop on its own!
        self.tb.start()
        time.sleep(6)

        self.tb.stop()
        self.tb.wait()

        return
Exemplo n.º 3
0
    def test_msg_passer(self):
        print "\n=== Test message passing, interrupt, continue\n"
        blk_src = msg_source(msg_count=12, interval=1.0)
        blk_src.timers[0].debug = False  # True

        blk_pass = msg_passer(tout_stop=4.0, tout_restart=7.0)
        blk_sink = msg_sink()

        self.tb.msg_connect((blk_src, blk_src.ports_out[0].port),
                            (blk_pass, blk_pass.ports_in[0].port))
        self.tb.msg_connect((blk_pass, blk_pass.ports_out[0].port),
                            (blk_sink, blk_sink.ports_in[0].port))

        #self.tb.run()  # for flowgraphs that will stop on its own!
        self.tb.start()
        time.sleep(14)
        self.tb.stop()
        self.tb.wait()

        return