Skip to content

Commit

Permalink
ignore other devices on startup when device serial specified
Browse files Browse the repository at this point in the history
  • Loading branch information
jankae committed Oct 31, 2023
1 parent 79290d0 commit 4c0d18b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Software/PC_Application/LibreVNA-GUI/appwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ bool AppWindow::ConnectToDevice(QString serial, DeviceDriver *driver)
device = d;
} else {
disconnect(d, nullptr, this, nullptr);
UpdateDeviceList();
break;
}
}
Expand Down Expand Up @@ -999,6 +1000,10 @@ int AppWindow::UpdateDeviceList()
DeviceEntry e;
e.driver = driver;
e.serial = serial;
if(!parser.value("device").isEmpty() && parser.value("device") != e.serial) {
// specified device does not match, ignore
continue;
}
deviceList.push_back(e);
}
}
Expand All @@ -1014,10 +1019,6 @@ int AppWindow::UpdateDeviceList()
int available = 0;
bool found = false;
for(auto d : deviceList) {
if(!parser.value("device").isEmpty() && parser.value("device") != d.serial) {
// specified device does not match, ignore
continue;
}
auto connectAction = ui->menuConnect_to->addAction(d.toString());
connectAction->setCheckable(true);
connectAction->setActionGroup(deviceActionGroup);
Expand Down

0 comments on commit 4c0d18b

Please sign in to comment.