1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-24 10:50:29 -05:00

SDRdaemonFEC support: correctly implement in plugin manager

This commit is contained in:
f4exb 2016-06-20 01:58:46 +02:00
parent 0812ab0d13
commit b73330c663
3 changed files with 31 additions and 3 deletions

View File

@ -25,7 +25,7 @@
#include "sdrdaemonfecgui.h"
const PluginDescriptor SDRdaemonFECPlugin::m_pluginDescriptor = {
QString("SDRdaemon input"),
QString("SDRdaemon with FEC input"),
QString("2.1.0"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
@ -57,7 +57,7 @@ PluginInterface::SampleSourceDevices SDRdaemonFECPlugin::enumSampleSources()
for(int i = 0; i < count; i++)
{
QString displayedName(QString("SDRdaemon[%1]").arg(i));
QString displayedName(QString("SDRdaemonFEC[%1]").arg(i));
result.append(SampleSourceDevice(displayedName,
m_deviceTypeID,

View File

@ -15,6 +15,7 @@
#include <QDebug>
const QString PluginManager::m_sdrDaemonDeviceTypeID = "sdrangel.samplesource.sdrdaemon";
const QString PluginManager::m_sdrDaemonFECDeviceTypeID = "sdrangel.samplesource.sdrdaemonfec";
const QString PluginManager::m_fileSourceDeviceTypeID = "sdrangel.samplesource.filesource";
PluginManager::PluginManager(MainWindow* mainWindow, QObject* parent) :
@ -91,8 +92,10 @@ void PluginManager::duplicateLocalSampleSourceDevices(uint deviceUID)
}
SampleSourceDevice *sdrDaemonSSD0 = 0;
SampleSourceDevice *sdrDaemonFECSSD0 = 0;
SampleSourceDevice *fileSourceSSD0 = 0;
bool duplicateSDRDaemon = true;
bool duplicateSDRDaemonFEC = true;
bool duplicateFileSource = true;
for(int i = 0; i < m_sampleSourceDevices.count(); ++i)
@ -106,6 +109,15 @@ void PluginManager::duplicateLocalSampleSourceDevices(uint deviceUID)
duplicateSDRDaemon = false;
}
}
else if (m_sampleSourceDevices[i].m_sourceId == m_sdrDaemonFECDeviceTypeID) // SDRdaemon with FEC
{
if (m_sampleSourceDevices[i].m_sourceSequence == 0) { // reference to device 0
sdrDaemonFECSSD0 = &m_sampleSourceDevices[i];
}
else if (m_sampleSourceDevices[i].m_sourceSequence == deviceUID) { // already there
duplicateSDRDaemonFEC = false;
}
}
else if (m_sampleSourceDevices[i].m_sourceId == m_fileSourceDeviceTypeID) // File Source
{
if (m_sampleSourceDevices[i].m_sourceSequence == 0) { // reference to device 0
@ -130,6 +142,19 @@ void PluginManager::duplicateLocalSampleSourceDevices(uint deviceUID)
);
}
if (sdrDaemonFECSSD0 && duplicateSDRDaemonFEC) // append item for a new instance
{
m_sampleSourceDevices.append(
SampleSourceDevice(
sdrDaemonFECSSD0->m_plugin,
QString("SDRdaemonFEC[%1]").arg(deviceUID),
sdrDaemonFECSSD0->m_sourceId,
sdrDaemonFECSSD0->m_sourceSerial,
deviceUID
)
);
}
if (fileSourceSSD0 && duplicateFileSource) // append item for a new instance
{
m_sampleSourceDevices.append(
@ -151,7 +176,9 @@ void PluginManager::fillSampleSourceSelector(QComboBox* comboBox, uint deviceUID
for(int i = 0; i < m_sampleSourceDevices.count(); i++)
{
// For "local" devices show only ones that concern this device set
if ((m_sampleSourceDevices[i].m_sourceId == m_sdrDaemonDeviceTypeID) || (m_sampleSourceDevices[i].m_sourceId == m_fileSourceDeviceTypeID))
if ((m_sampleSourceDevices[i].m_sourceId == m_sdrDaemonDeviceTypeID)
|| (m_sampleSourceDevices[i].m_sourceId == m_sdrDaemonFECDeviceTypeID)
|| (m_sampleSourceDevices[i].m_sourceId == m_fileSourceDeviceTypeID))
{
if (deviceUID != m_sampleSourceDevices[i].m_sourceSequence) {
continue;

View File

@ -103,6 +103,7 @@ private:
// "Local" sample source device IDs
static const QString m_sdrDaemonDeviceTypeID; //!< SDRdaemon source plugin ID
static const QString m_sdrDaemonFECDeviceTypeID; //!< SDRdaemon with FEC source plugin ID
static const QString m_fileSourceDeviceTypeID; //!< FileSource source plugin ID
// QString m_sampleSourceId;