option --auto-connect, connect automatically to the 1st detected device

Signed-off-by: Martin <Ho-Ro@users.noreply.github.com>
pull/645/head
Martin 2023-06-21 16:28:21 +02:00
rodzic a8ffbc3aee
commit 3437520e11
2 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -473,6 +473,10 @@ class NanoVNASaver(QWidget):
logger.debug("Finished building interface")
def auto_connect( self ): # connect to the 1st detected serial device
if self.serial_control.inp_port.currentData():
self.serial_control.connect_device()
def _sweep_control(self, start: bool = True) -> None:
self.sweep_control.progress_bar.setValue(0 if start else 100)
self.sweep_control.btn_start.setDisabled(start)

Wyświetl plik

@ -46,6 +46,9 @@ def main():
parser.add_argument(
"-D", "--debug-file", help="File to write debug logging output to"
)
parser.add_argument(
"-a", "--auto-connect", action="store_true", help="Auto connect to detected 1st device"
)
parser.add_argument(
"-f",
"--file",
@ -92,6 +95,8 @@ def main():
window = NanoVNASaver()
window.show()
if args.auto_connect:
window.auto_connect()
if args.file:
t = Touchstone(args.file)
t.load()