1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 09:48:45 -05:00

Airspy serialization redesign final

This commit is contained in:
Edouard Griffiths 2015-09-30 13:53:09 +02:00
parent fbda81163a
commit 49763934ea
3 changed files with 11 additions and 6 deletions

View File

@ -20,10 +20,9 @@
#include "airspygui.h"
#include "airspyinput.h"
#include "util/simpleserializer.h"
#include "dsp/dspcommands.h"
#include "dsp/dspengine.h"
#include "airspyserializer.h"
#include "airspysettings.h"
#include "airspythread.h"
MESSAGE_CLASS_DEFINITION(AirspyInput::MsgConfigureAirspy, Message)

View File

@ -32,6 +32,8 @@ const PluginDescriptor AirspyPlugin::m_pluginDescriptor = {
QString("https://github.com/f4exb/sdrangel")
};
const QString AirspyPlugin::m_deviceTypeID = AIRSPY_DEVICE_TYPE_ID;
AirspyPlugin::AirspyPlugin(QObject* parent) :
QObject(parent),
m_pluginAPI(0)
@ -46,7 +48,7 @@ const PluginDescriptor& AirspyPlugin::getPluginDescriptor() const
void AirspyPlugin::initPlugin(PluginAPI* pluginAPI)
{
m_pluginAPI = pluginAPI;
m_pluginAPI->registerSampleSource("org.osmocom.sdr.samplesource.airspy", this);
m_pluginAPI->registerSampleSource(m_deviceTypeID, this);
}
PluginInterface::SampleSourceDevices AirspyPlugin::enumSampleSources()
@ -93,7 +95,7 @@ PluginInterface::SampleSourceDevices AirspyPlugin::enumSampleSources()
QString displayedName(QString("Airspy #%1 0x%2").arg(i).arg(serial_str));
result.append(SampleSourceDevice(displayedName,
"org.osmocom.sdr.samplesource.airspy",
m_deviceTypeID,
serial_str,
i));
@ -122,7 +124,7 @@ PluginGUI* AirspyPlugin::createSampleSourcePluginGUI(const QString& sourceId)
return 0;
}
if(sourceId == "org.osmocom.sdr.samplesource.airspy")
if(sourceId == m_deviceTypeID)
{
AirspyGui* gui = new AirspyGui(m_pluginAPI);
m_pluginAPI->setInputGUI(gui);

View File

@ -20,10 +20,12 @@
#include <QObject>
#include "plugin/plugininterface.h"
#define AIRSPY_DEVICE_TYPE_ID "sdrangel.samplesource.airspy"
class AirspyPlugin : public QObject, public PluginInterface {
Q_OBJECT
Q_INTERFACES(PluginInterface)
Q_PLUGIN_METADATA(IID "org.osmocom.sdr.samplesource.airspy")
Q_PLUGIN_METADATA(IID AIRSPY_DEVICE_TYPE_ID)
public:
explicit AirspyPlugin(QObject* parent = NULL);
@ -34,6 +36,8 @@ public:
virtual SampleSourceDevices enumSampleSources();
virtual PluginGUI* createSampleSourcePluginGUI(const QString& sourceId);
static const QString m_deviceTypeID;
private:
static const PluginDescriptor m_pluginDescriptor;