1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-06-17 22:02:27 -04:00

Web API: implemented /sdrangel/channels: Get a list of channel plugins available in this instance

This commit is contained in:
f4exb 2017-11-23 01:19:32 +01:00
parent 41378fff04
commit 02e0945368
89 changed files with 397 additions and 198 deletions

View File

@ -29,14 +29,15 @@ MESSAGE_CLASS_DEFINITION(ChannelAnalyzer::MsgConfigureChannelAnalyzer, Message)
MESSAGE_CLASS_DEFINITION(ChannelAnalyzer::MsgConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(ChannelAnalyzer::MsgConfigureChannelizer, Message)
MESSAGE_CLASS_DEFINITION(ChannelAnalyzer::MsgReportChannelSampleRateChanged, Message) MESSAGE_CLASS_DEFINITION(ChannelAnalyzer::MsgReportChannelSampleRateChanged, Message)
const QString ChannelAnalyzer::m_channelID = "org.f4exb.sdrangelove.channel.chanalyzer"; const QString ChannelAnalyzer::m_channelIdURI = "org.f4exb.sdrangelove.channel.chanalyzer";
const QString ChannelAnalyzer::m_channelId = "ChannelAnalyzer";
ChannelAnalyzer::ChannelAnalyzer(DeviceSourceAPI *deviceAPI) : ChannelAnalyzer::ChannelAnalyzer(DeviceSourceAPI *deviceAPI) :
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_sampleSink(0), m_sampleSink(0),
m_settingsMutex(QMutex::Recursive) m_settingsMutex(QMutex::Recursive)
{ {
setObjectName("ChannelAnalyzer"); setObjectName(m_channelId);
m_Bandwidth = 5000; m_Bandwidth = 5000;
m_LowCutoff = 300; m_LowCutoff = 300;

View File

@ -129,7 +129,8 @@ public:
virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = objectName(); } virtual void getTitle(QString& title) { title = objectName(); }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
private slots: private slots:
void channelSampleRateChanged(); void channelSampleRateChanged();

View File

@ -367,7 +367,7 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *device
m_channelMarker.setVisible(true); // activate signal on the last setting only m_channelMarker.setVisible(true); // activate signal on the last setting only
setTitleColor(m_channelMarker.getColor()); setTitleColor(m_channelMarker.getColor());
m_deviceUISet->registerRxChannelInstance(ChannelAnalyzer::m_channelID, this); m_deviceUISet->registerRxChannelInstance(ChannelAnalyzer::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -8,7 +8,7 @@
const PluginDescriptor ChannelAnalyzerPlugin::m_pluginDescriptor = { const PluginDescriptor ChannelAnalyzerPlugin::m_pluginDescriptor = {
QString("Channel Analyzer"), QString("Channel Analyzer"),
QString("3.8.4"), QString("3.8.5"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,
@ -31,12 +31,12 @@ void ChannelAnalyzerPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register demodulator // register demodulator
m_pluginAPI->registerRxChannel(ChannelAnalyzer::m_channelID, this); m_pluginAPI->registerRxChannel(ChannelAnalyzer::m_channelIdURI, ChannelAnalyzer::m_channelId, this);
} }
PluginInstanceGUI* ChannelAnalyzerPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) PluginInstanceGUI* ChannelAnalyzerPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{ {
if(channelName == ChannelAnalyzer::m_channelID) if(channelName == ChannelAnalyzer::m_channelIdURI)
{ {
ChannelAnalyzerGUI* gui = ChannelAnalyzerGUI::create(m_pluginAPI, deviceUISet, rxChannel); ChannelAnalyzerGUI* gui = ChannelAnalyzerGUI::create(m_pluginAPI, deviceUISet, rxChannel);
return gui; return gui;
@ -48,7 +48,7 @@ PluginInstanceGUI* ChannelAnalyzerPlugin::createRxChannelGUI(const QString& chan
BasebandSampleSink* ChannelAnalyzerPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI) BasebandSampleSink* ChannelAnalyzerPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI)
{ {
if(channelName == ChannelAnalyzer::m_channelID) if(channelName == ChannelAnalyzer::m_channelIdURI)
{ {
ChannelAnalyzer* sink = new ChannelAnalyzer(deviceAPI); ChannelAnalyzer* sink = new ChannelAnalyzer(deviceAPI);
return sink; return sink;

View File

@ -29,14 +29,15 @@ MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgConfigureChannelAnalyzer, Message
MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgConfigureChannelizer, Message)
MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgReportChannelSampleRateChanged, Message) MESSAGE_CLASS_DEFINITION(ChannelAnalyzerNG::MsgReportChannelSampleRateChanged, Message)
const QString ChannelAnalyzerNG::m_channelID = "sdrangel.channel.chanalyzerng"; const QString ChannelAnalyzerNG::m_channelIdURI = "sdrangel.channel.chanalyzerng";
const QString ChannelAnalyzerNG::m_channelId = "ChannelAnalyzerNG";
ChannelAnalyzerNG::ChannelAnalyzerNG(DeviceSourceAPI *deviceAPI) : ChannelAnalyzerNG::ChannelAnalyzerNG(DeviceSourceAPI *deviceAPI) :
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_sampleSink(0), m_sampleSink(0),
m_settingsMutex(QMutex::Recursive) m_settingsMutex(QMutex::Recursive)
{ {
setObjectName("ChannelAnalyzerNG"); setObjectName(m_channelId);
m_undersampleCount = 0; m_undersampleCount = 0;
m_sum = 0; m_sum = 0;

View File

@ -148,7 +148,8 @@ public:
virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = objectName(); } virtual void getTitle(QString& title) { title = objectName(); }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
private: private:

View File

@ -430,7 +430,7 @@ ChannelAnalyzerNGGUI::ChannelAnalyzerNGGUI(PluginAPI* pluginAPI, DeviceUISet *de
m_channelMarker.setVisible(true); // activate signal on the last setting only m_channelMarker.setVisible(true); // activate signal on the last setting only
setTitleColor(m_channelMarker.getColor()); setTitleColor(m_channelMarker.getColor());
m_deviceUISet->registerRxChannelInstance(ChannelAnalyzerNG::m_channelID, this); m_deviceUISet->registerRxChannelInstance(ChannelAnalyzerNG::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -23,7 +23,7 @@
const PluginDescriptor ChannelAnalyzerNGPlugin::m_pluginDescriptor = { const PluginDescriptor ChannelAnalyzerNGPlugin::m_pluginDescriptor = {
QString("Channel Analyzer NG"), QString("Channel Analyzer NG"),
QString("3.8.4"), QString("3.8.5"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,
@ -46,12 +46,12 @@ void ChannelAnalyzerNGPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register demodulator // register demodulator
m_pluginAPI->registerRxChannel(ChannelAnalyzerNG::m_channelID, this); m_pluginAPI->registerRxChannel(ChannelAnalyzerNG::m_channelIdURI, ChannelAnalyzerNG::m_channelId, this);
} }
PluginInstanceGUI* ChannelAnalyzerNGPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) PluginInstanceGUI* ChannelAnalyzerNGPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{ {
if(channelName == ChannelAnalyzerNG::m_channelID) if(channelName == ChannelAnalyzerNG::m_channelIdURI)
{ {
ChannelAnalyzerNGGUI* gui = ChannelAnalyzerNGGUI::create(m_pluginAPI, deviceUISet, rxChannel); ChannelAnalyzerNGGUI* gui = ChannelAnalyzerNGGUI::create(m_pluginAPI, deviceUISet, rxChannel);
return gui; return gui;
@ -62,7 +62,7 @@ PluginInstanceGUI* ChannelAnalyzerNGPlugin::createRxChannelGUI(const QString& ch
BasebandSampleSink* ChannelAnalyzerNGPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI) BasebandSampleSink* ChannelAnalyzerNGPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI)
{ {
if(channelName == ChannelAnalyzerNG::m_channelID) if(channelName == ChannelAnalyzerNG::m_channelIdURI)
{ {
ChannelAnalyzerNG* sink = new ChannelAnalyzerNG(deviceAPI); ChannelAnalyzerNG* sink = new ChannelAnalyzerNG(deviceAPI);
return sink; return sink;

View File

@ -32,7 +32,8 @@
MESSAGE_CLASS_DEFINITION(AMDemod::MsgConfigureAMDemod, Message) MESSAGE_CLASS_DEFINITION(AMDemod::MsgConfigureAMDemod, Message)
MESSAGE_CLASS_DEFINITION(AMDemod::MsgConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(AMDemod::MsgConfigureChannelizer, Message)
const QString AMDemod::m_channelID = "de.maintech.sdrangelove.channel.am"; const QString AMDemod::m_channelIdURI = "de.maintech.sdrangelove.channel.am";
const QString AMDemod::m_channelId = "AMDemod";
const int AMDemod::m_udpBlockSize = 512; const int AMDemod::m_udpBlockSize = 512;
AMDemod::AMDemod(DeviceSourceAPI *deviceAPI) : AMDemod::AMDemod(DeviceSourceAPI *deviceAPI) :
@ -47,7 +48,7 @@ AMDemod::AMDemod(DeviceSourceAPI *deviceAPI) :
m_audioFifo(48000), m_audioFifo(48000),
m_settingsMutex(QMutex::Recursive) m_settingsMutex(QMutex::Recursive)
{ {
setObjectName("AMDemod"); setObjectName(m_channelId);
m_audioBuffer.resize(1<<14); m_audioBuffer.resize(1<<14);
m_audioBufferFill = 0; m_audioBufferFill = 0;

View File

@ -109,7 +109,8 @@ public:
m_magsqCount = 0; m_magsqCount = 0;
} }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
private: private:
enum RateState { enum RateState {

View File

@ -217,7 +217,7 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS
setTitleColor(m_channelMarker.getColor()); setTitleColor(m_channelMarker.getColor());
m_settings.setChannelMarker(&m_channelMarker); m_settings.setChannelMarker(&m_channelMarker);
m_deviceUISet->registerRxChannelInstance(AMDemod::m_channelID, this); m_deviceUISet->registerRxChannelInstance(AMDemod::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -8,7 +8,7 @@
const PluginDescriptor AMDemodPlugin::m_pluginDescriptor = { const PluginDescriptor AMDemodPlugin::m_pluginDescriptor = {
QString("AM Demodulator"), QString("AM Demodulator"),
QString("3.8.4"), QString("3.8.5"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,
@ -31,12 +31,12 @@ void AMDemodPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register AM demodulator // register AM demodulator
m_pluginAPI->registerRxChannel(AMDemod::m_channelID, this); m_pluginAPI->registerRxChannel(AMDemod::m_channelIdURI, AMDemod::m_channelId, this);
} }
PluginInstanceGUI* AMDemodPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) PluginInstanceGUI* AMDemodPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{ {
if(channelName == AMDemod::m_channelID) if(channelName == AMDemod::m_channelIdURI)
{ {
AMDemodGUI* gui = AMDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel); AMDemodGUI* gui = AMDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel);
return gui; return gui;
@ -47,7 +47,7 @@ PluginInstanceGUI* AMDemodPlugin::createRxChannelGUI(const QString& channelName,
BasebandSampleSink* AMDemodPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI) BasebandSampleSink* AMDemodPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI)
{ {
if(channelName == AMDemod::m_channelID) if(channelName == AMDemod::m_channelIdURI)
{ {
AMDemod* sink = new AMDemod(deviceAPI); AMDemod* sink = new AMDemod(deviceAPI);
return sink; return sink;

View File

@ -35,7 +35,8 @@ MESSAGE_CLASS_DEFINITION(ATVDemod::MsgReportEffectiveSampleRate, Message)
MESSAGE_CLASS_DEFINITION(ATVDemod::MsgConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(ATVDemod::MsgConfigureChannelizer, Message)
MESSAGE_CLASS_DEFINITION(ATVDemod::MsgReportChannelSampleRateChanged, Message) MESSAGE_CLASS_DEFINITION(ATVDemod::MsgReportChannelSampleRateChanged, Message)
const QString ATVDemod::m_channelID = "sdrangel.channel.demodatv"; const QString ATVDemod::m_channelIdURI = "sdrangel.channel.demodatv";
const QString ATVDemod::m_channelId = "ATVDemod";
const int ATVDemod::m_ssbFftLen = 1024; const int ATVDemod::m_ssbFftLen = 1024;
ATVDemod::ATVDemod(DeviceSourceAPI *deviceAPI) : ATVDemod::ATVDemod(DeviceSourceAPI *deviceAPI) :
@ -68,7 +69,7 @@ ATVDemod::ATVDemod(DeviceSourceAPI *deviceAPI) :
m_DSBFilterBufferIndex(0), m_DSBFilterBufferIndex(0),
m_objSettingsMutex(QMutex::Recursive) m_objSettingsMutex(QMutex::Recursive)
{ {
setObjectName("ATVDemod"); setObjectName(m_channelId);
//*************** ATV PARAMETERS *************** //*************** ATV PARAMETERS ***************
//m_intNumberSamplePerLine=0; //m_intNumberSamplePerLine=0;

View File

@ -233,7 +233,8 @@ public:
double getMagSq() const { return m_objMagSqAverage.average(); } //!< Beware this is scaled to 2^30 double getMagSq() const { return m_objMagSqAverage.average(); } //!< Beware this is scaled to 2^30
bool getBFOLocked(); bool getBFOLocked();
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
private slots: private slots:
void channelSampleRateChanged(); void channelSampleRateChanged();

View File

@ -304,7 +304,7 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Base
setTitleColor(m_channelMarker.getColor()); setTitleColor(m_channelMarker.getColor());
m_deviceUISet->registerRxChannelInstance(ATVDemod::m_channelID, this); m_deviceUISet->registerRxChannelInstance(ATVDemod::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -27,7 +27,7 @@
const PluginDescriptor ATVDemodPlugin::m_ptrPluginDescriptor = const PluginDescriptor ATVDemodPlugin::m_ptrPluginDescriptor =
{ {
QString("ATV Demodulator"), QString("ATV Demodulator"),
QString("3.8.4"), QString("3.8.5"),
QString("(c) F4HKW for F4EXB / SDRAngel"), QString("(c) F4HKW for F4EXB / SDRAngel"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,
@ -51,12 +51,12 @@ void ATVDemodPlugin::initPlugin(PluginAPI* ptrPluginAPI)
m_ptrPluginAPI = ptrPluginAPI; m_ptrPluginAPI = ptrPluginAPI;
// register ATV demodulator // register ATV demodulator
m_ptrPluginAPI->registerRxChannel(ATVDemod::m_channelID, this); m_ptrPluginAPI->registerRxChannel(ATVDemod::m_channelIdURI, ATVDemod::m_channelId, this);
} }
PluginInstanceGUI* ATVDemodPlugin::createRxChannelGUI(const QString& strChannelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) PluginInstanceGUI* ATVDemodPlugin::createRxChannelGUI(const QString& strChannelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{ {
if(strChannelName == ATVDemod::m_channelID) if(strChannelName == ATVDemod::m_channelIdURI)
{ {
ATVDemodGUI* ptrGui = ATVDemodGUI::create(m_ptrPluginAPI, deviceUISet, rxChannel); ATVDemodGUI* ptrGui = ATVDemodGUI::create(m_ptrPluginAPI, deviceUISet, rxChannel);
return ptrGui; return ptrGui;
@ -69,7 +69,7 @@ PluginInstanceGUI* ATVDemodPlugin::createRxChannelGUI(const QString& strChannelN
BasebandSampleSink* ATVDemodPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI) BasebandSampleSink* ATVDemodPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI)
{ {
if(channelName == ATVDemod::m_channelID) if(channelName == ATVDemod::m_channelIdURI)
{ {
ATVDemod* sink = new ATVDemod(deviceAPI); ATVDemod* sink = new ATVDemod(deviceAPI);
return sink; return sink;

View File

@ -34,7 +34,8 @@ MESSAGE_CLASS_DEFINITION(BFMDemod::MsgConfigureChannelizer, Message)
MESSAGE_CLASS_DEFINITION(BFMDemod::MsgReportChannelSampleRateChanged, Message) MESSAGE_CLASS_DEFINITION(BFMDemod::MsgReportChannelSampleRateChanged, Message)
MESSAGE_CLASS_DEFINITION(BFMDemod::MsgConfigureBFMDemod, Message) MESSAGE_CLASS_DEFINITION(BFMDemod::MsgConfigureBFMDemod, Message)
const QString BFMDemod::m_channelID = "sdrangel.channel.bfm"; const QString BFMDemod::m_channelIdURI = "sdrangel.channel.bfm";
const QString BFMDemod::m_channelId = "BFMDemod";
const Real BFMDemod::default_deemphasis = 50.0; // 50 us const Real BFMDemod::default_deemphasis = 50.0; // 50 us
const int BFMDemod::m_udpBlockSize = 512; const int BFMDemod::m_udpBlockSize = 512;
@ -48,7 +49,7 @@ BFMDemod::BFMDemod(DeviceSourceAPI *deviceAPI) :
m_deemphasisFilterY(default_deemphasis * 48000 * 1.0e-6), m_deemphasisFilterY(default_deemphasis * 48000 * 1.0e-6),
m_fmExcursion(default_excursion) m_fmExcursion(default_excursion)
{ {
setObjectName("BFMDemod"); setObjectName(m_channelId);
m_magsq = 0.0f; m_magsq = 0.0f;
m_magsqSum = 0.0f; m_magsqSum = 0.0f;

View File

@ -150,7 +150,8 @@ public:
RDSParser& getRDSParser() { return m_rdsParser; } RDSParser& getRDSParser() { return m_rdsParser; }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
private: private:
enum RateState { enum RateState {

View File

@ -372,7 +372,7 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_settings.setChannelMarker(&m_channelMarker); m_settings.setChannelMarker(&m_channelMarker);
m_settings.setSpectrumGUI(ui->spectrumGUI); m_settings.setSpectrumGUI(ui->spectrumGUI);
m_deviceUISet->registerRxChannelInstance(BFMDemod::m_channelID, this); m_deviceUISet->registerRxChannelInstance(BFMDemod::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -25,7 +25,7 @@
const PluginDescriptor BFMPlugin::m_pluginDescriptor = { const PluginDescriptor BFMPlugin::m_pluginDescriptor = {
QString("Broadcast FM Demodulator"), QString("Broadcast FM Demodulator"),
QString("3.8.4"), QString("3.8.5"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,
@ -48,12 +48,12 @@ void BFMPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register BFM demodulator // register BFM demodulator
m_pluginAPI->registerRxChannel(BFMDemod::m_channelID, this); m_pluginAPI->registerRxChannel(BFMDemod::m_channelIdURI, BFMDemod::m_channelId, this);
} }
PluginInstanceGUI* BFMPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) PluginInstanceGUI* BFMPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{ {
if(channelName == BFMDemod::m_channelID) if(channelName == BFMDemod::m_channelIdURI)
{ {
BFMDemodGUI* gui = BFMDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel); BFMDemodGUI* gui = BFMDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel);
return gui; return gui;
@ -65,7 +65,7 @@ PluginInstanceGUI* BFMPlugin::createRxChannelGUI(const QString& channelName, Dev
BasebandSampleSink* BFMPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI) BasebandSampleSink* BFMPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI)
{ {
if(channelName == BFMDemod::m_channelID) if(channelName == BFMDemod::m_channelIdURI)
{ {
BFMDemod* sink = new BFMDemod(deviceAPI); BFMDemod* sink = new BFMDemod(deviceAPI);
return sink; return sink;

View File

@ -35,7 +35,8 @@ MESSAGE_CLASS_DEFINITION(DSDDemod::MsgConfigureChannelizer, Message)
MESSAGE_CLASS_DEFINITION(DSDDemod::MsgConfigureDSDDemod, Message) MESSAGE_CLASS_DEFINITION(DSDDemod::MsgConfigureDSDDemod, Message)
MESSAGE_CLASS_DEFINITION(DSDDemod::MsgConfigureMyPosition, Message) MESSAGE_CLASS_DEFINITION(DSDDemod::MsgConfigureMyPosition, Message)
const QString DSDDemod::m_channelID = "sdrangel.channel.dsddemod"; const QString DSDDemod::m_channelIdURI = "sdrangel.channel.dsddemod";
const QString DSDDemod::m_channelId = "DSDDemod";
const int DSDDemod::m_udpBlockSize = 512; const int DSDDemod::m_udpBlockSize = 512;
DSDDemod::DSDDemod(DeviceSourceAPI *deviceAPI) : DSDDemod::DSDDemod(DeviceSourceAPI *deviceAPI) :
@ -57,7 +58,7 @@ DSDDemod::DSDDemod(DeviceSourceAPI *deviceAPI) :
m_dsdDecoder(), m_dsdDecoder(),
m_settingsMutex(QMutex::Recursive) m_settingsMutex(QMutex::Recursive)
{ {
setObjectName("DSDDemod"); setObjectName(m_channelId);
m_audioBuffer.resize(1<<14); m_audioBuffer.resize(1<<14);
m_audioBufferFill = 0; m_audioBufferFill = 0;

View File

@ -121,7 +121,8 @@ public:
m_magsqCount = 0; m_magsqCount = 0;
} }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
private: private:
class MsgConfigureMyPosition : public Message { class MsgConfigureMyPosition : public Message {

View File

@ -292,7 +292,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
m_channelMarker.setVisible(true); // activate signal on the last setting only m_channelMarker.setVisible(true); // activate signal on the last setting only
m_deviceUISet->registerRxChannelInstance(DSDDemod::m_channelID, this); m_deviceUISet->registerRxChannelInstance(DSDDemod::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -25,7 +25,7 @@
const PluginDescriptor DSDDemodPlugin::m_pluginDescriptor = { const PluginDescriptor DSDDemodPlugin::m_pluginDescriptor = {
QString("DSD Demodulator"), QString("DSD Demodulator"),
QString("3.8.4"), QString("3.8.5"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,
@ -48,12 +48,12 @@ void DSDDemodPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register DSD demodulator // register DSD demodulator
m_pluginAPI->registerRxChannel(DSDDemod::m_channelID, this); m_pluginAPI->registerRxChannel(DSDDemod::m_channelIdURI, DSDDemod::m_channelId, this);
} }
PluginInstanceGUI* DSDDemodPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) PluginInstanceGUI* DSDDemodPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{ {
if(channelName == DSDDemod::m_channelID) if(channelName == DSDDemod::m_channelIdURI)
{ {
DSDDemodGUI* gui = DSDDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel); DSDDemodGUI* gui = DSDDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel);
return gui; return gui;
@ -64,7 +64,7 @@ PluginInstanceGUI* DSDDemodPlugin::createRxChannelGUI(const QString& channelName
BasebandSampleSink* DSDDemodPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI) BasebandSampleSink* DSDDemodPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI)
{ {
if(channelName == DSDDemod::m_channelID) if(channelName == DSDDemod::m_channelIdURI)
{ {
DSDDemod* sink = new DSDDemod(deviceAPI); DSDDemod* sink = new DSDDemod(deviceAPI);
return sink; return sink;

View File

@ -31,14 +31,15 @@
MESSAGE_CLASS_DEFINITION(LoRaDemod::MsgConfigureLoRaDemod, Message) MESSAGE_CLASS_DEFINITION(LoRaDemod::MsgConfigureLoRaDemod, Message)
MESSAGE_CLASS_DEFINITION(LoRaDemod::MsgConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(LoRaDemod::MsgConfigureChannelizer, Message)
const QString LoRaDemod::m_channelID = "de.maintech.sdrangelove.channel.lora"; const QString LoRaDemod::m_channelIdURI = "de.maintech.sdrangelove.channel.lora";
const QString LoRaDemod::m_channelId = "LoRaDemod";
LoRaDemod::LoRaDemod(DeviceSourceAPI* deviceAPI) : LoRaDemod::LoRaDemod(DeviceSourceAPI* deviceAPI) :
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_sampleSink(0), m_sampleSink(0),
m_settingsMutex(QMutex::Recursive) m_settingsMutex(QMutex::Recursive)
{ {
setObjectName("LoRaDemod"); setObjectName(m_channelId);
m_Bandwidth = LoRaDemodSettings::bandwidths[0]; m_Bandwidth = LoRaDemodSettings::bandwidths[0];
m_sampleRate = 96000; m_sampleRate = 96000;

View File

@ -101,7 +101,8 @@ public:
virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual void getTitle(QString& title) { title = m_settings.m_title; }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
private: private:
int detect(Complex sample, Complex angle); int detect(Complex sample, Complex angle);

View File

@ -131,7 +131,7 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(viewChanged())); connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(viewChanged()));
m_deviceUISet->registerRxChannelInstance(LoRaDemod::m_channelID, this); m_deviceUISet->registerRxChannelInstance(LoRaDemod::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -7,7 +7,7 @@
const PluginDescriptor LoRaPlugin::m_pluginDescriptor = { const PluginDescriptor LoRaPlugin::m_pluginDescriptor = {
QString("LoRa Demodulator"), QString("LoRa Demodulator"),
QString("3.8.4"), QString("3.8.5"),
QString("(c) 2015 John Greb"), QString("(c) 2015 John Greb"),
QString("http://www.maintech.de"), QString("http://www.maintech.de"),
true, true,
@ -30,12 +30,12 @@ void LoRaPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register demodulator // register demodulator
m_pluginAPI->registerRxChannel(LoRaDemod::m_channelID, this); m_pluginAPI->registerRxChannel(LoRaDemod::m_channelIdURI, LoRaDemod::m_channelId, this);
} }
PluginInstanceGUI* LoRaPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) PluginInstanceGUI* LoRaPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{ {
if(channelName == LoRaDemod::m_channelID) if(channelName == LoRaDemod::m_channelIdURI)
{ {
LoRaDemodGUI* gui = LoRaDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel); LoRaDemodGUI* gui = LoRaDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel);
return gui; return gui;
@ -46,7 +46,7 @@ PluginInstanceGUI* LoRaPlugin::createRxChannelGUI(const QString& channelName, De
BasebandSampleSink* LoRaPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI) BasebandSampleSink* LoRaPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI)
{ {
if(channelName == LoRaDemod::m_channelID) if(channelName == LoRaDemod::m_channelIdURI)
{ {
LoRaDemod* sink = new LoRaDemod(deviceAPI); LoRaDemod* sink = new LoRaDemod(deviceAPI);
return sink; return sink;

View File

@ -35,7 +35,8 @@ MESSAGE_CLASS_DEFINITION(NFMDemod::MsgConfigureNFMDemod, Message)
MESSAGE_CLASS_DEFINITION(NFMDemod::MsgConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(NFMDemod::MsgConfigureChannelizer, Message)
MESSAGE_CLASS_DEFINITION(NFMDemod::MsgReportCTCSSFreq, Message) MESSAGE_CLASS_DEFINITION(NFMDemod::MsgReportCTCSSFreq, Message)
const QString NFMDemod::m_channelID = "de.maintech.sdrangelove.channel.nfm"; const QString NFMDemod::m_channelIdURI = "de.maintech.sdrangelove.channel.nfm";
const QString NFMDemod::m_channelId = "NFMDemod";
static const double afSqTones[2] = {1000.0, 6000.0}; // {1200.0, 8000.0}; static const double afSqTones[2] = {1000.0, 6000.0}; // {1200.0, 8000.0};
const int NFMDemod::m_udpBlockSize = 512; const int NFMDemod::m_udpBlockSize = 512;
@ -61,7 +62,7 @@ NFMDemod::NFMDemod(DeviceSourceAPI *devieAPI) :
m_audioFifo(48000), m_audioFifo(48000),
m_settingsMutex(QMutex::Recursive) m_settingsMutex(QMutex::Recursive)
{ {
setObjectName("NFMDemod"); setObjectName(m_channelId);
m_audioBuffer.resize(1<<14); m_audioBuffer.resize(1<<14);
m_audioBufferFill = 0; m_audioBufferFill = 0;

View File

@ -144,7 +144,8 @@ public:
m_magsqCount = 0; m_magsqCount = 0;
} }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
private: private:
enum RateState { enum RateState {

View File

@ -294,7 +294,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_settings.setChannelMarker(&m_channelMarker); m_settings.setChannelMarker(&m_channelMarker);
m_deviceUISet->registerRxChannelInstance(NFMDemod::m_channelID, this); m_deviceUISet->registerRxChannelInstance(NFMDemod::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -7,7 +7,7 @@
const PluginDescriptor NFMPlugin::m_pluginDescriptor = { const PluginDescriptor NFMPlugin::m_pluginDescriptor = {
QString("NFM Demodulator"), QString("NFM Demodulator"),
QString("3.8.4"), QString("3.8.5"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,
@ -30,12 +30,12 @@ void NFMPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register NFM demodulator // register NFM demodulator
m_pluginAPI->registerRxChannel(NFMDemod::m_channelID, this); m_pluginAPI->registerRxChannel(NFMDemod::m_channelIdURI, NFMDemod::m_channelId, this);
} }
PluginInstanceGUI* NFMPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) PluginInstanceGUI* NFMPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{ {
if(channelName == NFMDemod::m_channelID) { if(channelName == NFMDemod::m_channelIdURI) {
NFMDemodGUI* gui = NFMDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel); NFMDemodGUI* gui = NFMDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel);
return gui; return gui;
} else { } else {
@ -45,7 +45,7 @@ PluginInstanceGUI* NFMPlugin::createRxChannelGUI(const QString& channelName, Dev
BasebandSampleSink* NFMPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI) BasebandSampleSink* NFMPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI)
{ {
if(channelName == NFMDemod::m_channelID) if(channelName == NFMDemod::m_channelIdURI)
{ {
NFMDemod* sink = new NFMDemod(deviceAPI); NFMDemod* sink = new NFMDemod(deviceAPI);
return sink; return sink;

View File

@ -34,7 +34,8 @@ MESSAGE_CLASS_DEFINITION(SSBDemod::MsgConfigureSSBDemod, Message)
MESSAGE_CLASS_DEFINITION(SSBDemod::MsgConfigureSSBDemodPrivate, Message) MESSAGE_CLASS_DEFINITION(SSBDemod::MsgConfigureSSBDemodPrivate, Message)
MESSAGE_CLASS_DEFINITION(SSBDemod::MsgConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(SSBDemod::MsgConfigureChannelizer, Message)
const QString SSBDemod::m_channelID = "de.maintech.sdrangelove.channel.ssb"; const QString SSBDemod::m_channelIdURI = "de.maintech.sdrangelove.channel.ssb";
const QString SSBDemod::m_channelId = "SSBDemod";
const int SSBDemod::m_udpBlockSize = 512; const int SSBDemod::m_udpBlockSize = 512;
SSBDemod::SSBDemod(DeviceSourceAPI *deviceAPI) : SSBDemod::SSBDemod(DeviceSourceAPI *deviceAPI) :
@ -54,7 +55,7 @@ SSBDemod::SSBDemod(DeviceSourceAPI *deviceAPI) :
m_audioFifo(24000), m_audioFifo(24000),
m_settingsMutex(QMutex::Recursive) m_settingsMutex(QMutex::Recursive)
{ {
setObjectName("SSBDemod"); setObjectName(m_channelId);
m_Bandwidth = 5000; m_Bandwidth = 5000;
m_LowCutoff = 300; m_LowCutoff = 300;

View File

@ -129,7 +129,8 @@ public:
m_magsqCount = 0; m_magsqCount = 0;
} }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
private: private:
class MsgConfigureSSBDemodPrivate : public Message { class MsgConfigureSSBDemodPrivate : public Message {

View File

@ -278,7 +278,7 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_settings.setChannelMarker(&m_channelMarker); m_settings.setChannelMarker(&m_channelMarker);
m_settings.setSpectrumGUI(ui->spectrumGUI); m_settings.setSpectrumGUI(ui->spectrumGUI);
m_deviceUISet->registerRxChannelInstance(SSBDemod::m_channelID, this); m_deviceUISet->registerRxChannelInstance(SSBDemod::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -31,12 +31,12 @@ void SSBPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register demodulator // register demodulator
m_pluginAPI->registerRxChannel(SSBDemod::m_channelID, this); m_pluginAPI->registerRxChannel(SSBDemod::m_channelIdURI, SSBDemod::m_channelId, this);
} }
PluginInstanceGUI* SSBPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) PluginInstanceGUI* SSBPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{ {
if(channelName == SSBDemod::m_channelID) if(channelName == SSBDemod::m_channelIdURI)
{ {
SSBDemodGUI* gui = SSBDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel); SSBDemodGUI* gui = SSBDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel);
return gui; return gui;
@ -47,7 +47,7 @@ PluginInstanceGUI* SSBPlugin::createRxChannelGUI(const QString& channelName, Dev
BasebandSampleSink* SSBPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI) BasebandSampleSink* SSBPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI)
{ {
if(channelName == SSBDemod::m_channelID) if(channelName == SSBDemod::m_channelIdURI)
{ {
SSBDemod* sink = new SSBDemod(deviceAPI); SSBDemod* sink = new SSBDemod(deviceAPI);
return sink; return sink;

View File

@ -33,7 +33,8 @@
MESSAGE_CLASS_DEFINITION(WFMDemod::MsgConfigureWFMDemod, Message) MESSAGE_CLASS_DEFINITION(WFMDemod::MsgConfigureWFMDemod, Message)
MESSAGE_CLASS_DEFINITION(WFMDemod::MsgConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(WFMDemod::MsgConfigureChannelizer, Message)
const QString WFMDemod::m_channelID = "de.maintech.sdrangelove.channel.wfm"; const QString WFMDemod::m_channelIdURI = "de.maintech.sdrangelove.channel.wfm";
const QString WFMDemod::m_channelId = "WFMDemod";
const int WFMDemod::m_udpBlockSize = 512; const int WFMDemod::m_udpBlockSize = 512;
WFMDemod::WFMDemod(DeviceSourceAPI* deviceAPI) : WFMDemod::WFMDemod(DeviceSourceAPI* deviceAPI) :
@ -50,7 +51,7 @@ WFMDemod::WFMDemod(DeviceSourceAPI* deviceAPI) :
m_settingsMutex(QMutex::Recursive) m_settingsMutex(QMutex::Recursive)
{ {
setObjectName("WFMDemod"); setObjectName(m_channelId);
m_rfFilter = new fftfilt(-50000.0 / 384000.0, 50000.0 / 384000.0, rfFilterFftLength); m_rfFilter = new fftfilt(-50000.0 / 384000.0, 50000.0 / 384000.0, rfFilterFftLength);
m_phaseDiscri.setFMScaling(384000/75000); m_phaseDiscri.setFMScaling(384000/75000);

View File

@ -115,7 +115,8 @@ public:
m_magsqCount = 0; m_magsqCount = 0;
} }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
private: private:
enum RateState { enum RateState {

View File

@ -204,7 +204,7 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
setTitleColor(m_channelMarker.getColor()); setTitleColor(m_channelMarker.getColor());
m_settings.setChannelMarker(&m_channelMarker); m_settings.setChannelMarker(&m_channelMarker);
m_deviceUISet->registerRxChannelInstance(WFMDemod::m_channelID, this); m_deviceUISet->registerRxChannelInstance(WFMDemod::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -31,12 +31,12 @@ void WFMPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register WFM demodulator // register WFM demodulator
m_pluginAPI->registerRxChannel(WFMDemod::m_channelID, this); m_pluginAPI->registerRxChannel(WFMDemod::m_channelIdURI, WFMDemod::m_channelId, this);
} }
PluginInstanceGUI* WFMPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) PluginInstanceGUI* WFMPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{ {
if(channelName == WFMDemod::m_channelID) if(channelName == WFMDemod::m_channelIdURI)
{ {
WFMDemodGUI* gui = WFMDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel); WFMDemodGUI* gui = WFMDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel);
return gui; return gui;
@ -47,7 +47,7 @@ PluginInstanceGUI* WFMPlugin::createRxChannelGUI(const QString& channelName, Dev
BasebandSampleSink* WFMPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI) BasebandSampleSink* WFMPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI)
{ {
if(channelName == WFMDemod::m_channelID) if(channelName == WFMDemod::m_channelIdURI)
{ {
WFMDemod* sink = new WFMDemod(deviceAPI); WFMDemod* sink = new WFMDemod(deviceAPI);
return sink; return sink;

View File

@ -30,14 +30,15 @@ MESSAGE_CLASS_DEFINITION(TCPSrc::MsgConfigureChannelizer, Message)
MESSAGE_CLASS_DEFINITION(TCPSrc::MsgTCPSrcConnection, Message) MESSAGE_CLASS_DEFINITION(TCPSrc::MsgTCPSrcConnection, Message)
MESSAGE_CLASS_DEFINITION(TCPSrc::MsgTCPSrcSpectrum, Message) MESSAGE_CLASS_DEFINITION(TCPSrc::MsgTCPSrcSpectrum, Message)
const QString TCPSrc::m_channelID = "sdrangel.channel.tcpsrc"; const QString TCPSrc::m_channelIdURI = "sdrangel.channel.tcpsrc";
const QString TCPSrc::m_channelId = "TCPSrc";
TCPSrc::TCPSrc(DeviceSourceAPI* deviceAPI) : TCPSrc::TCPSrc(DeviceSourceAPI* deviceAPI) :
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_absoluteFrequencyOffset(0), m_absoluteFrequencyOffset(0),
m_settingsMutex(QMutex::Recursive) m_settingsMutex(QMutex::Recursive)
{ {
setObjectName("TCPSrc"); setObjectName(m_channelId);
m_inputSampleRate = 96000; m_inputSampleRate = 96000;
m_sampleFormat = TCPSrcSettings::FormatSSB; m_sampleFormat = TCPSrcSettings::FormatSSB;

View File

@ -118,7 +118,8 @@ public:
virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual void getTitle(QString& title) { title = m_settings.m_title; }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
protected: protected:
class MsgTCPSrcSpectrum : public Message { class MsgTCPSrcSpectrum : public Message {

View File

@ -158,7 +158,7 @@ TCPSrcGUI::TCPSrcGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
setTitleColor(m_channelMarker.getColor()); setTitleColor(m_channelMarker.getColor());
m_deviceUISet->registerRxChannelInstance(TCPSrc::m_channelID, this); m_deviceUISet->registerRxChannelInstance(TCPSrc::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -8,7 +8,7 @@
const PluginDescriptor TCPSrcPlugin::m_pluginDescriptor = { const PluginDescriptor TCPSrcPlugin::m_pluginDescriptor = {
QString("TCP Channel Source"), QString("TCP Channel Source"),
QString("3.8.3"), QString("3.8.5"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,
@ -31,12 +31,12 @@ void TCPSrcPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register TCP Channel Source // register TCP Channel Source
m_pluginAPI->registerRxChannel(TCPSrc::m_channelID, this); m_pluginAPI->registerRxChannel(TCPSrc::m_channelIdURI, TCPSrc::m_channelId, this);
} }
PluginInstanceGUI* TCPSrcPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) PluginInstanceGUI* TCPSrcPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{ {
if(channelName == TCPSrc::m_channelID) if(channelName == TCPSrc::m_channelIdURI)
{ {
TCPSrcGUI* gui = TCPSrcGUI::create(m_pluginAPI, deviceUISet, rxChannel); TCPSrcGUI* gui = TCPSrcGUI::create(m_pluginAPI, deviceUISet, rxChannel);
// deviceAPI->registerChannelInstance("sdrangel.channel.tcpsrc", gui); // deviceAPI->registerChannelInstance("sdrangel.channel.tcpsrc", gui);
@ -49,7 +49,7 @@ PluginInstanceGUI* TCPSrcPlugin::createRxChannelGUI(const QString& channelName,
BasebandSampleSink* TCPSrcPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI) BasebandSampleSink* TCPSrcPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI)
{ {
if(channelName == TCPSrc::m_channelID) if(channelName == TCPSrc::m_channelIdURI)
{ {
TCPSrc* sink = new TCPSrc(deviceAPI); TCPSrc* sink = new TCPSrc(deviceAPI);
return sink; return sink;

View File

@ -33,7 +33,8 @@ MESSAGE_CLASS_DEFINITION(UDPSrc::MsgConfigureUDPSrc, Message)
MESSAGE_CLASS_DEFINITION(UDPSrc::MsgConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(UDPSrc::MsgConfigureChannelizer, Message)
MESSAGE_CLASS_DEFINITION(UDPSrc::MsgUDPSrcSpectrum, Message) MESSAGE_CLASS_DEFINITION(UDPSrc::MsgUDPSrcSpectrum, Message)
const QString UDPSrc::m_channelID = "sdrangel.channel.udpsrc"; const QString UDPSrc::m_channelIdURI = "sdrangel.channel.udpsrc";
const QString UDPSrc::m_channelId = "UDPSrc";
UDPSrc::UDPSrc(DeviceSourceAPI *deviceAPI) : UDPSrc::UDPSrc(DeviceSourceAPI *deviceAPI) :
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
@ -52,7 +53,7 @@ UDPSrc::UDPSrc(DeviceSourceAPI *deviceAPI) :
m_agc(9600, m_agcTarget, 1e-6), m_agc(9600, m_agcTarget, 1e-6),
m_settingsMutex(QMutex::Recursive) m_settingsMutex(QMutex::Recursive)
{ {
setObjectName("UDPSrc"); setObjectName(m_channelId);
m_udpBuffer = new UDPSink<Sample>(this, udpBlockSize, m_settings.m_udpPort); m_udpBuffer = new UDPSink<Sample>(this, udpBlockSize, m_settings.m_udpPort);
m_udpBufferMono = new UDPSink<FixReal>(this, udpBlockSize, m_settings.m_udpPort); m_udpBufferMono = new UDPSink<FixReal>(this, udpBlockSize, m_settings.m_udpPort);

View File

@ -110,7 +110,8 @@ public:
virtual void getIdentifier(QString& id) { id = objectName(); } virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual void getTitle(QString& title) { title = m_settings.m_title; }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
static const int udpBlockSize = 512; // UDP block size in number of bytes static const int udpBlockSize = 512; // UDP block size in number of bytes
public slots: public slots:

View File

@ -183,7 +183,7 @@ UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
m_settings.setChannelMarker(&m_channelMarker); m_settings.setChannelMarker(&m_channelMarker);
m_settings.setSpectrumGUI(ui->spectrumGUI); m_settings.setSpectrumGUI(ui->spectrumGUI);
m_deviceUISet->registerRxChannelInstance(UDPSrc::m_channelID, this); m_deviceUISet->registerRxChannelInstance(UDPSrc::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -48,12 +48,12 @@ void UDPSrcPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register TCP Channel Source // register TCP Channel Source
m_pluginAPI->registerRxChannel(UDPSrc::m_channelID, this); m_pluginAPI->registerRxChannel(UDPSrc::m_channelIdURI, UDPSrc::m_channelId, this);
} }
PluginInstanceGUI* UDPSrcPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) PluginInstanceGUI* UDPSrcPlugin::createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{ {
if(channelName == UDPSrc::m_channelID) if(channelName == UDPSrc::m_channelIdURI)
{ {
UDPSrcGUI* gui = UDPSrcGUI::create(m_pluginAPI, deviceUISet, rxChannel); UDPSrcGUI* gui = UDPSrcGUI::create(m_pluginAPI, deviceUISet, rxChannel);
// deviceAPI->registerChannelInstance("sdrangel.channel.udpsrc", gui); // deviceAPI->registerChannelInstance("sdrangel.channel.udpsrc", gui);
@ -66,7 +66,7 @@ PluginInstanceGUI* UDPSrcPlugin::createRxChannelGUI(const QString& channelName,
BasebandSampleSink* UDPSrcPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI) BasebandSampleSink* UDPSrcPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI)
{ {
if(channelName == UDPSrc::m_channelID) if(channelName == UDPSrc::m_channelIdURI)
{ {
UDPSrc* sink = new UDPSrc(deviceAPI); UDPSrc* sink = new UDPSrc(deviceAPI);
return sink; return sink;

View File

@ -36,7 +36,8 @@ MESSAGE_CLASS_DEFINITION(AMMod::MsgConfigureFileSourceStreamTiming, Message)
MESSAGE_CLASS_DEFINITION(AMMod::MsgReportFileSourceStreamData, Message) MESSAGE_CLASS_DEFINITION(AMMod::MsgReportFileSourceStreamData, Message)
MESSAGE_CLASS_DEFINITION(AMMod::MsgReportFileSourceStreamTiming, Message) MESSAGE_CLASS_DEFINITION(AMMod::MsgReportFileSourceStreamTiming, Message)
const QString AMMod::m_channelID = "sdrangel.channeltx.modam"; const QString AMMod::m_channelIdURI = "sdrangel.channeltx.modam";
const QString AMMod::m_channelId ="AMMod";
const int AMMod::m_levelNbSamples = 480; // every 10ms const int AMMod::m_levelNbSamples = 480; // every 10ms
AMMod::AMMod(DeviceSinkAPI *deviceAPI) : AMMod::AMMod(DeviceSinkAPI *deviceAPI) :
@ -54,7 +55,7 @@ AMMod::AMMod(DeviceSinkAPI *deviceAPI) :
m_peakLevel(0.0f), m_peakLevel(0.0f),
m_levelSum(0.0f) m_levelSum(0.0f)
{ {
setObjectName("AMMod"); setObjectName(m_channelId);
m_audioBuffer.resize(1<<14); m_audioBuffer.resize(1<<14);
m_audioBufferFill = 0; m_audioBufferFill = 0;

View File

@ -243,7 +243,8 @@ public:
CWKeyer *getCWKeyer() { return &m_cwKeyer; } CWKeyer *getCWKeyer() { return &m_cwKeyer; }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
signals: signals:
/** /**

View File

@ -300,7 +300,7 @@ AMModGUI::AMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampl
m_settings.setChannelMarker(&m_channelMarker); m_settings.setChannelMarker(&m_channelMarker);
m_settings.setCWKeyerGUI(ui->cwKeyerGUI); m_settings.setCWKeyerGUI(ui->cwKeyerGUI);
m_deviceUISet->registerTxChannelInstance(AMMod::m_channelID, this); m_deviceUISet->registerTxChannelInstance(AMMod::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -24,7 +24,7 @@
const PluginDescriptor AMModPlugin::m_pluginDescriptor = { const PluginDescriptor AMModPlugin::m_pluginDescriptor = {
QString("AM Modulator"), QString("AM Modulator"),
QString("3.8.4"), QString("3.8.5"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,
@ -47,12 +47,12 @@ void AMModPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register AM modulator // register AM modulator
m_pluginAPI->registerTxChannel(AMMod::m_channelID, this); m_pluginAPI->registerTxChannel(AMMod::m_channelIdURI, AMMod::m_channelId, this);
} }
PluginInstanceGUI* AMModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) PluginInstanceGUI* AMModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
{ {
if(channelName == AMMod::m_channelID) if(channelName == AMMod::m_channelIdURI)
{ {
AMModGUI* gui = AMModGUI::create(m_pluginAPI, deviceUISet, txChannel); AMModGUI* gui = AMModGUI::create(m_pluginAPI, deviceUISet, txChannel);
return gui; return gui;
@ -63,7 +63,7 @@ PluginInstanceGUI* AMModPlugin::createTxChannelGUI(const QString& channelName, D
BasebandSampleSource* AMModPlugin::createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI) BasebandSampleSource* AMModPlugin::createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI)
{ {
if(channelName == AMMod::m_channelID) if(channelName == AMMod::m_channelIdURI)
{ {
AMMod* source = new AMMod(deviceAPI); AMMod* source = new AMMod(deviceAPI);
return source; return source;

View File

@ -40,7 +40,8 @@ MESSAGE_CLASS_DEFINITION(ATVMod::MsgConfigureOverlayText, Message)
MESSAGE_CLASS_DEFINITION(ATVMod::MsgConfigureShowOverlayText, Message) MESSAGE_CLASS_DEFINITION(ATVMod::MsgConfigureShowOverlayText, Message)
MESSAGE_CLASS_DEFINITION(ATVMod::MsgReportEffectiveSampleRate, Message) MESSAGE_CLASS_DEFINITION(ATVMod::MsgReportEffectiveSampleRate, Message)
const QString ATVMod::m_channelID = "sdrangel.channeltx.modatv"; const QString ATVMod::m_channelIdURI = "sdrangel.channeltx.modatv";
const QString ATVMod::m_channelId = "ATVMod";
const float ATVMod::m_blackLevel = 0.3f; const float ATVMod::m_blackLevel = 0.3f;
const float ATVMod::m_spanLevel = 0.7f; const float ATVMod::m_spanLevel = 0.7f;
const int ATVMod::m_levelNbSamples = 10000; // every 10ms const int ATVMod::m_levelNbSamples = 10000; // every 10ms
@ -73,7 +74,7 @@ ATVMod::ATVMod(DeviceSinkAPI *deviceAPI) :
m_DSBFilterBuffer(0), m_DSBFilterBuffer(0),
m_DSBFilterBufferIndex(0) m_DSBFilterBufferIndex(0)
{ {
setObjectName("ATVMod"); setObjectName(m_channelId);
scanCameras(); scanCameras();
m_SSBFilter = new fftfilt(0, m_settings.m_rfBandwidth / m_settings.m_outputSampleRate, m_ssbFftLen); m_SSBFilter = new fftfilt(0, m_settings.m_rfBandwidth / m_settings.m_outputSampleRate, m_ssbFftLen);

View File

@ -412,7 +412,8 @@ public:
static void getBaseValues(int outputSampleRate, int linesPerSecond, int& sampleRateUnits, uint32_t& nbPointsPerRateUnit); static void getBaseValues(int outputSampleRate, int linesPerSecond, int& sampleRateUnits, uint32_t& nbPointsPerRateUnit);
static float getRFBandwidthDivisor(ATVModSettings::ATVModulation modulation); static float getRFBandwidthDivisor(ATVModSettings::ATVModulation modulation);
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
signals: signals:
/** /**

View File

@ -621,7 +621,7 @@ ATVModGUI::ATVModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
setTitleColor(m_channelMarker.getColor()); setTitleColor(m_channelMarker.getColor());
m_settings.setChannelMarker(&m_channelMarker); m_settings.setChannelMarker(&m_channelMarker);
m_deviceUISet->registerTxChannelInstance(ATVMod::m_channelID, this); m_deviceUISet->registerTxChannelInstance(ATVMod::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -24,7 +24,7 @@
const PluginDescriptor ATVModPlugin::m_pluginDescriptor = { const PluginDescriptor ATVModPlugin::m_pluginDescriptor = {
QString("ATV Modulator"), QString("ATV Modulator"),
QString("3.8.4"), QString("3.8.5"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,
@ -47,12 +47,12 @@ void ATVModPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register ATV modulator // register ATV modulator
m_pluginAPI->registerTxChannel(ATVMod::m_channelID, this); m_pluginAPI->registerTxChannel(ATVMod::m_channelIdURI, ATVMod::m_channelId, this);
} }
PluginInstanceGUI* ATVModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) PluginInstanceGUI* ATVModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
{ {
if(channelName == ATVMod::m_channelID) if(channelName == ATVMod::m_channelIdURI)
{ {
ATVModGUI* gui = ATVModGUI::create(m_pluginAPI, deviceUISet, txChannel); ATVModGUI* gui = ATVModGUI::create(m_pluginAPI, deviceUISet, txChannel);
return gui; return gui;
@ -63,7 +63,7 @@ PluginInstanceGUI* ATVModPlugin::createTxChannelGUI(const QString& channelName,
BasebandSampleSource* ATVModPlugin::createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI) BasebandSampleSource* ATVModPlugin::createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI)
{ {
if(channelName == ATVMod::m_channelID) if(channelName == ATVMod::m_channelIdURI)
{ {
ATVMod* source = new ATVMod(deviceAPI); ATVMod* source = new ATVMod(deviceAPI);
return source; return source;

View File

@ -39,7 +39,8 @@ MESSAGE_CLASS_DEFINITION(NFMMod::MsgConfigureFileSourceStreamTiming, Message)
MESSAGE_CLASS_DEFINITION(NFMMod::MsgReportFileSourceStreamData, Message) MESSAGE_CLASS_DEFINITION(NFMMod::MsgReportFileSourceStreamData, Message)
MESSAGE_CLASS_DEFINITION(NFMMod::MsgReportFileSourceStreamTiming, Message) MESSAGE_CLASS_DEFINITION(NFMMod::MsgReportFileSourceStreamTiming, Message)
const QString NFMMod::m_channelID = "sdrangel.channeltx.modnfm"; const QString NFMMod::m_channelIdURI = "sdrangel.channeltx.modnfm";
const QString NFMMod::m_channelId = "NFMMod";
const int NFMMod::m_levelNbSamples = 480; // every 10ms const int NFMMod::m_levelNbSamples = 480; // every 10ms
NFMMod::NFMMod(DeviceSinkAPI *deviceAPI) : NFMMod::NFMMod(DeviceSinkAPI *deviceAPI) :
@ -58,7 +59,7 @@ NFMMod::NFMMod(DeviceSinkAPI *deviceAPI) :
m_peakLevel(0.0f), m_peakLevel(0.0f),
m_levelSum(0.0f) m_levelSum(0.0f)
{ {
setObjectName("NFMod"); setObjectName(m_channelId);
m_audioBuffer.resize(1<<14); m_audioBuffer.resize(1<<14);
m_audioBufferFill = 0; m_audioBufferFill = 0;

View File

@ -245,7 +245,8 @@ public:
CWKeyer *getCWKeyer() { return &m_cwKeyer; } CWKeyer *getCWKeyer() { return &m_cwKeyer; }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
signals: signals:
/** /**

View File

@ -325,7 +325,7 @@ NFMModGUI::NFMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
m_channelMarker.setVisible(true); // activate signal on the last setting only m_channelMarker.setVisible(true); // activate signal on the last setting only
m_deviceUISet->registerTxChannelInstance(NFMMod::m_channelID, this); m_deviceUISet->registerTxChannelInstance(NFMMod::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -23,7 +23,7 @@
const PluginDescriptor NFMModPlugin::m_pluginDescriptor = { const PluginDescriptor NFMModPlugin::m_pluginDescriptor = {
QString("NFM Modulator"), QString("NFM Modulator"),
QString("3.8.4"), QString("3.8.5"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,
@ -46,12 +46,12 @@ void NFMModPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register AM modulator // register AM modulator
m_pluginAPI->registerTxChannel(NFMMod::m_channelID, this); m_pluginAPI->registerTxChannel(NFMMod::m_channelIdURI, NFMMod::m_channelId, this);
} }
PluginInstanceGUI* NFMModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) PluginInstanceGUI* NFMModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
{ {
if(channelName == NFMMod::m_channelID) if(channelName == NFMMod::m_channelIdURI)
{ {
NFMModGUI* gui = NFMModGUI::create(m_pluginAPI, deviceUISet, txChannel); NFMModGUI* gui = NFMModGUI::create(m_pluginAPI, deviceUISet, txChannel);
return gui; return gui;
@ -62,7 +62,7 @@ PluginInstanceGUI* NFMModPlugin::createTxChannelGUI(const QString& channelName,
BasebandSampleSource* NFMModPlugin::createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI) BasebandSampleSource* NFMModPlugin::createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI)
{ {
if(channelName == NFMMod::m_channelID) if(channelName == NFMMod::m_channelIdURI)
{ {
NFMMod* source = new NFMMod(deviceAPI); NFMMod* source = new NFMMod(deviceAPI);
return source; return source;

View File

@ -37,7 +37,8 @@ MESSAGE_CLASS_DEFINITION(SSBMod::MsgConfigureFileSourceStreamTiming, Message)
MESSAGE_CLASS_DEFINITION(SSBMod::MsgReportFileSourceStreamData, Message) MESSAGE_CLASS_DEFINITION(SSBMod::MsgReportFileSourceStreamData, Message)
MESSAGE_CLASS_DEFINITION(SSBMod::MsgReportFileSourceStreamTiming, Message) MESSAGE_CLASS_DEFINITION(SSBMod::MsgReportFileSourceStreamTiming, Message)
const QString SSBMod::m_channelID = "sdrangel.channeltx.modssb"; const QString SSBMod::m_channelIdURI = "sdrangel.channeltx.modssb";
const QString SSBMod::m_channelId = "SSBMod";
const int SSBMod::m_levelNbSamples = 480; // every 10ms const int SSBMod::m_levelNbSamples = 480; // every 10ms
const int SSBMod::m_ssbFftLen = 1024; const int SSBMod::m_ssbFftLen = 1024;
@ -63,7 +64,7 @@ SSBMod::SSBMod(DeviceSinkAPI *deviceAPI) :
m_levelSum(0.0f), m_levelSum(0.0f),
m_inAGC(9600, 0.2, 1e-4) m_inAGC(9600, 0.2, 1e-4)
{ {
setObjectName("SSBMod"); setObjectName(m_channelId);
m_SSBFilter = new fftfilt(m_settings.m_lowCutoff / m_settings.m_audioSampleRate, m_settings.m_bandwidth / m_settings.m_audioSampleRate, m_ssbFftLen); m_SSBFilter = new fftfilt(m_settings.m_lowCutoff / m_settings.m_audioSampleRate, m_settings.m_bandwidth / m_settings.m_audioSampleRate, m_ssbFftLen);
m_DSBFilter = new fftfilt((2.0f * m_settings.m_bandwidth) / m_settings.m_audioSampleRate, 2 * m_ssbFftLen); m_DSBFilter = new fftfilt((2.0f * m_settings.m_bandwidth) / m_settings.m_audioSampleRate, 2 * m_ssbFftLen);

View File

@ -246,7 +246,8 @@ public:
CWKeyer *getCWKeyer() { return &m_cwKeyer; } CWKeyer *getCWKeyer() { return &m_cwKeyer; }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
signals: signals:
/** /**

View File

@ -397,7 +397,7 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
setTitleColor(m_channelMarker.getColor()); setTitleColor(m_channelMarker.getColor());
m_deviceUISet->registerTxChannelInstance(SSBMod::m_channelID, this); m_deviceUISet->registerTxChannelInstance(SSBMod::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -47,12 +47,12 @@ void SSBModPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register SSB modulator // register SSB modulator
m_pluginAPI->registerTxChannel(SSBMod::m_channelID, this); m_pluginAPI->registerTxChannel(SSBMod::m_channelIdURI, SSBMod::m_channelId, this);
} }
PluginInstanceGUI* SSBModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) PluginInstanceGUI* SSBModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
{ {
if(channelName == SSBMod::m_channelID) if(channelName == SSBMod::m_channelIdURI)
{ {
SSBModGUI* gui = SSBModGUI::create(m_pluginAPI, deviceUISet, txChannel); SSBModGUI* gui = SSBModGUI::create(m_pluginAPI, deviceUISet, txChannel);
return gui; return gui;
@ -63,7 +63,7 @@ PluginInstanceGUI* SSBModPlugin::createTxChannelGUI(const QString& channelName,
BasebandSampleSource* SSBModPlugin::createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI) BasebandSampleSource* SSBModPlugin::createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI)
{ {
if(channelName == SSBMod::m_channelID) if(channelName == SSBMod::m_channelIdURI)
{ {
SSBMod* source = new SSBMod(deviceAPI); SSBMod* source = new SSBMod(deviceAPI);
return source; return source;

View File

@ -39,7 +39,8 @@ MESSAGE_CLASS_DEFINITION(WFMMod::MsgConfigureFileSourceStreamTiming, Message)
MESSAGE_CLASS_DEFINITION(WFMMod::MsgReportFileSourceStreamData, Message) MESSAGE_CLASS_DEFINITION(WFMMod::MsgReportFileSourceStreamData, Message)
MESSAGE_CLASS_DEFINITION(WFMMod::MsgReportFileSourceStreamTiming, Message) MESSAGE_CLASS_DEFINITION(WFMMod::MsgReportFileSourceStreamTiming, Message)
const QString WFMMod::m_channelID = "sdrangel.channeltx.modwfm"; const QString WFMMod::m_channelIdURI = "sdrangel.channeltx.modwfm";
const QString WFMMod::m_channelId = "WFMMod";
const int WFMMod::m_levelNbSamples = 480; // every 10ms const int WFMMod::m_levelNbSamples = 480; // every 10ms
const int WFMMod::m_rfFilterFFTLength = 1024; const int WFMMod::m_rfFilterFFTLength = 1024;
@ -58,7 +59,7 @@ WFMMod::WFMMod(DeviceSinkAPI *deviceAPI) :
m_peakLevel(0.0f), m_peakLevel(0.0f),
m_levelSum(0.0f) m_levelSum(0.0f)
{ {
setObjectName("WFMod"); setObjectName(m_channelId);
m_rfFilter = new fftfilt(-62500.0 / 384000.0, 62500.0 / 384000.0, m_rfFilterFFTLength); m_rfFilter = new fftfilt(-62500.0 / 384000.0, 62500.0 / 384000.0, m_rfFilterFFTLength);
m_rfFilterBuffer = new Complex[m_rfFilterFFTLength]; m_rfFilterBuffer = new Complex[m_rfFilterFFTLength];

View File

@ -244,7 +244,8 @@ public:
CWKeyer *getCWKeyer() { return &m_cwKeyer; } CWKeyer *getCWKeyer() { return &m_cwKeyer; }
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
signals: signals:
/** /**

View File

@ -314,7 +314,7 @@ WFMModGUI::WFMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
m_channelMarker.setVisible(true); // activate signal on the last setting only m_channelMarker.setVisible(true); // activate signal on the last setting only
m_deviceUISet->registerTxChannelInstance(WFMMod::m_channelID, this); m_deviceUISet->registerTxChannelInstance(WFMMod::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -24,7 +24,7 @@
const PluginDescriptor WFMModPlugin::m_pluginDescriptor = { const PluginDescriptor WFMModPlugin::m_pluginDescriptor = {
QString("WFM Modulator"), QString("WFM Modulator"),
QString("3.8.4"), QString("3.8.5"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,
@ -47,12 +47,12 @@ void WFMModPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register AM modulator // register AM modulator
m_pluginAPI->registerTxChannel(WFMMod::m_channelID, this); m_pluginAPI->registerTxChannel(WFMMod::m_channelIdURI, WFMMod::m_channelId, this);
} }
PluginInstanceGUI* WFMModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) PluginInstanceGUI* WFMModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
{ {
if(channelName == WFMMod::m_channelID) if(channelName == WFMMod::m_channelIdURI)
{ {
WFMModGUI* gui = WFMModGUI::create(m_pluginAPI, deviceUISet, txChannel); WFMModGUI* gui = WFMModGUI::create(m_pluginAPI, deviceUISet, txChannel);
return gui; return gui;
@ -63,7 +63,7 @@ PluginInstanceGUI* WFMModPlugin::createTxChannelGUI(const QString& channelName,
BasebandSampleSource* WFMModPlugin::createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI) BasebandSampleSource* WFMModPlugin::createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI)
{ {
if(channelName == WFMMod::m_channelID) if(channelName == WFMMod::m_channelIdURI)
{ {
WFMMod* source = new WFMMod(deviceAPI); WFMMod* source = new WFMMod(deviceAPI);
return source; return source;

View File

@ -29,7 +29,8 @@ MESSAGE_CLASS_DEFINITION(UDPSink::MsgConfigureChannelizer, Message)
MESSAGE_CLASS_DEFINITION(UDPSink::MsgUDPSinkSpectrum, Message) MESSAGE_CLASS_DEFINITION(UDPSink::MsgUDPSinkSpectrum, Message)
MESSAGE_CLASS_DEFINITION(UDPSink::MsgResetReadIndex, Message) MESSAGE_CLASS_DEFINITION(UDPSink::MsgResetReadIndex, Message)
const QString UDPSink::m_channelID = "sdrangel.channeltx.udpsink"; const QString UDPSink::m_channelIdURI = "sdrangel.channeltx.udpsink";
const QString UDPSink::m_channelId = "UDPSink";
UDPSink::UDPSink(DeviceSinkAPI *deviceAPI) : UDPSink::UDPSink(DeviceSinkAPI *deviceAPI) :
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
@ -55,7 +56,7 @@ UDPSink::UDPSink(DeviceSinkAPI *deviceAPI) :
m_SSBFilterBufferIndex(0), m_SSBFilterBufferIndex(0),
m_settingsMutex(QMutex::Recursive) m_settingsMutex(QMutex::Recursive)
{ {
setObjectName("UDPSink"); setObjectName(m_channelId);
m_udpHandler.setFeedbackMessageQueue(&m_inputMessageQueue); m_udpHandler.setFeedbackMessageQueue(&m_inputMessageQueue);
m_SSBFilter = new fftfilt(m_settings.m_lowCutoff / m_settings.m_inputSampleRate, m_settings.m_rfBandwidth / m_settings.m_inputSampleRate, m_ssbFftLen); m_SSBFilter = new fftfilt(m_settings.m_lowCutoff / m_settings.m_inputSampleRate, m_settings.m_rfBandwidth / m_settings.m_inputSampleRate, m_ssbFftLen);

View File

@ -108,7 +108,8 @@ public:
void setSpectrum(bool enabled); void setSpectrum(bool enabled);
void resetReadIndex(); void resetReadIndex();
static const QString m_channelID; static const QString m_channelIdURI;
static const QString m_channelId;
signals: signals:
/** /**

View File

@ -146,7 +146,7 @@ UDPSinkGUI::UDPSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
m_channelMarker.setVisible(true); // activate signal on the last setting only m_channelMarker.setVisible(true); // activate signal on the last setting only
m_deviceUISet->registerTxChannelInstance(UDPSink::m_channelID, this); m_deviceUISet->registerTxChannelInstance(UDPSink::m_channelIdURI, this);
m_deviceUISet->addChannelMarker(&m_channelMarker); m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this); m_deviceUISet->addRollupWidget(this);

View File

@ -47,12 +47,12 @@ void UDPSinkPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register TCP Channel Source // register TCP Channel Source
m_pluginAPI->registerTxChannel(UDPSink::m_channelID, this); m_pluginAPI->registerTxChannel(UDPSink::m_channelIdURI, UDPSink::m_channelId, this);
} }
PluginInstanceGUI* UDPSinkPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel) PluginInstanceGUI* UDPSinkPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
{ {
if(channelName == UDPSink::m_channelID) if(channelName == UDPSink::m_channelIdURI)
{ {
UDPSinkGUI* gui = UDPSinkGUI::create(m_pluginAPI, deviceUISet, txChannel); UDPSinkGUI* gui = UDPSinkGUI::create(m_pluginAPI, deviceUISet, txChannel);
// deviceAPI->registerChannelInstance("sdrangel.channel.udpsrc", gui); // deviceAPI->registerChannelInstance("sdrangel.channel.udpsrc", gui);
@ -65,7 +65,7 @@ PluginInstanceGUI* UDPSinkPlugin::createTxChannelGUI(const QString& channelName,
BasebandSampleSource* UDPSinkPlugin::createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI) BasebandSampleSource* UDPSinkPlugin::createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI)
{ {
if(channelName == UDPSink::m_channelID) if(channelName == UDPSink::m_channelIdURI)
{ {
UDPSink* source = new UDPSink(deviceAPI); UDPSink* source = new UDPSink(deviceAPI);
return source; return source;

View File

@ -1,9 +1,9 @@
#include "plugin/pluginapi.h" #include "plugin/pluginapi.h"
#include "plugin/pluginmanager.h" #include "plugin/pluginmanager.h"
void PluginAPI::registerRxChannel(const QString& channelName, PluginInterface* plugin) void PluginAPI::registerRxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin)
{ {
m_pluginManager->registerRxChannel(channelName, plugin); m_pluginManager->registerRxChannel(channelIdURI, channelId, plugin);
} }
void PluginAPI::registerSampleSource(const QString& sourceName, PluginInterface* plugin) void PluginAPI::registerSampleSource(const QString& sourceName, PluginInterface* plugin)
@ -16,9 +16,9 @@ PluginAPI::ChannelRegistrations *PluginAPI::getRxChannelRegistrations()
return m_pluginManager->getRxChannelRegistrations(); return m_pluginManager->getRxChannelRegistrations();
} }
void PluginAPI::registerTxChannel(const QString& channelName, PluginInterface* plugin) void PluginAPI::registerTxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin)
{ {
m_pluginManager->registerTxChannel(channelName, plugin); m_pluginManager->registerTxChannel(channelIdURI, channelId, plugin);
} }
void PluginAPI::registerSampleSink(const QString& sinkName, PluginInterface* plugin) void PluginAPI::registerSampleSink(const QString& sinkName, PluginInterface* plugin)

View File

@ -31,9 +31,11 @@ public:
struct ChannelRegistration struct ChannelRegistration
{ {
QString m_channelId; //!< Channel or device type ID QString m_channelIdURI; //!< Channel type ID in URI form
QString m_channelId; //!< Channel type ID in short form from object name
PluginInterface* m_plugin; PluginInterface* m_plugin;
ChannelRegistration(const QString& channelId, PluginInterface* plugin) : ChannelRegistration(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin) :
m_channelIdURI(channelIdURI),
m_channelId(channelId), m_channelId(channelId),
m_plugin(plugin) m_plugin(plugin)
{ } { }
@ -42,11 +44,11 @@ public:
typedef QList<ChannelRegistration> ChannelRegistrations; typedef QList<ChannelRegistration> ChannelRegistrations;
// Rx Channel stuff // Rx Channel stuff
void registerRxChannel(const QString& channelName, PluginInterface* plugin); void registerRxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin);
ChannelRegistrations *getRxChannelRegistrations(); ChannelRegistrations *getRxChannelRegistrations();
// Tx Channel stuff // Tx Channel stuff
void registerTxChannel(const QString& channelName, PluginInterface* plugin); void registerTxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin);
ChannelRegistrations *getTxChannelRegistrations(); ChannelRegistrations *getTxChannelRegistrations();
// Sample Source stuff // Sample Source stuff

View File

@ -76,22 +76,22 @@ void PluginManager::loadPlugins()
DeviceEnumerator::instance()->enumerateTxDevices(this); DeviceEnumerator::instance()->enumerateTxDevices(this);
} }
void PluginManager::registerRxChannel(const QString& channelName, PluginInterface* plugin) void PluginManager::registerRxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin)
{ {
qDebug() << "PluginManager::registerRxChannel " qDebug() << "PluginManager::registerRxChannel "
<< plugin->getPluginDescriptor().displayedName.toStdString().c_str() << plugin->getPluginDescriptor().displayedName.toStdString().c_str()
<< " with channel name " << channelName; << " with channel name " << channelIdURI;
m_rxChannelRegistrations.append(PluginAPI::ChannelRegistration(channelName, plugin)); m_rxChannelRegistrations.append(PluginAPI::ChannelRegistration(channelIdURI, channelId, plugin));
} }
void PluginManager::registerTxChannel(const QString& channelName, PluginInterface* plugin) void PluginManager::registerTxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin)
{ {
qDebug() << "PluginManager::registerTxChannel " qDebug() << "PluginManager::registerTxChannel "
<< plugin->getPluginDescriptor().displayedName.toStdString().c_str() << plugin->getPluginDescriptor().displayedName.toStdString().c_str()
<< " with channel name " << channelName; << " with channel name " << channelIdURI;
m_txChannelRegistrations.append(PluginAPI::ChannelRegistration(channelName, plugin)); m_txChannelRegistrations.append(PluginAPI::ChannelRegistration(channelIdURI, channelId, plugin));
} }
void PluginManager::registerSampleSource(const QString& sourceName, PluginInterface* plugin) void PluginManager::registerSampleSource(const QString& sourceName, PluginInterface* plugin)
@ -172,8 +172,8 @@ void PluginManager::listRxChannels(QList<QString>& list)
for(PluginAPI::ChannelRegistrations::iterator it = m_rxChannelRegistrations.begin(); it != m_rxChannelRegistrations.end(); ++it) for(PluginAPI::ChannelRegistrations::iterator it = m_rxChannelRegistrations.begin(); it != m_rxChannelRegistrations.end(); ++it)
{ {
const PluginDescriptor& pluginDescipror = it->m_plugin->getPluginDescriptor(); const PluginDescriptor& pluginDesciptor = it->m_plugin->getPluginDescriptor();
list.append(pluginDescipror.displayedName); list.append(pluginDesciptor.displayedName);
} }
} }
@ -183,8 +183,8 @@ void PluginManager::createRxChannelInstance(int channelPluginIndex, DeviceUISet
{ {
PluginInterface *pluginInterface = m_rxChannelRegistrations[channelPluginIndex].m_plugin; PluginInterface *pluginInterface = m_rxChannelRegistrations[channelPluginIndex].m_plugin;
BasebandSampleSink *rxChannel = pluginInterface->createRxChannel( BasebandSampleSink *rxChannel = pluginInterface->createRxChannel(
m_rxChannelRegistrations[channelPluginIndex].m_channelId, deviceAPI); m_rxChannelRegistrations[channelPluginIndex].m_channelIdURI, deviceAPI);
pluginInterface->createRxChannelGUI(m_rxChannelRegistrations[channelPluginIndex].m_channelId, deviceUISet, rxChannel); pluginInterface->createRxChannelGUI(m_rxChannelRegistrations[channelPluginIndex].m_channelIdURI, deviceUISet, rxChannel);
} }
} }
@ -194,7 +194,7 @@ void PluginManager::createTxChannelInstance(int channelPluginIndex, DeviceUISet
{ {
PluginInterface *pluginInterface = m_txChannelRegistrations[channelPluginIndex].m_plugin; PluginInterface *pluginInterface = m_txChannelRegistrations[channelPluginIndex].m_plugin;
BasebandSampleSource *txChannel = pluginInterface->createTxChannel( BasebandSampleSource *txChannel = pluginInterface->createTxChannel(
m_txChannelRegistrations[channelPluginIndex].m_channelId, deviceAPI); m_txChannelRegistrations[channelPluginIndex].m_channelIdURI, deviceAPI);
pluginInterface->createTxChannelGUI(m_txChannelRegistrations[channelPluginIndex].m_channelId, deviceUISet, txChannel); pluginInterface->createTxChannelGUI(m_txChannelRegistrations[channelPluginIndex].m_channelIdURI, deviceUISet, txChannel);
} }
} }

View File

@ -46,9 +46,9 @@ public:
const Plugins& getPlugins() const { return m_plugins; } const Plugins& getPlugins() const { return m_plugins; }
// Callbacks from the plugins // Callbacks from the plugins
void registerRxChannel(const QString& channelName, PluginInterface* plugin); void registerRxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin);
void registerSampleSource(const QString& sourceName, PluginInterface* plugin); void registerSampleSource(const QString& sourceName, PluginInterface* plugin);
void registerTxChannel(const QString& channelName, PluginInterface* plugin); void registerTxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin);
void registerSampleSink(const QString& sourceName, PluginInterface* plugin); void registerSampleSink(const QString& sourceName, PluginInterface* plugin);
PluginAPI::SamplingDeviceRegistrations& getSourceDeviceRegistrations() { return m_sampleSourceRegistrations; } PluginAPI::SamplingDeviceRegistrations& getSourceDeviceRegistrations() { return m_sampleSourceRegistrations; }

View File

@ -770,9 +770,13 @@ margin-bottom: 20px;
"type" : "string", "type" : "string",
"description" : "Displayable name of the channel plugin" "description" : "Displayable name of the channel plugin"
}, },
"idURI" : {
"type" : "string",
"description" : "Key to identify the channel plugin type in URI form"
},
"id" : { "id" : {
"type" : "string", "type" : "string",
"description" : "Key to identify the channel plugin type" "description" : "Key to identify the channel plugin type as short object name"
}, },
"tx" : { "tx" : {
"type" : "boolean", "type" : "boolean",
@ -781,6 +785,10 @@ margin-bottom: 20px;
"version" : { "version" : {
"type" : "string", "type" : "string",
"description" : "Channel plugin version number" "description" : "Channel plugin version number"
},
"index" : {
"type" : "integer",
"description" : "Index of the channel in the list of registered channels"
} }
}, },
"description" : "Summarized information about channel plugin" "description" : "Summarized information about channel plugin"
@ -803,12 +811,24 @@ margin-bottom: 20px;
"description" : "List of DV serial devices available in the system" "description" : "List of DV serial devices available in the system"
}; };
defs.DeviceListItem = { defs.DeviceListItem = {
"required" : [ "hwType", "sequence", "serial", "streamIndex" ], "required" : [ "hwType" ],
"properties" : { "properties" : {
"displayedName" : {
"type" : "string",
"description" : "Displayable name that uniquely identifies this device instance"
},
"hwType" : { "hwType" : {
"type" : "string", "type" : "string",
"description" : "Key to identify the type of hardware device" "description" : "Key to identify the type of hardware device"
}, },
"serial" : {
"type" : "string",
"description" : "Serial number of the hardware device"
},
"sequence" : {
"type" : "integer",
"description" : "Sequence in the enumeration of same device types"
},
"tx" : { "tx" : {
"type" : "boolean", "type" : "boolean",
"description" : "Set to true if this is a Tx device" "description" : "Set to true if this is a Tx device"
@ -821,13 +841,13 @@ margin-bottom: 20px;
"type" : "integer", "type" : "integer",
"description" : "Index of the channel in the device" "description" : "Index of the channel in the device"
}, },
"sequence" : { "deviceSetIndex" : {
"type" : "integer", "type" : "integer",
"description" : "Sequence in the enumeration of same device types" "description" : "Index of the device set that claimed this device (-1 if not claimed)"
}, },
"serial" : { "index" : {
"type" : "string", "type" : "integer",
"description" : "Serial number of the hardware device" "description" : "Index of the device in the list of registered devices"
} }
}, },
"description" : "Summarized information about attached hardware device" "description" : "Summarized information about attached hardware device"
@ -7302,7 +7322,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2017-11-19T10:38:58.684+01:00 Generated 2017-11-23T00:55:26.644+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -66,7 +66,7 @@ QByteArray Preset::serialize() const
{ {
// qDebug("Preset::serialize: channel: id: %s", qPrintable(m_channelConfigs[i].m_channel)); // qDebug("Preset::serialize: channel: id: %s", qPrintable(m_channelConfigs[i].m_channel));
s.writeString(201 + i * 2, m_channelConfigs[i].m_channel); s.writeString(201 + i * 2, m_channelConfigs[i].m_channelIdURI);
s.writeBlob(202 + i * 2, m_channelConfigs[i].m_config); s.writeBlob(202 + i * 2, m_channelConfigs[i].m_config);
} }

View File

@ -8,11 +8,12 @@
class Preset { class Preset {
public: public:
struct ChannelConfig { struct ChannelConfig {
QString m_channel; QString m_channelIdURI; //!< Channel type ID in URI form
QString m_channelId; //!< Channel type ID in short form from object name TODO: use in the future
QByteArray m_config; QByteArray m_config;
ChannelConfig(const QString& channel, const QByteArray& config) : ChannelConfig(const QString& channelIdURI, const QByteArray& config) :
m_channel(channel), m_channelIdURI(channelIdURI),
m_config(config) m_config(config)
{ } { }
}; };

View File

@ -20,4 +20,5 @@
QString WebAPIAdapterInterface::instanceSummaryURL = "/sdrangel"; QString WebAPIAdapterInterface::instanceSummaryURL = "/sdrangel";
QString WebAPIAdapterInterface::instanceDevicesURL = "/sdrangel/devices"; QString WebAPIAdapterInterface::instanceDevicesURL = "/sdrangel/devices";
QString WebAPIAdapterInterface::instanceChannelsURL = "/sdrangel/channels";

View File

@ -25,6 +25,7 @@ namespace Swagger
{ {
class SWGInstanceSummaryResponse; class SWGInstanceSummaryResponse;
class SWGInstanceDevicesResponse; class SWGInstanceDevicesResponse;
class SWGInstanceChannelsResponse;
class SWGErrorResponse; class SWGErrorResponse;
} }
@ -52,8 +53,19 @@ public:
Swagger::SWGErrorResponse& error __attribute__((unused))) Swagger::SWGErrorResponse& error __attribute__((unused)))
{ return 501; } { return 501; }
/**
* Handler of /sdrangel/channels (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels
* returns the Http status code (default 501: not implemented)
*/
virtual int instanceChannels(
bool tx __attribute__((unused)),
Swagger::SWGInstanceChannelsResponse& response __attribute__((unused)),
Swagger::SWGErrorResponse& error __attribute__((unused)))
{ return 501; }
static QString instanceSummaryURL; static QString instanceSummaryURL;
static QString instanceDevicesURL; static QString instanceDevicesURL;
static QString instanceChannelsURL;
}; };

View File

@ -22,6 +22,7 @@
#include "webapirequestmapper.h" #include "webapirequestmapper.h"
#include "SWGInstanceSummaryResponse.h" #include "SWGInstanceSummaryResponse.h"
#include "SWGInstanceDevicesResponse.h" #include "SWGInstanceDevicesResponse.h"
#include "SWGInstanceChannelsResponse.h"
#include "SWGErrorResponse.h" #include "SWGErrorResponse.h"
WebAPIRequestMapper::WebAPIRequestMapper(QObject* parent) : WebAPIRequestMapper::WebAPIRequestMapper(QObject* parent) :
@ -98,6 +99,32 @@ void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::Http
response.setStatus(405,"Invalid HTTP method"); response.setStatus(405,"Invalid HTTP method");
} }
} }
else if (path == WebAPIAdapterInterface::instanceChannelsURL)
{
Swagger::SWGInstanceChannelsResponse normalResponse;
Swagger::SWGErrorResponse errorResponse;
if (request.getMethod() == "GET")
{
QByteArray txStr = request.getParameter("tx");
bool tx = (txStr == "true");
int status = m_adapter->instanceChannels(tx, normalResponse, errorResponse);
if (status == 200) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
}
response.setStatus(status);
}
else
{
response.write("Invalid HTTP method");
response.setStatus(405,"Invalid HTTP method");
}
}
else else
{ {
// QDirIterator it(":", QDirIterator::Subdirectories); // QDirIterator it(":", QDirIterator::Subdirectories);

View File

@ -156,9 +156,9 @@ void DeviceUISet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginA
for(int i = 0; i < openChannels.count(); i++) for(int i = 0; i < openChannels.count(); i++)
{ {
qDebug("DeviceUISet::loadChannelSettings: channels compare [%s] vs [%s]", qPrintable(openChannels[i].m_channelName), qPrintable(channelConfig.m_channel)); qDebug("DeviceUISet::loadChannelSettings: channels compare [%s] vs [%s]", qPrintable(openChannels[i].m_channelName), qPrintable(channelConfig.m_channelIdURI));
if(openChannels[i].m_channelName == channelConfig.m_channel) if(openChannels[i].m_channelName == channelConfig.m_channelIdURI)
{ {
qDebug("DeviceSourceAPI::loadChannelSettings: channel [%s] found", qPrintable(openChannels[i].m_channelName)); qDebug("DeviceSourceAPI::loadChannelSettings: channel [%s] found", qPrintable(openChannels[i].m_channelName));
reg = openChannels.takeAt(i); reg = openChannels.takeAt(i);
@ -173,15 +173,15 @@ void DeviceUISet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginA
{ {
for(int i = 0; i < channelRegistrations->count(); i++) for(int i = 0; i < channelRegistrations->count(); i++)
{ {
if((*channelRegistrations)[i].m_channelId == channelConfig.m_channel) if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
{ {
qDebug("DeviceUISet::loadChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channel)); qDebug("DeviceUISet::loadChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channelIdURI));
BasebandSampleSink *rxChannel = (*channelRegistrations)[i].m_plugin->createRxChannel( BasebandSampleSink *rxChannel = (*channelRegistrations)[i].m_plugin->createRxChannel(
channelConfig.m_channel, m_deviceSourceAPI); channelConfig.m_channelIdURI, m_deviceSourceAPI);
PluginInstanceGUI *rxChannelGUI = (*channelRegistrations)[i].m_plugin->createRxChannelGUI( PluginInstanceGUI *rxChannelGUI = (*channelRegistrations)[i].m_plugin->createRxChannelGUI(
channelConfig.m_channel, this, rxChannel); channelConfig.m_channelIdURI, this, rxChannel);
reg = ChannelInstanceRegistration( reg = ChannelInstanceRegistration(
channelConfig.m_channel, rxChannelGUI); channelConfig.m_channelIdURI, rxChannelGUI);
break; break;
} }
} }
@ -189,7 +189,7 @@ void DeviceUISet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginA
if(reg.m_gui != NULL) if(reg.m_gui != NULL)
{ {
qDebug("DeviceUISet::loadChannelSettings: deserializing channel [%s]", qPrintable(channelConfig.m_channel)); qDebug("DeviceUISet::loadChannelSettings: deserializing channel [%s]", qPrintable(channelConfig.m_channelIdURI));
reg.m_gui->deserialize(channelConfig.m_config); reg.m_gui->deserialize(channelConfig.m_config);
} }
} }
@ -255,9 +255,9 @@ void DeviceUISet::loadTxChannelSettings(const Preset *preset, PluginAPI *pluginA
for(int i = 0; i < openChannels.count(); i++) for(int i = 0; i < openChannels.count(); i++)
{ {
qDebug("DeviceUISet::loadChannelSettings: channels compare [%s] vs [%s]", qPrintable(openChannels[i].m_channelName), qPrintable(channelConfig.m_channel)); qDebug("DeviceUISet::loadChannelSettings: channels compare [%s] vs [%s]", qPrintable(openChannels[i].m_channelName), qPrintable(channelConfig.m_channelIdURI));
if(openChannels[i].m_channelName == channelConfig.m_channel) if(openChannels[i].m_channelName == channelConfig.m_channelIdURI)
{ {
qDebug("DeviceUISet::loadChannelSettings: channel [%s] found", qPrintable(openChannels[i].m_channelName)); qDebug("DeviceUISet::loadChannelSettings: channel [%s] found", qPrintable(openChannels[i].m_channelName));
reg = openChannels.takeAt(i); reg = openChannels.takeAt(i);
@ -272,15 +272,15 @@ void DeviceUISet::loadTxChannelSettings(const Preset *preset, PluginAPI *pluginA
{ {
for(int i = 0; i < channelRegistrations->count(); i++) for(int i = 0; i < channelRegistrations->count(); i++)
{ {
if((*channelRegistrations)[i].m_channelId == channelConfig.m_channel) if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
{ {
qDebug("DeviceUISet::loadChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channel)); qDebug("DeviceUISet::loadChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channelIdURI));
BasebandSampleSource *txChannel = (*channelRegistrations)[i].m_plugin->createTxChannel( BasebandSampleSource *txChannel = (*channelRegistrations)[i].m_plugin->createTxChannel(
channelConfig.m_channel, m_deviceSinkAPI); channelConfig.m_channelIdURI, m_deviceSinkAPI);
PluginInstanceGUI *txChannelGUI = (*channelRegistrations)[i].m_plugin->createTxChannelGUI( PluginInstanceGUI *txChannelGUI = (*channelRegistrations)[i].m_plugin->createTxChannelGUI(
channelConfig.m_channel, this, txChannel); channelConfig.m_channelIdURI, this, txChannel);
reg = ChannelInstanceRegistration( reg = ChannelInstanceRegistration(
channelConfig.m_channel, txChannelGUI); channelConfig.m_channelIdURI, txChannelGUI);
break; break;
} }
} }
@ -288,7 +288,7 @@ void DeviceUISet::loadTxChannelSettings(const Preset *preset, PluginAPI *pluginA
if(reg.m_gui != 0) if(reg.m_gui != 0)
{ {
qDebug("DeviceUISet::loadChannelSettings: deserializing channel [%s]", qPrintable(channelConfig.m_channel)); qDebug("DeviceUISet::loadChannelSettings: deserializing channel [%s]", qPrintable(channelConfig.m_channelIdURI));
reg.m_gui->deserialize(channelConfig.m_config); reg.m_gui->deserialize(channelConfig.m_config);
} }
} }

View File

@ -27,11 +27,14 @@
#include "device/deviceenumerator.h" #include "device/deviceenumerator.h"
#include "dsp/devicesamplesource.h" #include "dsp/devicesamplesource.h"
#include "dsp/devicesamplesink.h" #include "dsp/devicesamplesink.h"
#include "plugin/pluginapi.h"
#include "plugin/pluginmanager.h"
#include "channel/channelsinkapi.h" #include "channel/channelsinkapi.h"
#include "channel/channelsourceapi.h" #include "channel/channelsourceapi.h"
#include "SWGInstanceSummaryResponse.h" #include "SWGInstanceSummaryResponse.h"
#include "SWGInstanceDevicesResponse.h" #include "SWGInstanceDevicesResponse.h"
#include "SWGInstanceChannelsResponse.h"
#include "SWGDeviceListItem.h" #include "SWGDeviceListItem.h"
#include "SWGErrorResponse.h" #include "SWGErrorResponse.h"
@ -166,3 +169,30 @@ int WebAPIAdapterGUI::instanceDevices(
return 200; return 200;
} }
int WebAPIAdapterGUI::instanceChannels(
bool tx,
Swagger::SWGInstanceChannelsResponse& response,
Swagger::SWGErrorResponse& error __attribute__((unused)))
{
PluginAPI::ChannelRegistrations *channelRegistrations = tx ? m_mainWindow.m_pluginManager->getTxChannelRegistrations() : m_mainWindow.m_pluginManager->getRxChannelRegistrations();
int nbChannelDevices = channelRegistrations->size();
response.setChannelcount(nbChannelDevices);
QList<Swagger::SWGChannelListItem*> *channels = response.getChannels();
for (int i = 0; i < nbChannelDevices; i++)
{
channels->append(new Swagger::SWGChannelListItem);
PluginInterface *channelInterface = channelRegistrations->at(i).m_plugin;
const PluginDescriptor& pluginDescriptor = channelInterface->getPluginDescriptor();
*channels->back()->getVersion() = pluginDescriptor.version;
*channels->back()->getName() = pluginDescriptor.displayedName;
channels->back()->setTx(tx);
*channels->back()->getIdUri() = channelRegistrations->at(i).m_channelIdURI;
*channels->back()->getId() = channelRegistrations->at(i).m_channelId;
channels->back()->setIndex(i);
}
return 200;
}

View File

@ -38,6 +38,11 @@ public:
Swagger::SWGInstanceDevicesResponse& response, Swagger::SWGInstanceDevicesResponse& response,
Swagger::SWGErrorResponse& error); Swagger::SWGErrorResponse& error);
virtual int instanceChannels(
bool tx,
Swagger::SWGInstanceChannelsResponse& response,
Swagger::SWGErrorResponse& error);
private: private:
MainWindow& m_mainWindow; MainWindow& m_mainWindow;
}; };

View File

@ -519,8 +519,11 @@ definitions:
name: name:
description: "Displayable name of the channel plugin" description: "Displayable name of the channel plugin"
type: string type: string
idURI:
description: "Key to identify the channel plugin type in URI form"
type: string
id: id:
description: "Key to identify the channel plugin type" description: "Key to identify the channel plugin type as short object name"
type: string type: string
tx: tx:
description: "True if this is a Tx channel" description: "True if this is a Tx channel"
@ -528,6 +531,9 @@ definitions:
version: version:
description: "Channel plugin version number" description: "Channel plugin version number"
type: string type: string
index:
description: "Index of the channel in the list of registered channels"
type: integer
DeviceSet: DeviceSet:
description: "Sampling device and its associated channels" description: "Sampling device and its associated channels"
required: required:

View File

@ -770,9 +770,13 @@ margin-bottom: 20px;
"type" : "string", "type" : "string",
"description" : "Displayable name of the channel plugin" "description" : "Displayable name of the channel plugin"
}, },
"idURI" : {
"type" : "string",
"description" : "Key to identify the channel plugin type in URI form"
},
"id" : { "id" : {
"type" : "string", "type" : "string",
"description" : "Key to identify the channel plugin type" "description" : "Key to identify the channel plugin type as short object name"
}, },
"tx" : { "tx" : {
"type" : "boolean", "type" : "boolean",
@ -781,6 +785,10 @@ margin-bottom: 20px;
"version" : { "version" : {
"type" : "string", "type" : "string",
"description" : "Channel plugin version number" "description" : "Channel plugin version number"
},
"index" : {
"type" : "integer",
"description" : "Index of the channel in the list of registered channels"
} }
}, },
"description" : "Summarized information about channel plugin" "description" : "Summarized information about channel plugin"
@ -803,12 +811,24 @@ margin-bottom: 20px;
"description" : "List of DV serial devices available in the system" "description" : "List of DV serial devices available in the system"
}; };
defs.DeviceListItem = { defs.DeviceListItem = {
"required" : [ "hwType", "sequence", "serial", "streamIndex" ], "required" : [ "hwType" ],
"properties" : { "properties" : {
"displayedName" : {
"type" : "string",
"description" : "Displayable name that uniquely identifies this device instance"
},
"hwType" : { "hwType" : {
"type" : "string", "type" : "string",
"description" : "Key to identify the type of hardware device" "description" : "Key to identify the type of hardware device"
}, },
"serial" : {
"type" : "string",
"description" : "Serial number of the hardware device"
},
"sequence" : {
"type" : "integer",
"description" : "Sequence in the enumeration of same device types"
},
"tx" : { "tx" : {
"type" : "boolean", "type" : "boolean",
"description" : "Set to true if this is a Tx device" "description" : "Set to true if this is a Tx device"
@ -821,13 +841,13 @@ margin-bottom: 20px;
"type" : "integer", "type" : "integer",
"description" : "Index of the channel in the device" "description" : "Index of the channel in the device"
}, },
"sequence" : { "deviceSetIndex" : {
"type" : "integer", "type" : "integer",
"description" : "Sequence in the enumeration of same device types" "description" : "Index of the device set that claimed this device (-1 if not claimed)"
}, },
"serial" : { "index" : {
"type" : "string", "type" : "integer",
"description" : "Serial number of the hardware device" "description" : "Index of the device in the list of registered devices"
} }
}, },
"description" : "Summarized information about attached hardware device" "description" : "Summarized information about attached hardware device"
@ -7302,7 +7322,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2017-11-19T10:38:58.684+01:00 Generated 2017-11-23T00:55:26.644+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -38,9 +38,11 @@ SWGChannelListItem::~SWGChannelListItem() {
void void
SWGChannelListItem::init() { SWGChannelListItem::init() {
name = new QString(""); name = new QString("");
id_uri = new QString("");
id = new QString(""); id = new QString("");
tx = false; tx = false;
version = new QString(""); version = new QString("");
index = 0;
} }
void void
@ -50,6 +52,10 @@ SWGChannelListItem::cleanup() {
delete name; delete name;
} }
if(id_uri != nullptr) {
delete id_uri;
}
if(id != nullptr) { if(id != nullptr) {
delete id; delete id;
} }
@ -58,6 +64,7 @@ SWGChannelListItem::cleanup() {
if(version != nullptr) { if(version != nullptr) {
delete version; delete version;
} }
} }
SWGChannelListItem* SWGChannelListItem*
@ -72,9 +79,11 @@ SWGChannelListItem::fromJson(QString &json) {
void void
SWGChannelListItem::fromJsonObject(QJsonObject &pJson) { SWGChannelListItem::fromJsonObject(QJsonObject &pJson) {
::Swagger::setValue(&name, pJson["name"], "QString", "QString"); ::Swagger::setValue(&name, pJson["name"], "QString", "QString");
::Swagger::setValue(&id_uri, pJson["idURI"], "QString", "QString");
::Swagger::setValue(&id, pJson["id"], "QString", "QString"); ::Swagger::setValue(&id, pJson["id"], "QString", "QString");
::Swagger::setValue(&tx, pJson["tx"], "bool", ""); ::Swagger::setValue(&tx, pJson["tx"], "bool", "");
::Swagger::setValue(&version, pJson["version"], "QString", "QString"); ::Swagger::setValue(&version, pJson["version"], "QString", "QString");
::Swagger::setValue(&index, pJson["index"], "qint32", "");
} }
QString QString
@ -93,12 +102,16 @@ SWGChannelListItem::asJsonObject() {
toJsonValue(QString("name"), name, obj, QString("QString")); toJsonValue(QString("name"), name, obj, QString("QString"));
toJsonValue(QString("idURI"), id_uri, obj, QString("QString"));
toJsonValue(QString("id"), id, obj, QString("QString")); toJsonValue(QString("id"), id, obj, QString("QString"));
obj->insert("tx", QJsonValue(tx)); obj->insert("tx", QJsonValue(tx));
toJsonValue(QString("version"), version, obj, QString("QString")); toJsonValue(QString("version"), version, obj, QString("QString"));
obj->insert("index", QJsonValue(index));
return obj; return obj;
} }
@ -111,6 +124,15 @@ SWGChannelListItem::setName(QString* name) {
this->name = name; this->name = name;
} }
QString*
SWGChannelListItem::getIdUri() {
return id_uri;
}
void
SWGChannelListItem::setIdUri(QString* id_uri) {
this->id_uri = id_uri;
}
QString* QString*
SWGChannelListItem::getId() { SWGChannelListItem::getId() {
return id; return id;
@ -138,6 +160,15 @@ SWGChannelListItem::setVersion(QString* version) {
this->version = version; this->version = version;
} }
qint32
SWGChannelListItem::getIndex() {
return index;
}
void
SWGChannelListItem::setIndex(qint32 index) {
this->index = index;
}
} }

View File

@ -45,6 +45,9 @@ public:
QString* getName(); QString* getName();
void setName(QString* name); void setName(QString* name);
QString* getIdUri();
void setIdUri(QString* id_uri);
QString* getId(); QString* getId();
void setId(QString* id); void setId(QString* id);
@ -54,12 +57,17 @@ public:
QString* getVersion(); QString* getVersion();
void setVersion(QString* version); void setVersion(QString* version);
qint32 getIndex();
void setIndex(qint32 index);
private: private:
QString* name; QString* name;
QString* id_uri;
QString* id; QString* id;
bool tx; bool tx;
QString* version; QString* version;
qint32 index;
}; };
} }