1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-17 05:41:56 -05:00

Corrected device display name channel handling

This commit is contained in:
f4exb 2019-09-18 23:02:08 +02:00
parent 2d62cc74eb
commit 01f0dd906a
12 changed files with 21 additions and 12 deletions

View File

@ -80,7 +80,7 @@ void DeviceBladeRF2::enumOriginDevices(const QString& hardwareId, PluginInterfac
unsigned int nbRxChannels = bladerf_get_channel_count(dev, BLADERF_RX);
unsigned int nbTxChannels = bladerf_get_channel_count(dev, BLADERF_TX);
// make the stream index a placeholder for future arg() hence the arg("%1")
QString displayableName(QString("BladeRF2[%1:%2] %3").arg(devinfo[i].instance).arg("%1").arg(devinfo[i].serial));
QString displayableName(QString("BladeRF2[%1:$1] %2").arg(devinfo[i].instance).arg(devinfo[i].serial));
originDevices.append(PluginInterface::OriginDevice(
displayableName,

View File

@ -54,7 +54,7 @@ void DeviceLimeSDR::enumOriginDevices(const QString& hardwareId, PluginInterface
limeSDRParams.open(deviceList[i]);
limeSDRParams.close();
QString displayedName(QString("LimeSDR[%1:%2] %3").arg(i).arg("%1").arg(serial.c_str()));
QString displayedName(QString("LimeSDR[%1:$1] %2").arg(i).arg(serial.c_str()));
originDevices.append(PluginInterface::OriginDevice(
displayedName,

View File

@ -102,7 +102,7 @@ void DeviceSoapySDR::enumOriginDevices(const QString& hardwareId, PluginInterfac
for (int idev = 0; it != devicesEnumeration.end(); ++it, idev++)
{
QString displayedName(QString("SoapySDR[%1:%2] %3").arg(idev).arg("%1").arg(it->m_label));
QString displayedName(QString("SoapySDR[%1:$1] %2").arg(idev).arg(it->m_label));
QString serial(QString("%1-%2").arg(it->m_driverName).arg(it->m_sequence));
originDevices.append(PluginInterface::OriginDevice(

View File

@ -86,7 +86,7 @@ void DeviceXTRX::enumOriginDevices(const QString& hardwareId, PluginInterface::O
for (i = 0; i < res; i++)
{
DeviceXTRXParams XTRXParams;
QString displayableName(QString("XTRX[%1:%2] %3").arg(i).arg("%1").arg(devs[i].uniqname));
QString displayableName(QString("XTRX[%1:$1] %2").arg(i).arg(devs[i].uniqname));
originDevices.append(PluginInterface::OriginDevice(
displayableName,

View File

@ -76,7 +76,8 @@ PluginInterface::SamplingDevices BladeRF2OutputPlugin::enumSampleSinks(const Ori
{
for (int j = 0; j < it->nbTxStreams; j++)
{
QString displayedName(it->displayableName.arg(j));
QString displayedName = it->displayableName;
displayedName.replace(QString("$1]"), QString("%1]").arg(j));
result.append(SamplingDevice(
displayedName,
it->hardwareId,

View File

@ -80,7 +80,8 @@ PluginInterface::SamplingDevices LimeSDROutputPlugin::enumSampleSinks(const Orig
for (unsigned int j = 0; j < it->nbTxStreams; j++)
{
qDebug("LimeSDROutputPlugin::enumSampleSinks: device #%d channel %u: %s", it->sequence, j, qPrintable(it->serial));
QString displayedName(it->displayableName.arg(j));
QString displayedName = it->displayableName;
displayedName.replace(QString("$1]"), QString("%1]").arg(j));
result.append(SamplingDevice(
displayedName,
it->hardwareId,

View File

@ -80,7 +80,8 @@ PluginInterface::SamplingDevices SoapySDROutputPlugin::enumSampleSinks(const Ori
for (unsigned int ichan = 0; ichan < nbTxChannels; ichan++)
{
QString displayedName(it->displayableName.arg(ichan));
QString displayedName = it->displayableName;
displayedName.replace(QString("$1]"), QString("%1]").arg(ichan));
qDebug("SoapySDROutputPlugin::enumSampleSinks: device #%d serial %s channel %u",
it->sequence, it->serial.toStdString().c_str(), ichan);
result.append(SamplingDevice(

View File

@ -81,7 +81,8 @@ PluginInterface::SamplingDevices XTRXOutputPlugin::enumSampleSinks(const OriginD
for (unsigned int j = 0; j < it->nbTxStreams; j++)
{
qDebug("XTRXInputPlugin::enumSampleSinks: device #%d channel %u: %s", it->sequence, j, qPrintable(it->serial));
QString displayedName(it->displayableName.arg(j));
QString displayedName = it->displayableName;
displayedName.replace(QString("$1]"), QString("%1]").arg(j));
result.append(SamplingDevice(
displayedName,
it->hardwareId,

View File

@ -76,8 +76,10 @@ PluginInterface::SamplingDevices Blderf2InputPlugin::enumSampleSources(const Ori
{
for (int j=0; j < it->nbRxStreams; j++)
{
QString displayedName = it->displayableName;
displayedName.replace(QString("$1]"), QString("%1]").arg(j));
result.append(SamplingDevice(
it->displayableName,
displayedName,
m_hardwareID,
m_deviceTypeID,
it->serial,

View File

@ -80,7 +80,8 @@ PluginInterface::SamplingDevices LimeSDRInputPlugin::enumSampleSources(const Ori
for (unsigned int j = 0; j < it->nbRxStreams; j++)
{
qDebug("LimeSDRInputPlugin::enumSampleSources: device #%d channel %u: %s", it->sequence, j, qPrintable(it->serial));
QString displayedName(it->displayableName.arg(j));
QString displayedName = it->displayableName;
displayedName.replace(QString("$1]"), QString("%1]").arg(j));
result.append(SamplingDevice(
displayedName,
it->hardwareId,

View File

@ -79,7 +79,8 @@ PluginInterface::SamplingDevices SoapySDRInputPlugin::enumSampleSources(const Or
for (unsigned int ichan = 0; ichan < nbRxChannels; ichan++)
{
QString displayedName(it->displayableName.arg(ichan));
QString displayedName = it->displayableName;
displayedName.replace(QString("$1]"), QString("%1]").arg(ichan));
qDebug("SoapySDRInputPlugin::enumSampleSources: device #%d serial %s channel %u",
it->sequence, it->serial.toStdString().c_str(), ichan);
result.append(SamplingDevice(

View File

@ -83,7 +83,8 @@ PluginInterface::SamplingDevices XTRXInputPlugin::enumSampleSources(const Origin
for (unsigned int j = 0; j < it->nbRxStreams; j++)
{
qDebug("XTRXInputPlugin::enumSampleSources: device #%d channel %u: %s", it->sequence, j, qPrintable(it->serial));
QString displayedName(it->displayableName.arg(j));
QString displayedName = it->displayableName;
displayedName.replace(QString("$1]"), QString("%1]").arg(j));
result.append(SamplingDevice(
displayedName,
it->hardwareId,