From 741f0edb48604524ab5fd1a0a88063ea1bf37ce5 Mon Sep 17 00:00:00 2001 From: Isaac Konikoff Date: Mon, 11 Nov 2019 15:15:54 -0800 Subject: [PATCH] Add points argument to control x-axis time scale. --- pulse_detect.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pulse_detect.py b/pulse_detect.py index db86675a..86e69074 100755 --- a/pulse_detect.py +++ b/pulse_detect.py @@ -29,11 +29,12 @@ if __name__ == '__main__': except: print("Warning: failed to XInitThreads()") - unixOptions = "f:s:" - gnuOptions = [ "freq=", "serno=" ] + unixOptions = "f:s:p:" + gnuOptions = [ "freq=", "serno=", "points=" ] parser = argparse.ArgumentParser(description='pulse watcher') parser.add_argument("--serno", type=str, help="hackrf serial number") - parser.add_argument("--freq", type=int, help="center frequency") + parser.add_argument("--freq", type=int, help="center frequency in Hz") + parser.add_argument("--points", type=int, help="number of x-axis points") args = parser.parse_args() hackrf_sn = args.serno center_freq = args.freq @@ -56,8 +57,8 @@ from gnuradio import qtgui class pulse_detect(gr.top_block, Qt.QWidget): - # divide sample rate by point to get time scale in millisec - gnuradio_points = 100000 + # divide sample rate by points to get time scale in millisec + gnuradio_points = args.points def __init__(self): gr.top_block.__init__(self, "Pulse Detect")