def main(flowgraph_cls=fm_rx, options=None): if StrictVersion("4.5.0") <= StrictVersion( Qt.qVersion()) < StrictVersion("5.0.0"): style = gr.prefs().get_string('qtgui', 'style', 'raster') Qt.QApplication.setGraphicsSystem(style) qapp = Qt.QApplication(sys.argv) fg = flowgraph_cls() rt = gr.runtime() rt.initialize(fg.fg) rt.start() fg.show() def sig_handler(sig=None, frame=None): rt.stop() rt.wait() Qt.QApplication.quit() signal.signal(signal.SIGINT, sig_handler) signal.signal(signal.SIGTERM, sig_handler) timer = Qt.QTimer() timer.start(500) timer.timeout.connect(lambda: None) qapp.exec_()
def test_add_f32(self): tb = gr.flowgraph() rt = gr.runtime() src0 = blocks.vector_source_f([1, 3, 5, 7, 9], False) src1 = blocks.vector_source_f([0, 2, 4, 6, 8], False) adder = add_2_f32_1_f32() sink = blocks.vector_sink_f() tb.connect((src0, 0), (adder, 0)) tb.connect((src1, 0), (adder, 1)) tb.connect(adder, sink) tb.run() self.assertEqual(sink.data(), [1, 5, 9, 13, 17])
def main(): if len(sys.argv) > 1: filename = sys.argv[1] fs = 4e6 else: filename = '' top_block = acquisition_test(filename, fs) runtime = gr.runtime(top_block) try: runtime.start() runtime.wait() fig = p.figure() fig.subplots_adjust(hspace=1.4) p.subplot(3, 1, 1) p.plot(top_block.ca_sink.data()) p.title("C/A code delay") p.xlabel("$t [ms]$") p.ylim(0, 4000) p.subplot(3, 1, 2) p.plot(top_block.fd_sink.data()) p.title("Doppler frequency estimate.") p.xlabel("$t [ms]$") p.ylim(-5e3, 5e3) p.subplot(3, 1, 3) p.plot(top_block.rmax_sink.data()) p.title("Correlation peak magnitude.") p.xlabel("$t [ms]$") p.show() # p.savefig("ca_fd_rmax.pdf") except KeyboardInterrupt: pass
def main(): if len(sys.argv) > 1: filename = sys.argv[1] fs = 4e6 else: filename = '' top_block = acquisition_test(filename, fs) runtime = gr.runtime(top_block) try: runtime.start() runtime.wait() fig = p.figure() fig.subplots_adjust(hspace=1.4) p.subplot(3,1,1) p.plot( top_block.ca_sink.data()) p.title("C/A code delay") p.xlabel("$t [ms]$") p.ylim(0,4000) p.subplot(3,1,2) p.plot( top_block.fd_sink.data()) p.title("Doppler frequency estimate.") p.xlabel("$t [ms]$") p.ylim( -5e3, 5e3 ) p.subplot(3,1,3) p.plot( top_block.rmax_sink.data()) p.title("Correlation peak magnitude.") p.xlabel("$t [ms]$") p.show() # p.savefig("ca_fd_rmax.pdf") except KeyboardInterrupt: pass
def setUp(self): self.tb = gr.flowgraph() self.rt = gr.runtime()
def runtime_create(self, **kwargs): self.rts[kwargs['rt_name']] = gr.runtime() return {'status': 0}
def setUp(self): os.environ['GR_CONF_CONTROLPORT_ON'] = 'False' self.tb = gr.flowgraph() self.rt = gr.runtime()