1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -04:00

Plugins device enumeration optimization: factorization of common code for Rx/Tx devices

This commit is contained in:
f4exb
2019-09-17 19:54:13 +02:00
parent e9bbf0b266
commit ee3313dc82
34 changed files with 341 additions and 550 deletions
@@ -64,30 +64,7 @@ void PlutoSDRInputPlugin::enumOriginDevices(QStringList& listedHwIds, OriginDevi
return;
}
DevicePlutoSDR::instance().scan();
std::vector<std::string> serials;
DevicePlutoSDR::instance().getSerials(serials);
std::vector<std::string>::const_iterator it = serials.begin();
int i;
for (i = 0; it != serials.end(); ++it, ++i)
{
QString serial_str = QString::fromLocal8Bit(it->c_str());
QString displayableName(QString("PlutoSDR[%1] %2").arg(i).arg(serial_str));
originDevices.append(OriginDevice(
displayableName,
m_hardwareID,
serial_str,
i, // sequence
1, // Nb Rx
1 // Nb Tx
));
qDebug("PlutoSDRInputPlugin::enumOriginDevices: enumerated PlutoSDR device #%d", i);
}
DevicePlutoSDR::instance().enumOriginDevices(m_hardwareID, originDevices);
listedHwIds.append(m_hardwareID);
}