mirror of
https://github.com/romanz/amodem.git
synced 2026-02-24 16:18:12 +08:00
amodem: fix --plot switch
This commit is contained in:
@@ -86,9 +86,9 @@ def find_start(buf, length):
|
||||
|
||||
class Receiver(object):
|
||||
|
||||
def __init__(self, pylab=None):
|
||||
def __init__(self, plt=None):
|
||||
self.stats = {}
|
||||
self.plt = pylab or common.Dummy()
|
||||
self.plt = plt or common.Dummy()
|
||||
|
||||
def _prefix(self, sampler, freq, gain=1.0, skip=5):
|
||||
symbols = dsp.Demux(sampler, [freq])
|
||||
@@ -273,7 +273,7 @@ def main(args):
|
||||
|
||||
reader.check = common.check_saturation
|
||||
|
||||
receiver = Receiver(args.plt)
|
||||
receiver = Receiver(plt=args.plot)
|
||||
success = False
|
||||
try:
|
||||
log.info('Waiting for carrier tone: %.1f kHz', config.Fc / 1e3)
|
||||
|
||||
@@ -98,7 +98,7 @@ def main():
|
||||
'--skip', type=int, default=128,
|
||||
help='skip initial N samples, due to spurious spikes')
|
||||
receiver.add_argument(
|
||||
'--plot', dest='plt', action='store_true', default=False,
|
||||
'--plot', action='store_true', default=False,
|
||||
help='plot results using pylab module')
|
||||
receiver.set_defaults(
|
||||
main=run_recv,
|
||||
@@ -120,6 +120,9 @@ def main():
|
||||
|
||||
# Parsing and execution
|
||||
log.debug('MODEM settings: %r', config.settings)
|
||||
if args.plot:
|
||||
import pylab
|
||||
args.plot = pylab
|
||||
args.main(args)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user