From d72cd723c56614f95286ed71272be3406cf36ddd Mon Sep 17 00:00:00 2001 From: jcorgan Date: Wed, 4 Jul 2007 22:58:57 +0000 Subject: Minor tweaks in display git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5905 221aa14e-8319-0410-a670-987f0aec2ac5 --- gr-pager/src/usrp_flex.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'gr-pager') diff --git a/gr-pager/src/usrp_flex.py b/gr-pager/src/usrp_flex.py index a9d6593fd..a1a790333 100755 --- a/gr-pager/src/usrp_flex.py +++ b/gr-pager/src/usrp_flex.py @@ -129,7 +129,7 @@ class app_flow_graph(gr.flow_graph): def main(): parser = OptionParser(option_class=eng_option) - parser.add_option("-f", "--frequency", type="eng_float", + parser.add_option("-f", "--frequency", type="eng_float", default=None, help="set receive frequency to Hz", metavar="Hz") parser.add_option("-R", "--rx-subdev-spec", type="subdev", help="select USRP Rx side A or B", metavar="SUBDEV") @@ -139,6 +139,10 @@ def main(): help="set RF gain", metavar="dB") (options, args) = parser.parse_args() + if len(args) > 0 or options.frequency == None: + print "Run 'usrp_flex.py -h' for options." + sys.exit(1) + if options.frequency < 1e6: options.frequency *= 1e6 @@ -150,8 +154,15 @@ def main(): while 1: if not queue.empty_p(): msg = queue.delete_head() # Blocking read - fields = split(msg.to_string(), chr(128)) - print join(fields, '|') + 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, '') + else: time.sleep(1) -- cgit