Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,414 changes: 1,276 additions & 4,138 deletions apps/am_flow_example.grc

Large diffs are not rendered by default.

404 changes: 240 additions & 164 deletions apps/am_flow_example.py

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions apps/cursesgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def draw_spectrum(self, data):
# Clear previous contents, draw border, and title
self.win.clear()
self.win.border(0)
self.win.addnstr(0, self.dims[1]/2-4, "SPECTRUM", 8,
self.win.addnstr(0, int(self.dims[1]/2-4), "SPECTRUM", 8,
curses.color_pair(4))

# Draw the bars
Expand Down Expand Up @@ -191,7 +191,7 @@ def draw_channels(self, gui_tuned_channels):
# Clear previous contents, draw border, and title
self.win.clear()
self.win.border(0)
self.win.addnstr(0, self.dims[1]/2-4, "CHANNELS", 8,
self.win.addnstr(0, int(self.dims[1]/2-4), "CHANNELS", 8,
curses.color_pair(4))

# Limit the displayed channels to no more than two rows
Expand Down Expand Up @@ -247,7 +247,7 @@ def draw_channels(self, gui_lockout_channels):
# Clear previous contents, draw border, and title
self.win.clear()
self.win.border(0)
self.win.addnstr(0, self.dims[1]/2-3, "LOCKOUT", 7,
self.win.addnstr(0, int(self.dims[1]/2-3), "LOCKOUT", 7,
curses.color_pair(4))

# Draw the lockout channels
Expand Down Expand Up @@ -354,7 +354,7 @@ def draw_rx(self):
# Clear previous contents, draw border, and title
self.win.clear()
self.win.border(0)
self.win.addnstr(0, self.dims[1]/2-4, "RECEIVER", 8,
self.win.addnstr(0, int(self.dims[1]/2-4), "RECEIVER", 8,
curses.color_pair(4))

# Draw the receiver info prefix fields
Expand All @@ -380,7 +380,7 @@ def draw_rx(self):
self.win.addnstr(10, 1, text, 15)

# Draw the receiver info suffix fields
if self.freq_entry <> 'None':
if self.freq_entry != 'None':
text = self.freq_entry
else:
text = '{:.3f}'.format((self.center_freq)/1E6)
Expand Down Expand Up @@ -471,7 +471,7 @@ def proc_keyb_hard(self, keyb):
pass
self.freq_entry = 'None'
return True
elif self.freq_entry <> 'None' and (keyb - 48 in range (10) or keyb == ord('.')):
elif self.freq_entry != 'None' and (keyb - 48 in range (10) or keyb == ord('.')):
# build up frequency from 1-9 and '.'
self.freq_entry = self.freq_entry + chr(keyb)
return False
Expand Down
26 changes: 13 additions & 13 deletions apps/estimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,30 +68,30 @@ def main():
""" Tests the functions in this module"""

# Test avg_freq()
print "Testing avg_freq()"
print("Testing avg_freq()")
data = np.array([0, 1, 1, 0])
print "Input spectrum data is " + str(data)
print("Input spectrum data is " + str(data))
result = avg_freq(data)
print "Average frequency is " + str(result)
print("Average frequency is " + str(result))
if result == 1.5:
print "Test Pass"
print("Test Pass")
else:
print "Test Fail"
print ""
print("Test Fail")
print("")

# Test channel_estimate()
print "Testing channel_estimate()"
print("Testing channel_estimate()")
data = np.array([0, 1, 1, 0, 0, 1, 1, 1])
threshold = 0.5
print "Input spectrum data is " + str(data)
print "Threshold is " + str(threshold)
print("Input spectrum data is " + str(data))
print("Threshold is " + str(threshold))
result = channel_estimate(data, threshold)
print "Channels at " + str(result)
print("Channels at " + str(result))
if result == [1.5, 6.0]:
print "Test Pass"
print("Test Pass")
else:
print "Test Fail"
print ""
print("Test Fail")
print("")


if __name__ == '__main__':
Expand Down
10 changes: 5 additions & 5 deletions apps/ham2mon.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ def main(screen):
PARSER = parser.CLParser()
if len(PARSER.parser_args) != 0:
PARSER.print_help() #pylint: disable=maybe-no-member
raise SystemExit, 1
raise(SystemExit, 1)
else:
curses.wrapper(main)
except KeyboardInterrupt:
pass
except RuntimeError:
print ""
print "RuntimeError: SDR hardware not detected or insufficient USB permissions. Try running as root."
print ""
except RuntimeError as err:
print(err)
print("RuntimeError: SDR hardware not detected or insufficient USB permissions. Try running as root.")
print("")

Loading