2015-06-21 06:46:47 -04:00
|
|
|
#include <QtPlugin>
|
|
|
|
#include <QAction>
|
|
|
|
#include "plugin/pluginapi.h"
|
|
|
|
#include "chanalyzergui.h"
|
|
|
|
#include "chanalyzerplugin.h"
|
|
|
|
|
|
|
|
const PluginDescriptor ChannelAnalyzerPlugin::m_pluginDescriptor = {
|
|
|
|
QString("Channel Analyzer"),
|
2015-09-01 19:16:40 -04:00
|
|
|
QString("---"),
|
|
|
|
QString("(c) Edouard Griffiths, F4EXB"),
|
|
|
|
QString("https://github.com/f4exb/sdrangel"),
|
2015-06-21 06:46:47 -04:00
|
|
|
true,
|
2015-09-01 19:16:40 -04:00
|
|
|
QString("https://github.com/f4exb/sdrangel")
|
2015-06-21 06:46:47 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
ChannelAnalyzerPlugin::ChannelAnalyzerPlugin(QObject* parent) :
|
|
|
|
QObject(parent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
const PluginDescriptor& ChannelAnalyzerPlugin::getPluginDescriptor() const
|
|
|
|
{
|
|
|
|
return m_pluginDescriptor;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ChannelAnalyzerPlugin::initPlugin(PluginAPI* pluginAPI)
|
|
|
|
{
|
|
|
|
m_pluginAPI = pluginAPI;
|
|
|
|
|
|
|
|
// register demodulator
|
|
|
|
QAction* action = new QAction(tr("&ChannelAnalyzer"), this);
|
|
|
|
connect(action, SIGNAL(triggered()), this, SLOT(createInstanceChannelAnalyzer()));
|
|
|
|
m_pluginAPI->registerChannel("org.f4exb.sdrangelove.channel.chanalyzer", this, action);
|
|
|
|
}
|
|
|
|
|
|
|
|
PluginGUI* ChannelAnalyzerPlugin::createChannel(const QString& channelName)
|
|
|
|
{
|
|
|
|
if(channelName == "org.f4exb.sdrangelove.channel.chanalyzer") {
|
|
|
|
ChannelAnalyzerGUI* gui = ChannelAnalyzerGUI::create(m_pluginAPI);
|
|
|
|
m_pluginAPI->registerChannelInstance("org.f4exb.sdrangelove.channel.chanalyzer", gui);
|
|
|
|
m_pluginAPI->addChannelRollup(gui);
|
|
|
|
return gui;
|
|
|
|
} else {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ChannelAnalyzerPlugin::createInstanceChannelAnalyzer()
|
|
|
|
{
|
|
|
|
ChannelAnalyzerGUI* gui = ChannelAnalyzerGUI::create(m_pluginAPI);
|
|
|
|
m_pluginAPI->registerChannelInstance("org.f4exb.sdrangelove.channel.chanalyzer", gui);
|
|
|
|
m_pluginAPI->addChannelRollup(gui);
|
|
|
|
}
|