add: option to send raw commands

This commit is contained in:
TT 2019-10-22 09:01:42 +09:00
parent f6e9c6f434
commit 0f29824a78

View file

@ -392,10 +392,16 @@ if __name__ == '__main__':
help="apply IF filter on raw wave plot")
parser.add_option("-C", "--capture", dest="capture",
help="capture current display to FILE", metavar="FILE")
parser.add_option("-e", dest="command", action="append",
help="send raw command", metavar="COMMAND")
(opt, args) = parser.parse_args()
nv = NanoVNA(opt.device or getport())
if opt.command:
for c in opt.command:
nv.send_command(c + "\r")
if opt.capture:
print("capturing...")
img = nv.capture()