kopia lustrzana https://github.com/NanoVNA-Saver/nanovna-saver
autoconnect only if there is exactly one device
Signed-off-by: Martin <Ho-Ro@users.noreply.github.com>pull/645/head
rodzic
3437520e11
commit
627e83c823
|
@ -473,8 +473,8 @@ 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():
|
||||
def auto_connect( self ): # connect if there is exactly one detected serial device
|
||||
if self.serial_control.inp_port.count() == 1:
|
||||
self.serial_control.connect_device()
|
||||
|
||||
def _sweep_control(self, start: bool = True) -> None:
|
||||
|
|
|
@ -47,7 +47,7 @@ def main():
|
|||
"-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"
|
||||
"-a", "--auto-connect", action="store_true", help="Auto connect if one device detected"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-f",
|
||||
|
|
Ładowanie…
Reference in New Issue