mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 15:04:11 +00:00
Improve load time of setup files by omitting excessive device configuration
This commit is contained in:
parent
2f5cbc80e9
commit
eff18a22e8
7 changed files with 213 additions and 173 deletions
|
|
@ -1140,6 +1140,14 @@ void AppWindow::LoadSetup(nlohmann::json j)
|
|||
toolbars.reference.outFreq->setCurrentText(QString::fromStdString(j["Reference"].value("Output", "Off")));
|
||||
}
|
||||
|
||||
// Disconnect device prior to deleting and creating new modes. This prevents excessice and unnnecessary configuration of the device
|
||||
QString serial = QString();
|
||||
if(vdevice->getConnected()) {
|
||||
serial = vdevice->serial();
|
||||
delete vdevice;
|
||||
vdevice = nullptr;
|
||||
}
|
||||
|
||||
modeHandler->closeModes();
|
||||
|
||||
/* old style VNA/Generator/Spectrum Analyzer settings,
|
||||
|
|
@ -1170,6 +1178,11 @@ void AppWindow::LoadSetup(nlohmann::json j)
|
|||
}
|
||||
}
|
||||
|
||||
// reconnect to device
|
||||
if(!serial.isEmpty()) {
|
||||
vdevice = new VirtualDevice(serial);
|
||||
}
|
||||
|
||||
// activate the correct mode
|
||||
QString modeName = QString::fromStdString(j.value("activeMode", ""));
|
||||
for(auto m : modeHandler->getModes()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue