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

Multi device support: SDRDaemon plugin removed useless dependencies on plugin API

This commit is contained in:
f4exb 2016-05-17 19:08:04 +02:00
parent 35df869115
commit 197feb1c9d
5 changed files with 10 additions and 13 deletions

View File

@ -30,7 +30,6 @@
#include <nanomsg/pair.h> #include <nanomsg/pair.h>
#include "ui_sdrdaemongui.h" #include "ui_sdrdaemongui.h"
#include "plugin/pluginapi.h"
#include "device/deviceapi.h" #include "device/deviceapi.h"
#include "gui/colormapper.h" #include "gui/colormapper.h"
#include "gui/glspectrum.h" #include "gui/glspectrum.h"
@ -42,10 +41,9 @@
#include "sdrdaemongui.h" #include "sdrdaemongui.h"
SDRdaemonGui::SDRdaemonGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) : SDRdaemonGui::SDRdaemonGui(DeviceAPI *deviceAPI, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::SDRdaemonGui), ui(new Ui::SDRdaemonGui),
m_pluginAPI(pluginAPI),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_sampleSource(NULL), m_sampleSource(NULL),
m_acquisition(false), m_acquisition(false),
@ -88,9 +86,9 @@ SDRdaemonGui::SDRdaemonGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget*
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
m_statusTimer.start(500); m_statusTimer.start(500);
connect(&(m_pluginAPI->getMainWindow()->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick())); connect(&(deviceAPI->getMainWindow()->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
m_sampleSource = new SDRdaemonInput(m_pluginAPI->getMainWindow()->getMasterTimer(), m_deviceAPI); m_sampleSource = new SDRdaemonInput(deviceAPI->getMainWindow()->getMasterTimer(), m_deviceAPI);
connect(m_sampleSource->getOutputMessageQueueToGUI(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); connect(m_sampleSource->getOutputMessageQueueToGUI(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
m_deviceAPI->setSource(m_sampleSource); m_deviceAPI->setSource(m_sampleSource);

View File

@ -23,7 +23,6 @@
#include "sdrdaemoninput.h" #include "sdrdaemoninput.h"
class PluginAPI;
class DeviceAPI; class DeviceAPI;
class FileSink; class FileSink;
@ -35,7 +34,7 @@ class SDRdaemonGui : public QWidget, public PluginGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit SDRdaemonGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = NULL); explicit SDRdaemonGui(DeviceAPI *deviceAPI, QWidget* parent = NULL);
virtual ~SDRdaemonGui(); virtual ~SDRdaemonGui();
void destroy(); void destroy();
@ -52,7 +51,6 @@ public:
private: private:
Ui::SDRdaemonGui* ui; Ui::SDRdaemonGui* ui;
PluginAPI* m_pluginAPI;
DeviceAPI* m_deviceAPI; DeviceAPI* m_deviceAPI;
QTimer m_updateTimer; QTimer m_updateTimer;
QTimer m_statusTimer; QTimer m_statusTimer;

View File

@ -46,8 +46,7 @@ const PluginDescriptor& SDRdaemonPlugin::getPluginDescriptor() const
void SDRdaemonPlugin::initPlugin(PluginAPI* pluginAPI) void SDRdaemonPlugin::initPlugin(PluginAPI* pluginAPI)
{ {
m_pluginAPI = pluginAPI; pluginAPI->registerSampleSource(m_deviceTypeID, this);
m_pluginAPI->registerSampleSource(m_deviceTypeID, this);
} }
PluginInterface::SampleSourceDevices SDRdaemonPlugin::enumSampleSources() PluginInterface::SampleSourceDevices SDRdaemonPlugin::enumSampleSources()
@ -72,7 +71,7 @@ PluginGUI* SDRdaemonPlugin::createSampleSourcePluginGUI(const QString& sourceId,
{ {
if(sourceId == m_deviceTypeID) if(sourceId == m_deviceTypeID)
{ {
SDRdaemonGui* gui = new SDRdaemonGui(m_pluginAPI, deviceAPI); SDRdaemonGui* gui = new SDRdaemonGui(deviceAPI);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -22,6 +22,8 @@
#define SDRDAEMON_DEVICE_TYPE_ID "sdrangel.samplesource.sdrdaemon" #define SDRDAEMON_DEVICE_TYPE_ID "sdrangel.samplesource.sdrdaemon"
class PluginAPI;
class SDRdaemonPlugin : public QObject, public PluginInterface { class SDRdaemonPlugin : public QObject, public PluginInterface {
Q_OBJECT Q_OBJECT
Q_INTERFACES(PluginInterface) Q_INTERFACES(PluginInterface)
@ -40,8 +42,6 @@ public:
private: private:
static const PluginDescriptor m_pluginDescriptor; static const PluginDescriptor m_pluginDescriptor;
PluginAPI* m_pluginAPI;
}; };
#endif // INCLUDE_SDRDAEMONPLUGIN_H #endif // INCLUDE_SDRDAEMONPLUGIN_H

View File

@ -80,6 +80,8 @@ public:
void loadChannelSettings(const Preset* preset, PluginAPI *pluginAPI); void loadChannelSettings(const Preset* preset, PluginAPI *pluginAPI);
void saveChannelSettings(Preset* preset); void saveChannelSettings(Preset* preset);
MainWindow *getMainWindow() { return m_mainWindow; }
protected: protected:
struct ChannelInstanceRegistration struct ChannelInstanceRegistration
{ {