#!/usr/bin/env python
-
#
-# Copyright 2006,2007 Free Software Foundation, Inc.
+# Copyright 2006,2007,2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
from gnuradio.eng_option import eng_option
from optparse import OptionParser
import time, os, sys
-from string import split, join
"""
This example application demonstrates receiving and demodulating the
print "Channel filter has", len(taps), "taps."
self.chan = gr.freq_xlating_fir_filter_ccf(10, # Decimation rate
- taps, # Filter taps
- 0.0, # Offset frequency
- 250e3) # Sample rate
+ taps, # Filter taps
+ 0.0, # Offset frequency
+ 250e3) # Sample rate
if options.log:
chan_sink = gr.file_sink(gr.sizeof_gr_complex, 'chan.dat')
# Flow graph emits pages into message queue
queue = gr.msg_queue()
tb = app_top_block(options, queue)
+ runner = pager.queue_runner(queue)
try:
- tb.start()
- while 1:
- if not queue.empty_p():
- msg = queue.delete_head() # Blocking read
- page = join(split(msg.to_string(), chr(128)), '|')
- disp = []
- for n in range(len(page)):
- if ord(page[n]) < 32:
- disp.append('.')
- else:
- disp.append(page[n])
- print join(disp, '')
- tb.adjust_freq()
-
- else:
- time.sleep(1)
-
+ tb.run()
except KeyboardInterrupt:
- tb.stop()
+ pass
+
+ runner.end()
+
if __name__ == "__main__":
main()