diff options
author | Johannes Demel <ufcsy@student.kit.edu> | 2015-11-12 11:33:26 +0100 |
---|---|---|
committer | Johannes Demel <ufcsy@student.kit.edu> | 2015-11-12 11:37:16 +0100 |
commit | bc05f646de19ae1e29e9704b16a5b879a3340eca (patch) | |
tree | 571e521238779aac661176bb598b880bd1c64eb0 /gr-analog/python/analog/qa_sig_source.py | |
parent | 8737d63030ecaac05793900e71c6a14a05ff0e7a (diff) |
analog: added freq msg port to sig_source
Diffstat (limited to 'gr-analog/python/analog/qa_sig_source.py')
-rwxr-xr-x | gr-analog/python/analog/qa_sig_source.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gr-analog/python/analog/qa_sig_source.py b/gr-analog/python/analog/qa_sig_source.py index 5ee4f24af8..8d050fa72b 100755 --- a/gr-analog/python/analog/qa_sig_source.py +++ b/gr-analog/python/analog/qa_sig_source.py @@ -21,7 +21,7 @@ # import math - +import pmt from gnuradio import gr, gr_unittest, analog, blocks class test_sig_source(gr_unittest.TestCase): @@ -156,5 +156,19 @@ class test_sig_source(gr_unittest.TestCase): dst_data = dst1.data() self.assertFloatTuplesAlmostEqual(expected_result, dst_data, 5) + def test_freq_msg(self): + src = analog.sig_source_c(8, analog.GR_SIN_WAVE, 1.0, 1.0) + op = blocks.head(gr.sizeof_gr_complex, 9) + snk = blocks.vector_sink_c() + self.tb.connect(src, op, snk) + self.assertAlmostEqual(src.frequency(), 1.0) + + frequency = 3.0 + src._post(pmt.to_pmt('freq'), pmt.from_double(frequency)) + self.tb.run() + + self.assertAlmostEqual(src.frequency(), frequency) + + if __name__ == '__main__': gr_unittest.run(test_sig_source, "test_sig_source.xml") |