mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-16 13:21:50 -05:00
Multi device support: channel plugin per device mechanism extended to all channel plugins
This commit is contained in:
parent
bbb4bc28b4
commit
2e473cc27c
@ -25,6 +25,7 @@
|
||||
#include "gui/glspectrum.h"
|
||||
#include "gui/glscope.h"
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "util/simpleserializer.h"
|
||||
#include "util/db.h"
|
||||
#include "gui/basicchannelsettingswidget.h"
|
||||
@ -325,7 +326,7 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAP
|
||||
m_channelizer = new Channelizer(m_channelAnalyzer);
|
||||
m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this);
|
||||
connect(m_channelizer, SIGNAL(inputSampleRateChanged()), this, SLOT(channelSampleRateChanged()));
|
||||
m_pluginAPI->addThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
||||
|
||||
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));
|
||||
ui->deltaFrequency->setValueRange(7, 0U, 9999999U);
|
||||
@ -347,7 +348,8 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAP
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setVisible(true);
|
||||
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
|
||||
m_pluginAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addRollupWidget(this);
|
||||
|
||||
ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
|
||||
ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope);
|
||||
|
@ -35,7 +35,7 @@ PluginGUI* ChannelAnalyzerPlugin::createChannel(const QString& channelName, Devi
|
||||
if(channelName == "org.f4exb.sdrangelove.channel.chanalyzer") {
|
||||
ChannelAnalyzerGUI* gui = ChannelAnalyzerGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("org.f4exb.sdrangelove.channel.chanalyzer", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
return gui;
|
||||
} else {
|
||||
return NULL;
|
||||
@ -46,5 +46,5 @@ void ChannelAnalyzerPlugin::createInstanceChannelAnalyzer(DeviceAPI *deviceAPI)
|
||||
{
|
||||
ChannelAnalyzerGUI* gui = ChannelAnalyzerGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("org.f4exb.sdrangelove.channel.chanalyzer", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
}
|
||||
|
@ -48,5 +48,5 @@ void AMPlugin::createInstanceAM(DeviceAPI *deviceAPI)
|
||||
{
|
||||
AMDemodGUI* gui = AMDemodGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.am", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
}
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "dsp/spectrumvis.h"
|
||||
#include "gui/glspectrum.h"
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "util/simpleserializer.h"
|
||||
#include "util/db.h"
|
||||
#include "gui/basicchannelsettingswidget.h"
|
||||
@ -380,7 +381,7 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa
|
||||
m_channelizer = new Channelizer(m_bfmDemod);
|
||||
m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this);
|
||||
connect(m_channelizer, SIGNAL(inputSampleRateChanged()), this, SLOT(channelSampleRateChanged()));
|
||||
m_pluginAPI->addThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
||||
|
||||
ui->glSpectrum->setCenterFrequency(m_rate / 4);
|
||||
ui->glSpectrum->setSampleRate(m_rate / 2);
|
||||
@ -397,7 +398,8 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* pa
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setVisible(true);
|
||||
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
|
||||
m_pluginAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addRollupWidget(this);
|
||||
|
||||
ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
|
||||
|
||||
|
@ -54,7 +54,7 @@ PluginGUI* BFMPlugin::createChannel(const QString& channelName, DeviceAPI *devic
|
||||
if(channelName == "sdrangel.channel.bfm") {
|
||||
BFMDemodGUI* gui = BFMDemodGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("sdrangel.channel.bfm", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
return gui;
|
||||
} else {
|
||||
return 0;
|
||||
@ -65,5 +65,5 @@ void BFMPlugin::createInstanceBFM(DeviceAPI *deviceAPI)
|
||||
{
|
||||
BFMDemodGUI* gui = BFMDemodGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("sdrangel.channel.bfm", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "dsp/scopevis.h"
|
||||
#include "gui/glscope.h"
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "util/simpleserializer.h"
|
||||
#include "util/db.h"
|
||||
#include "gui/basicchannelsettingswidget.h"
|
||||
@ -33,9 +34,9 @@
|
||||
#include "dsddemod.h"
|
||||
#include "dsddemodgui.h"
|
||||
|
||||
DSDDemodGUI* DSDDemodGUI::create(PluginAPI* pluginAPI)
|
||||
DSDDemodGUI* DSDDemodGUI::create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI)
|
||||
{
|
||||
DSDDemodGUI* gui = new DSDDemodGUI(pluginAPI);
|
||||
DSDDemodGUI* gui = new DSDDemodGUI(pluginAPI, deviceAPI);
|
||||
return gui;
|
||||
}
|
||||
|
||||
@ -243,10 +244,11 @@ void DSDDemodGUI::onMenuDoubleClicked()
|
||||
}
|
||||
}
|
||||
|
||||
DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) :
|
||||
RollupWidget(parent),
|
||||
ui(new Ui::DSDDemodGUI),
|
||||
m_pluginAPI(pluginAPI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_channelMarker(this),
|
||||
m_basicSettingsShown(false),
|
||||
m_doApplySettings(true),
|
||||
@ -276,7 +278,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
|
||||
m_channelizer = new Channelizer(m_dsdDemod);
|
||||
m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this);
|
||||
m_pluginAPI->addThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
||||
|
||||
//m_channelMarker = new ChannelMarker(this);
|
||||
m_channelMarker.setColor(Qt::cyan);
|
||||
@ -286,7 +288,8 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
|
||||
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
|
||||
|
||||
m_pluginAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addRollupWidget(this);
|
||||
|
||||
ui->scopeGUI->setBuddies(m_scopeVis->getInputMessageQueue(), m_scopeVis, ui->glScope);
|
||||
|
||||
@ -296,7 +299,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
DSDDemodGUI::~DSDDemodGUI()
|
||||
{
|
||||
m_pluginAPI->removeChannelInstance(this);
|
||||
m_pluginAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
delete m_threadedChannelizer;
|
||||
delete m_channelizer;
|
||||
delete m_dsdDemod;
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "dsp/movingaverage.h"
|
||||
|
||||
class PluginAPI;
|
||||
class DeviceAPI;
|
||||
|
||||
class ThreadedSampleSink;
|
||||
class Channelizer;
|
||||
@ -39,7 +40,7 @@ class DSDDemodGUI : public RollupWidget, public PluginGUI {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static DSDDemodGUI* create(PluginAPI* pluginAPI);
|
||||
static DSDDemodGUI* create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI);
|
||||
void destroy();
|
||||
|
||||
void setName(const QString& name);
|
||||
@ -79,6 +80,7 @@ private:
|
||||
|
||||
Ui::DSDDemodGUI* ui;
|
||||
PluginAPI* m_pluginAPI;
|
||||
DeviceAPI* m_deviceAPI;
|
||||
ChannelMarker m_channelMarker;
|
||||
bool m_basicSettingsShown;
|
||||
bool m_doApplySettings;
|
||||
@ -95,7 +97,7 @@ private:
|
||||
MovingAverage<Real> m_channelPowerDbAvg;
|
||||
int m_tickCount;
|
||||
|
||||
explicit DSDDemodGUI(PluginAPI* pluginAPI, QWidget* parent = NULL);
|
||||
explicit DSDDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = NULL);
|
||||
virtual ~DSDDemodGUI();
|
||||
|
||||
void blockApplySettings(bool block);
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <QtPlugin>
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsddemodplugin.h"
|
||||
#include "dsddemodgui.h"
|
||||
|
||||
@ -47,21 +48,21 @@ void DSDDemodPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
m_pluginAPI->registerChannel("sdrangel.channel.dsddemod", this);
|
||||
}
|
||||
|
||||
PluginGUI* DSDDemodPlugin::createChannel(const QString& channelName)
|
||||
PluginGUI* DSDDemodPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if(channelName == "sdrangel.channel.dsddemod") {
|
||||
DSDDemodGUI* gui = DSDDemodGUI::create(m_pluginAPI);
|
||||
DSDDemodGUI* gui = DSDDemodGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("sdrangel.channel.dsddemod", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
return gui;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void DSDDemodPlugin::createInstanceDSDDemod()
|
||||
void DSDDemodPlugin::createInstanceDSDDemod(DeviceAPI *deviceAPI)
|
||||
{
|
||||
DSDDemodGUI* gui = DSDDemodGUI::create(m_pluginAPI);
|
||||
DSDDemodGUI* gui = DSDDemodGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("sdrangel.channel.dsddemod", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
}
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include <QObject>
|
||||
#include "plugin/plugininterface.h"
|
||||
|
||||
class DeviceAPI;
|
||||
|
||||
class DSDDemodPlugin : public QObject, PluginInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginInterface)
|
||||
@ -32,7 +34,7 @@ public:
|
||||
const PluginDescriptor& getPluginDescriptor() const;
|
||||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
||||
PluginGUI* createChannel(const QString& channelName);
|
||||
PluginGUI* createChannel(const QString& channelName, DeviceAPI *deviceAPI);
|
||||
|
||||
private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
@ -40,7 +42,7 @@ private:
|
||||
PluginAPI* m_pluginAPI;
|
||||
|
||||
private slots:
|
||||
void createInstanceDSDDemod();
|
||||
void createInstanceDSDDemod(DeviceAPI *deviceAPI);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_DSDDEMODLUGIN_H
|
||||
|
@ -10,13 +10,14 @@
|
||||
#include "dsp/spectrumvis.h"
|
||||
#include "gui/glspectrum.h"
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "util/simpleserializer.h"
|
||||
#include "gui/basicchannelsettingswidget.h"
|
||||
#include "dsp/dspengine.h"
|
||||
|
||||
LoRaDemodGUI* LoRaDemodGUI::create(PluginAPI* pluginAPI)
|
||||
LoRaDemodGUI* LoRaDemodGUI::create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI)
|
||||
{
|
||||
LoRaDemodGUI* gui = new LoRaDemodGUI(pluginAPI);
|
||||
LoRaDemodGUI* gui = new LoRaDemodGUI(pluginAPI, deviceAPI);
|
||||
return gui;
|
||||
}
|
||||
|
||||
@ -146,10 +147,11 @@ void LoRaDemodGUI::onMenuDoubleClicked()
|
||||
}
|
||||
}
|
||||
|
||||
LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) :
|
||||
RollupWidget(parent),
|
||||
ui(new Ui::LoRaDemodGUI),
|
||||
m_pluginAPI(pluginAPI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_channelMarker(this),
|
||||
m_basicSettingsShown(false),
|
||||
m_doApplySettings(true)
|
||||
@ -163,7 +165,7 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
m_LoRaDemod = new LoRaDemod(m_spectrumVis);
|
||||
m_channelizer = new Channelizer(m_LoRaDemod);
|
||||
m_threadedChannelizer = new ThreadedSampleSink(m_channelizer);
|
||||
m_pluginAPI->addThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
||||
|
||||
ui->glSpectrum->setCenterFrequency(16000);
|
||||
ui->glSpectrum->setSampleRate(32000);
|
||||
@ -178,7 +180,8 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setVisible(true);
|
||||
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
|
||||
m_pluginAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addRollupWidget(this);
|
||||
|
||||
ui->spectrumGUI->setBuddies(m_channelizer->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
|
||||
|
||||
@ -188,7 +191,7 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
LoRaDemodGUI::~LoRaDemodGUI()
|
||||
{
|
||||
m_pluginAPI->removeChannelInstance(this);
|
||||
m_pluginAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
delete m_threadedChannelizer;
|
||||
delete m_channelizer;
|
||||
delete m_LoRaDemod;
|
||||
|
@ -8,6 +8,7 @@
|
||||
#define BANDWIDTHSTRING {7813,15625,20833,31250,62500}
|
||||
|
||||
class PluginAPI;
|
||||
class DeviceAPI;
|
||||
class ThreadedSampleSink;
|
||||
class Channelizer;
|
||||
class LoRaDemod;
|
||||
@ -21,7 +22,7 @@ class LoRaDemodGUI : public RollupWidget, public PluginGUI {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static LoRaDemodGUI* create(PluginAPI* pluginAPI);
|
||||
static LoRaDemodGUI* create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI);
|
||||
void destroy();
|
||||
|
||||
void setName(const QString& name);
|
||||
@ -45,6 +46,7 @@ private slots:
|
||||
private:
|
||||
Ui::LoRaDemodGUI* ui;
|
||||
PluginAPI* m_pluginAPI;
|
||||
DeviceAPI* m_deviceAPI;
|
||||
ChannelMarker m_channelMarker;
|
||||
bool m_basicSettingsShown;
|
||||
bool m_doApplySettings;
|
||||
@ -54,7 +56,7 @@ private:
|
||||
LoRaDemod* m_LoRaDemod;
|
||||
SpectrumVis* m_spectrumVis;
|
||||
|
||||
explicit LoRaDemodGUI(PluginAPI* pluginAPI, QWidget* parent = NULL);
|
||||
explicit LoRaDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = NULL);
|
||||
virtual ~LoRaDemodGUI();
|
||||
|
||||
void blockApplySettings(bool block);
|
||||
|
@ -30,21 +30,21 @@ void LoRaPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.lora", this);
|
||||
}
|
||||
|
||||
PluginGUI* LoRaPlugin::createChannel(const QString& channelName)
|
||||
PluginGUI* LoRaPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if(channelName == "de.maintech.sdrangelove.channel.lora") {
|
||||
LoRaDemodGUI* gui = LoRaDemodGUI::create(m_pluginAPI);
|
||||
LoRaDemodGUI* gui = LoRaDemodGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.lora", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
return gui;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void LoRaPlugin::createInstanceLoRa()
|
||||
void LoRaPlugin::createInstanceLoRa(DeviceAPI *deviceAPI)
|
||||
{
|
||||
LoRaDemodGUI* gui = LoRaDemodGUI::create(m_pluginAPI);
|
||||
LoRaDemodGUI* gui = LoRaDemodGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.lora", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
}
|
||||
|
@ -4,6 +4,8 @@
|
||||
#include <QObject>
|
||||
#include "plugin/plugininterface.h"
|
||||
|
||||
class DeviceAPI;
|
||||
|
||||
class LoRaPlugin : public QObject, PluginInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginInterface)
|
||||
@ -15,7 +17,7 @@ public:
|
||||
const PluginDescriptor& getPluginDescriptor() const;
|
||||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
||||
PluginGUI* createChannel(const QString& channelName);
|
||||
PluginGUI* createChannel(const QString& channelName, DeviceAPI *deviceAPI);
|
||||
|
||||
private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
@ -23,7 +25,7 @@ private:
|
||||
PluginAPI* m_pluginAPI;
|
||||
|
||||
private slots:
|
||||
void createInstanceLoRa();
|
||||
void createInstanceLoRa(DeviceAPI *deviceAPI);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_LoRaPLUGIN_H
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "nfmdemod.h"
|
||||
#include "dsp/nullsink.h"
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "util/simpleserializer.h"
|
||||
#include "util/db.h"
|
||||
#include "gui/basicchannelsettingswidget.h"
|
||||
@ -22,9 +23,9 @@ const int NFMDemodGUI::m_fmDev[] = { // corresponding FM deviations
|
||||
};
|
||||
const int NFMDemodGUI::m_nbRfBW = 9;
|
||||
|
||||
NFMDemodGUI* NFMDemodGUI::create(PluginAPI* pluginAPI)
|
||||
NFMDemodGUI* NFMDemodGUI::create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI)
|
||||
{
|
||||
NFMDemodGUI* gui = new NFMDemodGUI(pluginAPI);
|
||||
NFMDemodGUI* gui = new NFMDemodGUI(pluginAPI, deviceAPI);
|
||||
return gui;
|
||||
}
|
||||
|
||||
@ -247,10 +248,11 @@ void NFMDemodGUI::onMenuDoubleClicked()
|
||||
}
|
||||
}
|
||||
|
||||
NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) :
|
||||
RollupWidget(parent),
|
||||
ui(new Ui::NFMDemodGUI),
|
||||
m_pluginAPI(pluginAPI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_channelMarker(this),
|
||||
m_basicSettingsShown(false),
|
||||
m_doApplySettings(true),
|
||||
@ -289,7 +291,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
|
||||
m_channelizer = new Channelizer(m_nfmDemod);
|
||||
m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this);
|
||||
m_pluginAPI->addThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
||||
|
||||
//m_channelMarker = new ChannelMarker(this);
|
||||
m_channelMarker.setColor(Qt::red);
|
||||
@ -299,7 +301,8 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
|
||||
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
|
||||
|
||||
m_pluginAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addRollupWidget(this);
|
||||
|
||||
applySettings();
|
||||
}
|
||||
@ -307,7 +310,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
NFMDemodGUI::~NFMDemodGUI()
|
||||
{
|
||||
m_pluginAPI->removeChannelInstance(this);
|
||||
m_pluginAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
delete m_threadedChannelizer;
|
||||
delete m_channelizer;
|
||||
delete m_nfmDemod;
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "dsp/movingaverage.h"
|
||||
|
||||
class PluginAPI;
|
||||
class DeviceAPI;
|
||||
|
||||
class ThreadedSampleSink;
|
||||
class Channelizer;
|
||||
@ -21,7 +22,7 @@ class NFMDemodGUI : public RollupWidget, public PluginGUI {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static NFMDemodGUI* create(PluginAPI* pluginAPI);
|
||||
static NFMDemodGUI* create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI);
|
||||
void destroy();
|
||||
|
||||
void setName(const QString& name);
|
||||
@ -55,6 +56,7 @@ private slots:
|
||||
private:
|
||||
Ui::NFMDemodGUI* ui;
|
||||
PluginAPI* m_pluginAPI;
|
||||
DeviceAPI* m_deviceAPI;
|
||||
ChannelMarker m_channelMarker;
|
||||
bool m_basicSettingsShown;
|
||||
bool m_doApplySettings;
|
||||
@ -71,7 +73,7 @@ private:
|
||||
static const int m_fmDev[];
|
||||
static const int m_nbRfBW;
|
||||
|
||||
explicit NFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent = NULL);
|
||||
explicit NFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = NULL);
|
||||
virtual ~NFMDemodGUI();
|
||||
|
||||
void blockApplySettings(bool block);
|
||||
|
@ -30,21 +30,21 @@ void NFMPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.nfm", this);
|
||||
}
|
||||
|
||||
PluginGUI* NFMPlugin::createChannel(const QString& channelName)
|
||||
PluginGUI* NFMPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if(channelName == "de.maintech.sdrangelove.channel.nfm") {
|
||||
NFMDemodGUI* gui = NFMDemodGUI::create(m_pluginAPI);
|
||||
NFMDemodGUI* gui = NFMDemodGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.nfm", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
return gui;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void NFMPlugin::createInstanceNFM()
|
||||
void NFMPlugin::createInstanceNFM(DeviceAPI *deviceAPI)
|
||||
{
|
||||
NFMDemodGUI* gui = NFMDemodGUI::create(m_pluginAPI);
|
||||
NFMDemodGUI* gui = NFMDemodGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.nfm", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
}
|
||||
|
@ -4,6 +4,8 @@
|
||||
#include <QObject>
|
||||
#include "plugin/plugininterface.h"
|
||||
|
||||
class DeviceAPI;
|
||||
|
||||
class NFMPlugin : public QObject, PluginInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginInterface)
|
||||
@ -15,7 +17,7 @@ public:
|
||||
const PluginDescriptor& getPluginDescriptor() const;
|
||||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
||||
PluginGUI* createChannel(const QString& channelName);
|
||||
PluginGUI* createChannel(const QString& channelName, DeviceAPI *deviceAPI);
|
||||
|
||||
private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
@ -23,7 +25,7 @@ private:
|
||||
PluginAPI* m_pluginAPI;
|
||||
|
||||
private slots:
|
||||
void createInstanceNFM();
|
||||
void createInstanceNFM(DeviceAPI *deviceAPI);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_NFMPLUGIN_H
|
||||
|
@ -10,15 +10,16 @@
|
||||
#include "dsp/spectrumvis.h"
|
||||
#include "gui/glspectrum.h"
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "util/simpleserializer.h"
|
||||
#include "util/db.h"
|
||||
#include "gui/basicchannelsettingswidget.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
SSBDemodGUI* SSBDemodGUI::create(PluginAPI* pluginAPI)
|
||||
SSBDemodGUI* SSBDemodGUI::create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI)
|
||||
{
|
||||
SSBDemodGUI* gui = new SSBDemodGUI(pluginAPI);
|
||||
SSBDemodGUI* gui = new SSBDemodGUI(pluginAPI, deviceAPI);
|
||||
return gui;
|
||||
}
|
||||
|
||||
@ -314,10 +315,11 @@ void SSBDemodGUI::onMenuDoubleClicked()
|
||||
}
|
||||
}
|
||||
|
||||
SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) :
|
||||
RollupWidget(parent),
|
||||
ui(new Ui::SSBDemodGUI),
|
||||
m_pluginAPI(pluginAPI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_channelMarker(this),
|
||||
m_basicSettingsShown(false),
|
||||
m_doApplySettings(true),
|
||||
@ -338,7 +340,7 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
m_ssbDemod = new SSBDemod(m_spectrumVis);
|
||||
m_channelizer = new Channelizer(m_ssbDemod);
|
||||
m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this);
|
||||
m_pluginAPI->addThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
||||
|
||||
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));
|
||||
|
||||
@ -358,7 +360,8 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setVisible(true);
|
||||
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
|
||||
m_pluginAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addRollupWidget(this);
|
||||
|
||||
ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
|
||||
|
||||
@ -369,7 +372,7 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
SSBDemodGUI::~SSBDemodGUI()
|
||||
{
|
||||
m_pluginAPI->removeChannelInstance(this);
|
||||
m_pluginAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
delete m_threadedChannelizer;
|
||||
delete m_channelizer;
|
||||
delete m_ssbDemod;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "dsp/movingaverage.h"
|
||||
|
||||
class PluginAPI;
|
||||
class DeviceAPI;
|
||||
|
||||
class AudioFifo;
|
||||
class ThreadedSampleSink;
|
||||
@ -22,7 +23,7 @@ class SSBDemodGUI : public RollupWidget, public PluginGUI {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static SSBDemodGUI* create(PluginAPI* pluginAPI);
|
||||
static SSBDemodGUI* create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI);
|
||||
void destroy();
|
||||
|
||||
void setName(const QString& name);
|
||||
@ -55,6 +56,7 @@ private slots:
|
||||
private:
|
||||
Ui::SSBDemodGUI* ui;
|
||||
PluginAPI* m_pluginAPI;
|
||||
DeviceAPI* m_deviceAPI;
|
||||
ChannelMarker m_channelMarker;
|
||||
bool m_basicSettingsShown;
|
||||
bool m_doApplySettings;
|
||||
@ -71,7 +73,7 @@ private:
|
||||
SSBDemod* m_ssbDemod;
|
||||
SpectrumVis* m_spectrumVis;
|
||||
|
||||
explicit SSBDemodGUI(PluginAPI* pluginAPI, QWidget* parent = NULL);
|
||||
explicit SSBDemodGUI(PluginAPI* pluginAPI, DeviceAPI* deviceAPI, QWidget* parent = NULL);
|
||||
virtual ~SSBDemodGUI();
|
||||
|
||||
int getEffectiveLowCutoff(int lowCutoff);
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <QtPlugin>
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "ssbplugin.h"
|
||||
#include "ssbdemodgui.h"
|
||||
|
||||
@ -30,21 +31,21 @@ void SSBPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.ssb", this);
|
||||
}
|
||||
|
||||
PluginGUI* SSBPlugin::createChannel(const QString& channelName)
|
||||
PluginGUI* SSBPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if(channelName == "de.maintech.sdrangelove.channel.ssb") {
|
||||
SSBDemodGUI* gui = SSBDemodGUI::create(m_pluginAPI);
|
||||
SSBDemodGUI* gui = SSBDemodGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.ssb", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
return gui;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void SSBPlugin::createInstanceSSB()
|
||||
void SSBPlugin::createInstanceSSB(DeviceAPI *deviceAPI)
|
||||
{
|
||||
SSBDemodGUI* gui = SSBDemodGUI::create(m_pluginAPI);
|
||||
SSBDemodGUI* gui = SSBDemodGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.ssb", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
}
|
||||
|
@ -4,6 +4,8 @@
|
||||
#include <QObject>
|
||||
#include "plugin/plugininterface.h"
|
||||
|
||||
class DeviceAPI;
|
||||
|
||||
class SSBPlugin : public QObject, PluginInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginInterface)
|
||||
@ -15,7 +17,7 @@ public:
|
||||
const PluginDescriptor& getPluginDescriptor() const;
|
||||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
||||
PluginGUI* createChannel(const QString& channelName);
|
||||
PluginGUI* createChannel(const QString& channelName, DeviceAPI *deviceAPI);
|
||||
|
||||
private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
@ -23,7 +25,7 @@ private:
|
||||
PluginAPI* m_pluginAPI;
|
||||
|
||||
private slots:
|
||||
void createInstanceSSB();
|
||||
void createInstanceSSB(DeviceAPI *deviceAPI);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_SSBPLUGIN_H
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "dsp/channelizer.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "util/simpleserializer.h"
|
||||
#include "util/db.h"
|
||||
#include "gui/basicchannelsettingswidget.h"
|
||||
@ -28,9 +29,9 @@ int requiredBW(int rfBW)
|
||||
return 384000;
|
||||
}
|
||||
|
||||
WFMDemodGUI* WFMDemodGUI::create(PluginAPI* pluginAPI)
|
||||
WFMDemodGUI* WFMDemodGUI::create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI)
|
||||
{
|
||||
WFMDemodGUI* gui = new WFMDemodGUI(pluginAPI);
|
||||
WFMDemodGUI* gui = new WFMDemodGUI(pluginAPI, deviceAPI);
|
||||
return gui;
|
||||
}
|
||||
|
||||
@ -213,10 +214,11 @@ void WFMDemodGUI::onMenuDoubleClicked()
|
||||
}
|
||||
}
|
||||
|
||||
WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) :
|
||||
RollupWidget(parent),
|
||||
ui(new Ui::WFMDemodGUI),
|
||||
m_pluginAPI(pluginAPI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_channelMarker(this),
|
||||
m_basicSettingsShown(false),
|
||||
m_channelPowerDbAvg(20,0)
|
||||
@ -232,7 +234,7 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
m_wfmDemod = new WFMDemod(0);
|
||||
m_channelizer = new Channelizer(m_wfmDemod);
|
||||
m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this);
|
||||
m_pluginAPI->addThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
||||
|
||||
connect(&m_pluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
|
||||
|
||||
@ -242,7 +244,8 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setVisible(true);
|
||||
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(viewChanged()));
|
||||
m_pluginAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addRollupWidget(this);
|
||||
|
||||
applySettings();
|
||||
}
|
||||
@ -250,7 +253,7 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
WFMDemodGUI::~WFMDemodGUI()
|
||||
{
|
||||
m_pluginAPI->removeChannelInstance(this);
|
||||
m_pluginAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
delete m_threadedChannelizer;
|
||||
delete m_channelizer;
|
||||
delete m_wfmDemod;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "dsp/movingaverage.h"
|
||||
|
||||
class PluginAPI;
|
||||
class DeviceAPI;
|
||||
|
||||
class ThreadedSampleSink;
|
||||
class Channelizer;
|
||||
@ -20,7 +21,7 @@ class WFMDemodGUI : public RollupWidget, public PluginGUI {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static WFMDemodGUI* create(PluginAPI* pluginAPI);
|
||||
static WFMDemodGUI* create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI);
|
||||
void destroy();
|
||||
|
||||
void setName(const QString& name);
|
||||
@ -49,6 +50,7 @@ private slots:
|
||||
private:
|
||||
Ui::WFMDemodGUI* ui;
|
||||
PluginAPI* m_pluginAPI;
|
||||
DeviceAPI* m_deviceAPI;
|
||||
ChannelMarker m_channelMarker;
|
||||
bool m_basicSettingsShown;
|
||||
bool m_doApplySettings;
|
||||
@ -60,7 +62,7 @@ private:
|
||||
|
||||
static const int m_rfBW[];
|
||||
|
||||
explicit WFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent = NULL);
|
||||
explicit WFMDemodGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = NULL);
|
||||
virtual ~WFMDemodGUI();
|
||||
|
||||
void blockApplySettings(bool block);
|
||||
|
@ -31,21 +31,21 @@ void WFMPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.wfm", this);
|
||||
}
|
||||
|
||||
PluginGUI* WFMPlugin::createChannel(const QString& channelName)
|
||||
PluginGUI* WFMPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if(channelName == "de.maintech.sdrangelove.channel.wfm") {
|
||||
WFMDemodGUI* gui = WFMDemodGUI::create(m_pluginAPI);
|
||||
WFMDemodGUI* gui = WFMDemodGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.wfm", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
return gui;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void WFMPlugin::createInstanceWFM()
|
||||
void WFMPlugin::createInstanceWFM(DeviceAPI *deviceAPI)
|
||||
{
|
||||
WFMDemodGUI* gui = WFMDemodGUI::create(m_pluginAPI);
|
||||
WFMDemodGUI* gui = WFMDemodGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.wfm", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
}
|
||||
|
@ -4,6 +4,8 @@
|
||||
#include <QObject>
|
||||
#include "plugin/plugininterface.h"
|
||||
|
||||
class DeviceAPI;
|
||||
|
||||
class WFMPlugin : public QObject, PluginInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginInterface)
|
||||
@ -15,7 +17,7 @@ public:
|
||||
const PluginDescriptor& getPluginDescriptor() const;
|
||||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
||||
PluginGUI* createChannel(const QString& channelName);
|
||||
PluginGUI* createChannel(const QString& channelName, DeviceAPI *deviceAPI);
|
||||
|
||||
private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
@ -23,7 +25,7 @@ private:
|
||||
PluginAPI* m_pluginAPI;
|
||||
|
||||
private slots:
|
||||
void createInstanceWFM();
|
||||
void createInstanceWFM(DeviceAPI *deviceAPI);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_WFMPLUGIN_H
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "tcpsrcgui.h"
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "tcpsrc.h"
|
||||
#include "dsp/threadedsamplesink.h"
|
||||
#include "dsp/channelizer.h"
|
||||
@ -11,9 +12,9 @@
|
||||
#include "ui_tcpsrcgui.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
TCPSrcGUI* TCPSrcGUI::create(PluginAPI* pluginAPI)
|
||||
TCPSrcGUI* TCPSrcGUI::create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI)
|
||||
{
|
||||
TCPSrcGUI* gui = new TCPSrcGUI(pluginAPI);
|
||||
TCPSrcGUI* gui = new TCPSrcGUI(pluginAPI, deviceAPI);
|
||||
return gui;
|
||||
}
|
||||
|
||||
@ -179,10 +180,11 @@ void TCPSrcGUI::tick()
|
||||
ui->channelPower->setText(QString::number(m_channelPowerDbAvg.average(), 'f', 1));
|
||||
}
|
||||
|
||||
TCPSrcGUI::TCPSrcGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
TCPSrcGUI::TCPSrcGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) :
|
||||
RollupWidget(parent),
|
||||
ui(new Ui::TCPSrcGUI),
|
||||
m_pluginAPI(pluginAPI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_tcpSrc(0),
|
||||
m_channelMarker(this),
|
||||
m_channelPowerDbAvg(40,0),
|
||||
@ -199,7 +201,7 @@ TCPSrcGUI::TCPSrcGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
m_tcpSrc = new TCPSrc(m_pluginAPI->getMainWindowMessageQueue(), this, m_spectrumVis);
|
||||
m_channelizer = new Channelizer(m_tcpSrc);
|
||||
m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this);
|
||||
m_pluginAPI->addThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
||||
|
||||
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));
|
||||
ui->deltaFrequency->setValueRange(7, 0U, 9999999U);
|
||||
@ -219,7 +221,8 @@ TCPSrcGUI::TCPSrcGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
m_channelMarker.setColor(Qt::green);
|
||||
m_channelMarker.setVisible(true);
|
||||
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged()));
|
||||
m_pluginAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addRollupWidget(this);
|
||||
|
||||
ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
|
||||
|
||||
@ -229,7 +232,7 @@ TCPSrcGUI::TCPSrcGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
TCPSrcGUI::~TCPSrcGUI()
|
||||
{
|
||||
m_pluginAPI->removeChannelInstance(this);
|
||||
m_pluginAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
delete m_threadedChannelizer;
|
||||
delete m_channelizer;
|
||||
delete m_tcpSrc;
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "tcpsrc.h"
|
||||
|
||||
class PluginAPI;
|
||||
class DeviceAPI;
|
||||
class ThreadedSampleSink;
|
||||
class Channelizer;
|
||||
class TCPSrc;
|
||||
@ -22,7 +23,7 @@ class TCPSrcGUI : public RollupWidget, public PluginGUI {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static TCPSrcGUI* create(PluginAPI* pluginAPI);
|
||||
static TCPSrcGUI* create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI);
|
||||
void destroy();
|
||||
|
||||
void setName(const QString& name);
|
||||
@ -53,6 +54,7 @@ private slots:
|
||||
private:
|
||||
Ui::TCPSrcGUI* ui;
|
||||
PluginAPI* m_pluginAPI;
|
||||
DeviceAPI* m_deviceAPI;
|
||||
TCPSrc* m_tcpSrc;
|
||||
ChannelMarker m_channelMarker;
|
||||
MovingAverage<Real> m_channelPowerDbAvg;
|
||||
@ -71,7 +73,7 @@ private:
|
||||
Channelizer* m_channelizer;
|
||||
SpectrumVis* m_spectrumVis;
|
||||
|
||||
explicit TCPSrcGUI(PluginAPI* pluginAPI, QWidget* parent = 0);
|
||||
explicit TCPSrcGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = 0);
|
||||
virtual ~TCPSrcGUI();
|
||||
|
||||
void blockApplySettings(bool block);
|
||||
|
@ -30,21 +30,21 @@ void TCPSrcPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
m_pluginAPI->registerChannel("sdrangel.channel.tcpsrc", this);
|
||||
}
|
||||
|
||||
PluginGUI* TCPSrcPlugin::createChannel(const QString& channelName)
|
||||
PluginGUI* TCPSrcPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if(channelName == "sdrangel.channel.tcpsrc") {
|
||||
TCPSrcGUI* gui = TCPSrcGUI::create(m_pluginAPI);
|
||||
TCPSrcGUI* gui = TCPSrcGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("sdrangel.channel.tcpsrc", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
return gui;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void TCPSrcPlugin::createInstanceTCPSrc()
|
||||
void TCPSrcPlugin::createInstanceTCPSrc(DeviceAPI *deviceAPI)
|
||||
{
|
||||
TCPSrcGUI* gui = TCPSrcGUI::create(m_pluginAPI);
|
||||
TCPSrcGUI* gui = TCPSrcGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("sdrangel.channel.tcpsrc", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
}
|
||||
|
@ -4,6 +4,8 @@
|
||||
#include <QObject>
|
||||
#include "plugin/plugininterface.h"
|
||||
|
||||
class DeviceAPI;
|
||||
|
||||
class TCPSrcPlugin : public QObject, PluginInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginInterface)
|
||||
@ -15,7 +17,7 @@ public:
|
||||
const PluginDescriptor& getPluginDescriptor() const;
|
||||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
||||
PluginGUI* createChannel(const QString& channelName);
|
||||
PluginGUI* createChannel(const QString& channelName, DeviceAPI *deviceAPI);
|
||||
|
||||
private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
@ -23,7 +25,7 @@ private:
|
||||
PluginAPI* m_pluginAPI;
|
||||
|
||||
private slots:
|
||||
void createInstanceTCPSrc();
|
||||
void createInstanceTCPSrc(DeviceAPI *deviceAPI);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_TCPSRCPLUGIN_H
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "udpsrcgui.h"
|
||||
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/threadedsamplesink.h"
|
||||
#include "dsp/channelizer.h"
|
||||
#include "dsp/spectrumvis.h"
|
||||
@ -29,9 +30,9 @@
|
||||
#include "mainwindow.h"
|
||||
#include "udpsrc.h"
|
||||
|
||||
UDPSrcGUI* UDPSrcGUI::create(PluginAPI* pluginAPI)
|
||||
UDPSrcGUI* UDPSrcGUI::create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI)
|
||||
{
|
||||
UDPSrcGUI* gui = new UDPSrcGUI(pluginAPI);
|
||||
UDPSrcGUI* gui = new UDPSrcGUI(pluginAPI, deviceAPI);
|
||||
return gui;
|
||||
}
|
||||
|
||||
@ -216,10 +217,11 @@ void UDPSrcGUI::tick()
|
||||
ui->channelPower->setText(QString::number(m_channelPowerDbAvg.average(), 'f', 1));
|
||||
}
|
||||
|
||||
UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) :
|
||||
RollupWidget(parent),
|
||||
ui(new Ui::UDPSrcGUI),
|
||||
m_pluginAPI(pluginAPI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_udpSrc(0),
|
||||
m_channelMarker(this),
|
||||
m_channelPowerDbAvg(40,0),
|
||||
@ -237,7 +239,7 @@ UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
m_udpSrc = new UDPSrc(m_pluginAPI->getMainWindowMessageQueue(), this, m_spectrumVis);
|
||||
m_channelizer = new Channelizer(m_udpSrc);
|
||||
m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this);
|
||||
m_pluginAPI->addThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
||||
|
||||
ui->fmDeviation->setEnabled(false);
|
||||
|
||||
@ -259,7 +261,8 @@ UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
m_channelMarker.setColor(Qt::green);
|
||||
m_channelMarker.setVisible(true);
|
||||
connect(&m_channelMarker, SIGNAL(changed()), this, SLOT(channelMarkerChanged()));
|
||||
m_pluginAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addChannelMarker(&m_channelMarker);
|
||||
m_deviceAPI->addRollupWidget(this);
|
||||
|
||||
ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
|
||||
|
||||
@ -270,7 +273,7 @@ UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
UDPSrcGUI::~UDPSrcGUI()
|
||||
{
|
||||
m_pluginAPI->removeChannelInstance(this);
|
||||
m_pluginAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
m_deviceAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
delete m_threadedChannelizer;
|
||||
delete m_channelizer;
|
||||
delete m_udpSrc;
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "udpsrc.h"
|
||||
|
||||
class PluginAPI;
|
||||
class DeviceAPI;
|
||||
class ThreadedSampleSink;
|
||||
class Channelizer;
|
||||
class UDPSrc;
|
||||
@ -40,7 +41,7 @@ class UDPSrcGUI : public RollupWidget, public PluginGUI {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static UDPSrcGUI* create(PluginAPI* pluginAPI);
|
||||
static UDPSrcGUI* create(PluginAPI* pluginAPI, DeviceAPI *deviceAPI);
|
||||
void destroy();
|
||||
|
||||
void setName(const QString& name);
|
||||
@ -77,6 +78,7 @@ private slots:
|
||||
private:
|
||||
Ui::UDPSrcGUI* ui;
|
||||
PluginAPI* m_pluginAPI;
|
||||
DeviceAPI* m_deviceAPI;
|
||||
UDPSrc* m_udpSrc;
|
||||
ChannelMarker m_channelMarker;
|
||||
MovingAverage<Real> m_channelPowerDbAvg;
|
||||
@ -101,7 +103,7 @@ private:
|
||||
Channelizer* m_channelizer;
|
||||
SpectrumVis* m_spectrumVis;
|
||||
|
||||
explicit UDPSrcGUI(PluginAPI* pluginAPI, QWidget* parent = 0);
|
||||
explicit UDPSrcGUI(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = 0);
|
||||
virtual ~UDPSrcGUI();
|
||||
|
||||
void blockApplySettings(bool block);
|
||||
|
@ -49,21 +49,21 @@ void UDPSrcPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
m_pluginAPI->registerChannel("sdrangel.channel.udpsrc", this);
|
||||
}
|
||||
|
||||
PluginGUI* UDPSrcPlugin::createChannel(const QString& channelName)
|
||||
PluginGUI* UDPSrcPlugin::createChannel(const QString& channelName, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if(channelName == "sdrangel.channel.udpsrc") {
|
||||
UDPSrcGUI* gui = UDPSrcGUI::create(m_pluginAPI);
|
||||
UDPSrcGUI* gui = UDPSrcGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("sdrangel.channel.udpsrc", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
return gui;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void UDPSrcPlugin::createInstanceUDPSrc()
|
||||
void UDPSrcPlugin::createInstanceUDPSrc(DeviceAPI *deviceAPI)
|
||||
{
|
||||
UDPSrcGUI* gui = UDPSrcGUI::create(m_pluginAPI);
|
||||
UDPSrcGUI* gui = UDPSrcGUI::create(m_pluginAPI, deviceAPI);
|
||||
m_pluginAPI->registerChannelInstance("sdrangel.channel.udpsrc", gui);
|
||||
m_pluginAPI->addChannelRollup(gui);
|
||||
// m_pluginAPI->addChannelRollup(gui);
|
||||
}
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include <QObject>
|
||||
#include "plugin/plugininterface.h"
|
||||
|
||||
class DeviceAPI;
|
||||
|
||||
class UDPSrcPlugin : public QObject, PluginInterface {
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(PluginInterface)
|
||||
@ -32,7 +34,7 @@ public:
|
||||
const PluginDescriptor& getPluginDescriptor() const;
|
||||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
||||
PluginGUI* createChannel(const QString& channelName);
|
||||
PluginGUI* createChannel(const QString& channelName, DeviceAPI *deviceAPI);
|
||||
|
||||
private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
@ -40,7 +42,7 @@ private:
|
||||
PluginAPI* m_pluginAPI;
|
||||
|
||||
private slots:
|
||||
void createInstanceUDPSrc();
|
||||
void createInstanceUDPSrc(DeviceAPI *deviceAPI);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_UDPSRCPLUGIN_H
|
||||
|
Loading…
Reference in New Issue
Block a user