kopia lustrzana https://github.com/NanoVNA-Saver/nanovna-saver
option --auto-connect, connect automatically to the 1st detected device
Signed-off-by: Martin <Ho-Ro@users.noreply.github.com>pull/645/head
rodzic
a8ffbc3aee
commit
3437520e11
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
Ładowanie…
Reference in New Issue