From a64acfe8cef1fa73da333d0860b3da0c97a5eb45 Mon Sep 17 00:00:00 2001 From: jcorgan Date: Thu, 20 Sep 2007 03:34:02 +0000 Subject: Merged r6475:6484 from jcorgan/radar into trunk. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6485 221aa14e-8319-0410-a670-987f0aec2ac5 --- gr-radar-mono/src/python/usrp_radar_mono.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'gr-radar-mono/src/python/usrp_radar_mono.py') diff --git a/gr-radar-mono/src/python/usrp_radar_mono.py b/gr-radar-mono/src/python/usrp_radar_mono.py index 077b798ca..a8ed9b8bf 100755 --- a/gr-radar-mono/src/python/usrp_radar_mono.py +++ b/gr-radar-mono/src/python/usrp_radar_mono.py @@ -32,8 +32,8 @@ logfile = None def process_echo(echo): global logfile - #sys.stdout.write('.') - logfile.write(echo) + if logfile is not None: + logfile.write(echo) def main(): global logfile @@ -71,14 +71,10 @@ def main(): parser.print_help() sys.exit(1) - if options.filename == None: - print "Must supply filename for logging received data." - sys.exit(1) - else: + if options.filename is not None: if options.verbose: print "Logging echo records to file: ", options.filename - - logfile = open(options.filename, 'wb') + logfile = open(options.filename, 'wb') r = radar(options, process_echo) @@ -88,11 +84,14 @@ def main(): r.set_prf(options.prf) r.set_amplitude(options.amplitude) r.set_freq(options.frequency, options.chirp_width) - + r.set_atrdel(64, 70) # TODO: parameterize + r.start() raw_input("Press ENTER to stop.") r.stop() - logfile.close() + + if logfile is not None: + logfile.close() if __name__ == "__main__": main() -- cgit