1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

Removed GLSpectrum getter from DeviceSourceAPI

This commit is contained in:
f4exb 2017-10-30 00:02:28 +01:00
parent e8fb70096c
commit e520ef5aeb
52 changed files with 249 additions and 94 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
sdrangel (3.7.9-1) unstable; urgency=medium
* Refactoring: Separate DeviceAPI from the GUI
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sun, 05 Nov 2017 18:14:18 +0200
sdrangel (3.7.8-1) unstable; urgency=medium sdrangel (3.7.8-1) unstable; urgency=medium
* PlutoSDR: restored and fixed Tx support * PlutoSDR: restored and fixed Tx support

View File

@ -22,6 +22,7 @@
#include "airspygui.h" #include "airspygui.h"
#include <device/devicesourceapi.h> #include <device/devicesourceapi.h>
#include "device/deviceuiset.h"
#include <dsp/filerecord.h> #include <dsp/filerecord.h>
#include "ui_airspygui.h" #include "ui_airspygui.h"
@ -30,10 +31,11 @@
#include "dsp/dspengine.h" #include "dsp/dspengine.h"
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
AirspyGui::AirspyGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : AirspyGui::AirspyGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::AirspyGui), ui(new Ui::AirspyGui),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true), m_forceSettings(true),
m_settings(), m_settings(),
m_sampleSource(0), m_sampleSource(0),
@ -150,8 +152,8 @@ void AirspyGui::handleInputMessages()
void AirspyGui::updateSampleRateAndFrequency() void AirspyGui::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000)); ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000));
} }

View File

@ -27,6 +27,7 @@
#define AIRSPY_MAX_DEVICE (32) #define AIRSPY_MAX_DEVICE (32)
class DeviceSourceAPI; class DeviceSourceAPI;
class DeviceUISet;
namespace Ui { namespace Ui {
class AirspyGui; class AirspyGui;
@ -37,7 +38,7 @@ class AirspyGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit AirspyGui(DeviceSourceAPI *deviceAPI, QWidget* parent = NULL); explicit AirspyGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~AirspyGui(); virtual ~AirspyGui();
virtual void destroy(); virtual void destroy();
@ -58,6 +59,7 @@ private:
Ui::AirspyGui* ui; Ui::AirspyGui* ui;
DeviceSourceAPI* m_deviceAPI; DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings; bool m_forceSettings;
AirspySettings m_settings; AirspySettings m_settings;
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -119,11 +119,15 @@ PluginInterface::SamplingDevices AirspyPlugin::enumSampleSources()
return result; return result;
} }
PluginInstanceGUI* AirspyPlugin::createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI) PluginInstanceGUI* AirspyPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if (sourceId == m_deviceTypeID) if (sourceId == m_deviceTypeID)
{ {
AirspyGui* gui = new AirspyGui(deviceAPI); AirspyGui* gui = new AirspyGui(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -36,7 +36,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources(); virtual SamplingDevices enumSampleSources();
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI); virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -27,11 +27,13 @@
#include "dsp/dspengine.h" #include "dsp/dspengine.h"
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
#include <device/devicesourceapi.h> #include <device/devicesourceapi.h>
#include "device/deviceuiset.h"
BladerfInputGui::BladerfInputGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : BladerfInputGui::BladerfInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::BladerfInputGui), ui(new Ui::BladerfInputGui),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true), m_forceSettings(true),
m_settings(), m_settings(),
m_sampleSource(NULL), m_sampleSource(NULL),
@ -148,8 +150,8 @@ void BladerfInputGui::handleInputMessages()
void BladerfInputGui::updateSampleRateAndFrequency() void BladerfInputGui::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateLabel->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5))); ui->deviceRateLabel->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5)));
} }

View File

@ -26,6 +26,7 @@
#include "bladerfinput.h" #include "bladerfinput.h"
class DeviceSourceAPI; class DeviceSourceAPI;
class DeviceUISet;
namespace Ui { namespace Ui {
class BladerfInputGui; class BladerfInputGui;
@ -35,7 +36,7 @@ class BladerfInputGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit BladerfInputGui(DeviceSourceAPI *deviceAPI, QWidget* parent = NULL); explicit BladerfInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~BladerfInputGui(); virtual ~BladerfInputGui();
virtual void destroy(); virtual void destroy();
@ -54,6 +55,7 @@ private:
Ui::BladerfInputGui* ui; Ui::BladerfInputGui* ui;
DeviceSourceAPI* m_deviceAPI; DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings; bool m_forceSettings;
BladeRFInputSettings m_settings; BladeRFInputSettings m_settings;
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -78,11 +78,15 @@ PluginInterface::SamplingDevices BlderfInputPlugin::enumSampleSources()
return result; return result;
} }
PluginInstanceGUI* BlderfInputPlugin::createSampleSourcePluginInstanceGUI(const QString& sourceId,QWidget **widget, DeviceSourceAPI *deviceAPI) PluginInstanceGUI* BlderfInputPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sourceId == m_deviceTypeID) if(sourceId == m_deviceTypeID)
{ {
BladerfInputGui* gui = new BladerfInputGui(deviceAPI); BladerfInputGui* gui = new BladerfInputGui(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -22,6 +22,7 @@
class PluginAPI; class PluginAPI;
class DeviceSourceAPI; class DeviceSourceAPI;
class DeviceUISet;
#define BLADERF_DEVICE_TYPE_ID "sdrangel.samplesource.bladerf" #define BLADERF_DEVICE_TYPE_ID "sdrangel.samplesource.bladerf"
@ -37,7 +38,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources(); virtual SamplingDevices enumSampleSources();
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI); virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -24,13 +24,15 @@
#include "fcdprogui.h" #include "fcdprogui.h"
#include <device/devicesourceapi.h> #include <device/devicesourceapi.h>
#include "device/deviceuiset.h"
#include "fcdproconst.h" #include "fcdproconst.h"
#include "fcdtraits.h" #include "fcdtraits.h"
FCDProGui::FCDProGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : FCDProGui::FCDProGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::FCDProGui), ui(new Ui::FCDProGui),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true), m_forceSettings(true),
m_settings(), m_settings(),
m_sampleSource(NULL), m_sampleSource(NULL),
@ -235,8 +237,8 @@ void FCDProGui::handleInputMessages()
void FCDProGui::updateSampleRateAndFrequency() void FCDProGui::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000)); ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000));
} }

View File

@ -27,6 +27,7 @@
class DeviceSourceAPI; class DeviceSourceAPI;
class QWidget; class QWidget;
class DeviceUISet;
namespace Ui { namespace Ui {
class FCDProGui; class FCDProGui;
@ -36,7 +37,7 @@ class FCDProGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit FCDProGui(DeviceSourceAPI *deviceAPI, QWidget* parent = NULL); explicit FCDProGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~FCDProGui(); virtual ~FCDProGui();
virtual void destroy(); virtual void destroy();
@ -55,6 +56,7 @@ private:
Ui::FCDProGui* ui; Ui::FCDProGui* ui;
DeviceSourceAPI* m_deviceAPI; DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings; bool m_forceSettings;
FCDProSettings m_settings; FCDProSettings m_settings;
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -74,11 +74,15 @@ PluginInterface::SamplingDevices FCDProPlugin::enumSampleSources()
return result; return result;
} }
PluginInstanceGUI* FCDProPlugin::createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI) PluginInstanceGUI* FCDProPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sourceId == fcd_traits<Pro>::interfaceIID) if(sourceId == fcd_traits<Pro>::interfaceIID)
{ {
FCDProGui* gui = new FCDProGui(deviceAPI); FCDProGui* gui = new FCDProGui(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -20,7 +20,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources(); virtual SamplingDevices enumSampleSources();
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI); virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
private: private:

View File

@ -25,13 +25,15 @@
#include "fcdproplusgui.h" #include "fcdproplusgui.h"
#include <device/devicesourceapi.h> #include <device/devicesourceapi.h>
#include "device/deviceuiset.h"
#include "fcdproplusconst.h" #include "fcdproplusconst.h"
#include "fcdtraits.h" #include "fcdtraits.h"
FCDProPlusGui::FCDProPlusGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : FCDProPlusGui::FCDProPlusGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::FCDProPlusGui), ui(new Ui::FCDProPlusGui),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true), m_forceSettings(true),
m_settings(), m_settings(),
m_sampleSource(NULL), m_sampleSource(NULL),
@ -153,8 +155,8 @@ void FCDProPlusGui::handleInputMessages()
void FCDProPlusGui::updateSampleRateAndFrequency() void FCDProPlusGui::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000)); ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000));
} }

View File

@ -26,6 +26,7 @@
#include "fcdproplusinput.h" #include "fcdproplusinput.h"
class DeviceSourceAPI; class DeviceSourceAPI;
class DeviceUISet;
namespace Ui { namespace Ui {
class FCDProPlusGui; class FCDProPlusGui;
@ -35,7 +36,7 @@ class FCDProPlusGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit FCDProPlusGui(DeviceSourceAPI *deviceAPI, QWidget* parent = NULL); explicit FCDProPlusGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~FCDProPlusGui(); virtual ~FCDProPlusGui();
virtual void destroy(); virtual void destroy();
@ -54,6 +55,7 @@ private:
Ui::FCDProPlusGui* ui; Ui::FCDProPlusGui* ui;
DeviceSourceAPI* m_deviceAPI; DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings; bool m_forceSettings;
FCDProPlusSettings m_settings; FCDProPlusSettings m_settings;
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -76,11 +76,15 @@ PluginInterface::SamplingDevices FCDProPlusPlugin::enumSampleSources()
return result; return result;
} }
PluginInstanceGUI* FCDProPlusPlugin::createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI) PluginInstanceGUI* FCDProPlusPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sourceId == fcd_traits<ProPlus>::interfaceIID) if(sourceId == fcd_traits<ProPlus>::interfaceIID)
{ {
FCDProPlusGui* gui = new FCDProPlusGui(deviceAPI); FCDProPlusGui* gui = new FCDProPlusGui(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -20,7 +20,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources(); virtual SamplingDevices enumSampleSources();
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI); virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
static const QString m_deviceTypeID; static const QString m_deviceTypeID;

View File

@ -33,11 +33,13 @@
#include "filesourcegui.h" #include "filesourcegui.h"
#include <device/devicesourceapi.h> #include <device/devicesourceapi.h>
#include "device/deviceuiset.h"
FileSourceGui::FileSourceGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : FileSourceGui::FileSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::FileSourceGui), ui(new Ui::FileSourceGui),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_settings(), m_settings(),
m_sampleSource(NULL), m_sampleSource(NULL),
m_acquisition(false), m_acquisition(false),
@ -186,8 +188,8 @@ bool FileSourceGui::handleMessage(const Message& message)
void FileSourceGui::updateSampleRateAndFrequency() void FileSourceGui::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_deviceSampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_deviceSampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateText->setText(tr("%1k").arg((float)m_deviceSampleRate / 1000)); ui->deviceRateText->setText(tr("%1k").arg((float)m_deviceSampleRate / 1000));
} }

View File

@ -26,6 +26,7 @@
#include "filesourceinput.h" #include "filesourceinput.h"
class DeviceSourceAPI; class DeviceSourceAPI;
class DeviceUISet;
namespace Ui { namespace Ui {
class FileSourceGui; class FileSourceGui;
@ -35,7 +36,7 @@ class FileSourceGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit FileSourceGui(DeviceSourceAPI *deviceAPI, QWidget* parent = NULL); explicit FileSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~FileSourceGui(); virtual ~FileSourceGui();
virtual void destroy(); virtual void destroy();
@ -54,6 +55,7 @@ private:
Ui::FileSourceGui* ui; Ui::FileSourceGui* ui;
DeviceSourceAPI* m_deviceAPI; DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
FileSourceInput::Settings m_settings; FileSourceInput::Settings m_settings;
QTimer m_statusTimer; QTimer m_statusTimer;
std::vector<int> m_gains; std::vector<int> m_gains;

View File

@ -69,11 +69,15 @@ PluginInterface::SamplingDevices FileSourcePlugin::enumSampleSources()
return result; return result;
} }
PluginInstanceGUI* FileSourcePlugin::createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI) PluginInstanceGUI* FileSourcePlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sourceId == m_deviceTypeID) if(sourceId == m_deviceTypeID)
{ {
FileSourceGui* gui = new FileSourceGui(deviceAPI); FileSourceGui* gui = new FileSourceGui(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -36,7 +36,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources(); virtual SamplingDevices enumSampleSources();
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI); virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -27,14 +27,16 @@
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
#include "device/devicesourceapi.h" #include "device/devicesourceapi.h"
#include "device/devicesinkapi.h" #include "device/devicesinkapi.h"
#include "device/deviceuiset.h"
#include "hackrf/devicehackrfvalues.h" #include "hackrf/devicehackrfvalues.h"
#include "ui_hackrfinputgui.h" #include "ui_hackrfinputgui.h"
HackRFInputGui::HackRFInputGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : HackRFInputGui::HackRFInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::HackRFInputGui), ui(new Ui::HackRFInputGui),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_settings(), m_settings(),
m_forceSettings(true), m_forceSettings(true),
m_sampleSource(NULL), m_sampleSource(NULL),
@ -164,8 +166,8 @@ void HackRFInputGui::handleInputMessages()
void HackRFInputGui::updateSampleRateAndFrequency() void HackRFInputGui::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateText->setText(QString("%1k").arg(QString::number(m_sampleRate/1000.0, 'g', 5))); ui->deviceRateText->setText(QString("%1k").arg(QString::number(m_sampleRate/1000.0, 'g', 5)));
} }

View File

@ -28,6 +28,7 @@
#define HACKRF_MAX_DEVICE (32) #define HACKRF_MAX_DEVICE (32)
class DeviceSourceAPI; class DeviceSourceAPI;
class DeviceUISet;
namespace Ui { namespace Ui {
class HackRFInputGui; class HackRFInputGui;
@ -45,7 +46,7 @@ public:
HACKRF_IMGREJ_NB HACKRF_IMGREJ_NB
} HackRFImgRejValue; } HackRFImgRejValue;
explicit HackRFInputGui(DeviceSourceAPI *deviceAPI, QWidget* parent = NULL); explicit HackRFInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~HackRFInputGui(); virtual ~HackRFInputGui();
virtual void destroy(); virtual void destroy();
@ -64,6 +65,7 @@ private:
Ui::HackRFInputGui* ui; Ui::HackRFInputGui* ui;
DeviceSourceAPI* m_deviceAPI; DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
HackRFInputSettings m_settings; HackRFInputSettings m_settings;
bool m_forceSettings; bool m_forceSettings;
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -117,11 +117,15 @@ PluginInterface::SamplingDevices HackRFInputPlugin::enumSampleSources()
return result; return result;
} }
PluginInstanceGUI* HackRFInputPlugin::createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI) PluginInstanceGUI* HackRFInputPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sourceId == m_deviceTypeID) if(sourceId == m_deviceTypeID)
{ {
HackRFInputGui* gui = new HackRFInputGui(deviceAPI); HackRFInputGui* gui = new HackRFInputGui(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -36,7 +36,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources(); virtual SamplingDevices enumSampleSources();
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI); virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -27,11 +27,13 @@
#include "dsp/dspengine.h" #include "dsp/dspengine.h"
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
#include "device/devicesourceapi.h" #include "device/devicesourceapi.h"
#include "device/deviceuiset.h"
LimeSDRInputGUI::LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, QWidget* parent) : LimeSDRInputGUI::LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::LimeSDRInputGUI), ui(new Ui::LimeSDRInputGUI),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_settings(), m_settings(),
m_sampleRate(0), m_sampleRate(0),
m_lastEngineState((DSPDeviceSourceEngine::State)-1), m_lastEngineState((DSPDeviceSourceEngine::State)-1),
@ -246,8 +248,8 @@ void LimeSDRInputGUI::updateADCRate()
void LimeSDRInputGUI::updateSampleRateAndFrequency() void LimeSDRInputGUI::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateLabel->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5))); ui->deviceRateLabel->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5)));
} }

View File

@ -26,6 +26,7 @@
#include "limesdrinput.h" #include "limesdrinput.h"
class DeviceSourceAPI; class DeviceSourceAPI;
class DeviceUISet;
namespace Ui { namespace Ui {
class LimeSDRInputGUI; class LimeSDRInputGUI;
@ -35,7 +36,7 @@ class LimeSDRInputGUI : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, QWidget* parent = 0); explicit LimeSDRInputGUI(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~LimeSDRInputGUI(); virtual ~LimeSDRInputGUI();
virtual void destroy(); virtual void destroy();
@ -54,6 +55,7 @@ private:
Ui::LimeSDRInputGUI* ui; Ui::LimeSDRInputGUI* ui;
DeviceSourceAPI* m_deviceAPI; DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
LimeSDRInput* m_limeSDRInput; //!< Same object as above but gives easy access to LimeSDRInput methods and attributes that are used intensively LimeSDRInput* m_limeSDRInput; //!< Same object as above but gives easy access to LimeSDRInput methods and attributes that are used intensively
LimeSDRInputSettings m_settings; LimeSDRInputSettings m_settings;
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -97,11 +97,15 @@ PluginInterface::SamplingDevices LimeSDRInputPlugin::enumSampleSources()
return result; return result;
} }
PluginInstanceGUI* LimeSDRInputPlugin::createSampleSourcePluginInstanceGUI(const QString& sourceId,QWidget **widget, DeviceSourceAPI *deviceAPI) PluginInstanceGUI* LimeSDRInputPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sourceId == m_deviceTypeID) if(sourceId == m_deviceTypeID)
{ {
LimeSDRInputGUI* gui = new LimeSDRInputGUI(deviceAPI); LimeSDRInputGUI* gui = new LimeSDRInputGUI(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -36,7 +36,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources(); virtual SamplingDevices enumSampleSources();
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI); virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -22,15 +22,17 @@
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
#include "gui/glspectrum.h" #include "gui/glspectrum.h"
#include "device/devicesourceapi.h" #include "device/devicesourceapi.h"
#include "device/deviceuiset.h"
#include "plutosdr/deviceplutosdr.h" #include "plutosdr/deviceplutosdr.h"
#include "plutosdrinput.h" #include "plutosdrinput.h"
#include "ui_plutosdrinputgui.h" #include "ui_plutosdrinputgui.h"
#include "plutosdrinputgui.h" #include "plutosdrinputgui.h"
PlutoSDRInputGui::PlutoSDRInputGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : PlutoSDRInputGui::PlutoSDRInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::PlutoSDRInputGUI), ui(new Ui::PlutoSDRInputGUI),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_settings(), m_settings(),
m_forceSettings(true), m_forceSettings(true),
m_sampleSource(NULL), m_sampleSource(NULL),
@ -464,7 +466,7 @@ void PlutoSDRInputGui::handleInputMessages()
void PlutoSDRInputGui::updateSampleRateAndFrequency() void PlutoSDRInputGui::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateLabel->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5))); ui->deviceRateLabel->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5)));
} }

View File

@ -28,6 +28,7 @@
class DeviceSourceAPI; class DeviceSourceAPI;
class DeviceSampleSource; class DeviceSampleSource;
class DeviceUISet;
namespace Ui { namespace Ui {
class PlutoSDRInputGUI; class PlutoSDRInputGUI;
@ -37,7 +38,7 @@ class PlutoSDRInputGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit PlutoSDRInputGui(DeviceSourceAPI *deviceAPI, QWidget* parent = 0); explicit PlutoSDRInputGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~PlutoSDRInputGui(); virtual ~PlutoSDRInputGui();
virtual void destroy(); virtual void destroy();
@ -54,6 +55,7 @@ public:
private: private:
Ui::PlutoSDRInputGUI* ui; Ui::PlutoSDRInputGUI* ui;
DeviceSourceAPI* m_deviceAPI; DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
PlutoSDRInputSettings m_settings; PlutoSDRInputSettings m_settings;
bool m_forceSettings; bool m_forceSettings;
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -81,11 +81,15 @@ PluginInterface::SamplingDevices PlutoSDRInputPlugin::enumSampleSources()
return result; return result;
} }
PluginInstanceGUI* PlutoSDRInputPlugin::createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI) PluginInstanceGUI* PlutoSDRInputPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sourceId == m_deviceTypeID) if(sourceId == m_deviceTypeID)
{ {
PlutoSDRInputGui* gui = new PlutoSDRInputGui(deviceAPI); PlutoSDRInputGui* gui = new PlutoSDRInputGui(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -36,7 +36,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources(); virtual SamplingDevices enumSampleSources();
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI); virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -20,6 +20,7 @@
#include "rtlsdrgui.h" #include "rtlsdrgui.h"
#include <device/devicesourceapi.h> #include <device/devicesourceapi.h>
#include "device/deviceuiset.h"
#include <dsp/filerecord.h> #include <dsp/filerecord.h>
#include "ui_rtlsdrgui.h" #include "ui_rtlsdrgui.h"
@ -29,10 +30,11 @@
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
RTLSDRGui::RTLSDRGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : RTLSDRGui::RTLSDRGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::RTLSDRGui), ui(new Ui::RTLSDRGui),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true), m_forceSettings(true),
m_settings(), m_settings(),
m_sampleSource(0), m_sampleSource(0),
@ -173,8 +175,8 @@ void RTLSDRGui::handleInputMessages()
void RTLSDRGui::updateSampleRateAndFrequency() void RTLSDRGui::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateText->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5))); ui->deviceRateText->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5)));
} }

View File

@ -26,6 +26,7 @@
#include "rtlsdrinput.h" #include "rtlsdrinput.h"
class DeviceSourceAPI; class DeviceSourceAPI;
class DeviceUISet;
namespace Ui { namespace Ui {
class RTLSDRGui; class RTLSDRGui;
@ -36,7 +37,7 @@ class RTLSDRGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit RTLSDRGui(DeviceSourceAPI *deviceAPI, QWidget* parent = NULL); explicit RTLSDRGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~RTLSDRGui(); virtual ~RTLSDRGui();
virtual void destroy(); virtual void destroy();
@ -55,6 +56,7 @@ private:
Ui::RTLSDRGui* ui; Ui::RTLSDRGui* ui;
DeviceSourceAPI* m_deviceAPI; DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings; bool m_forceSettings;
RTLSDRSettings m_settings; RTLSDRSettings m_settings;
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -62,10 +62,14 @@ PluginInterface::SamplingDevices RTLSDRPlugin::enumSampleSources()
return result; return result;
} }
PluginInstanceGUI* RTLSDRPlugin::createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI) PluginInstanceGUI* RTLSDRPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sourceId == m_deviceTypeID) { if(sourceId == m_deviceTypeID) {
RTLSDRGui* gui = new RTLSDRGui(deviceAPI); RTLSDRGui* gui = new RTLSDRGui(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} else { } else {

View File

@ -20,7 +20,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources(); virtual SamplingDevices enumSampleSources();
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI); virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -43,12 +43,14 @@
#include "util/simpleserializer.h" #include "util/simpleserializer.h"
#include <device/devicesourceapi.h> #include <device/devicesourceapi.h>
#include "device/deviceuiset.h"
#include "sdrdaemonsourcegui.h" #include "sdrdaemonsourcegui.h"
SDRdaemonSourceGui::SDRdaemonSourceGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : SDRdaemonSourceGui::SDRdaemonSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::SDRdaemonSourceGui), ui(new Ui::SDRdaemonSourceGui),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_sampleSource(NULL), m_sampleSource(NULL),
m_acquisition(false), m_acquisition(false),
m_lastEngineState((DSPDeviceSourceEngine::State)-1), m_lastEngineState((DSPDeviceSourceEngine::State)-1),
@ -284,8 +286,8 @@ void SDRdaemonSourceGui::handleInputMessages()
void SDRdaemonSourceGui::updateSampleRateAndFrequency() void SDRdaemonSourceGui::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_deviceSampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_deviceSampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateText->setText(tr("%1k").arg((float)m_deviceSampleRate / 1000)); ui->deviceRateText->setText(tr("%1k").arg((float)m_deviceSampleRate / 1000));
} }

View File

@ -27,6 +27,7 @@
#include "sdrdaemonsourceinput.h" #include "sdrdaemonsourceinput.h"
class DeviceSourceAPI; class DeviceSourceAPI;
class DeviceUISet;
namespace Ui { namespace Ui {
class SDRdaemonSourceGui; class SDRdaemonSourceGui;
@ -36,7 +37,7 @@ class SDRdaemonSourceGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit SDRdaemonSourceGui(DeviceSourceAPI *deviceAPI, QWidget* parent = NULL); explicit SDRdaemonSourceGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~SDRdaemonSourceGui(); virtual ~SDRdaemonSourceGui();
virtual void destroy(); virtual void destroy();
@ -55,6 +56,7 @@ private:
Ui::SDRdaemonSourceGui* ui; Ui::SDRdaemonSourceGui* ui;
DeviceSourceAPI* m_deviceAPI; DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
SDRdaemonSourceSettings m_settings; //!< current settings SDRdaemonSourceSettings m_settings; //!< current settings
SDRdaemonSourceSettings m_controlSettings; //!< settings last sent to device via control port SDRdaemonSourceSettings m_controlSettings; //!< settings last sent to device via control port
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -70,11 +70,15 @@ PluginInterface::SamplingDevices SDRdaemonSourcePlugin::enumSampleSources()
return result; return result;
} }
PluginInstanceGUI* SDRdaemonSourcePlugin::createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI) PluginInstanceGUI* SDRdaemonSourcePlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sourceId == m_deviceTypeID) if(sourceId == m_deviceTypeID)
{ {
SDRdaemonSourceGui* gui = new SDRdaemonSourceGui(deviceAPI); SDRdaemonSourceGui* gui = new SDRdaemonSourceGui(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -36,7 +36,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources(); virtual SamplingDevices enumSampleSources();
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI); virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -20,6 +20,7 @@
#include "sdrplaygui.h" #include "sdrplaygui.h"
#include <device/devicesourceapi.h> #include <device/devicesourceapi.h>
#include "device/deviceuiset.h"
#include "ui_sdrplaygui.h" #include "ui_sdrplaygui.h"
#include "gui/colormapper.h" #include "gui/colormapper.h"
@ -28,10 +29,11 @@
#include "dsp/dspcommands.h" #include "dsp/dspcommands.h"
SDRPlayGui::SDRPlayGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : SDRPlayGui::SDRPlayGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::SDRPlayGui), ui(new Ui::SDRPlayGui),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_deviceUISet(deviceUISet),
m_forceSettings(true) m_forceSettings(true)
{ {
m_sampleSource = (SDRPlayInput*) m_deviceAPI->getSampleSource(); m_sampleSource = (SDRPlayInput*) m_deviceAPI->getSampleSource();
@ -198,8 +200,8 @@ void SDRPlayGui::handleInputMessages()
void SDRPlayGui::updateSampleRateAndFrequency() void SDRPlayGui::updateSampleRateAndFrequency()
{ {
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate);
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000)); ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000));
} }

View File

@ -29,6 +29,7 @@
class DeviceSampleSource; class DeviceSampleSource;
class DeviceSourceAPI; class DeviceSourceAPI;
class DeviceUISet;
namespace Ui { namespace Ui {
class SDRPlayGui; class SDRPlayGui;
@ -38,7 +39,7 @@ class SDRPlayGui : public QWidget, public PluginInstanceGUI {
Q_OBJECT Q_OBJECT
public: public:
explicit SDRPlayGui(DeviceSourceAPI *deviceAPI, QWidget* parent = NULL); explicit SDRPlayGui(DeviceSourceAPI *deviceAPI, DeviceUISet *deviceUISet, QWidget* parent = 0);
virtual ~SDRPlayGui(); virtual ~SDRPlayGui();
virtual void destroy(); virtual void destroy();
@ -57,6 +58,7 @@ private:
Ui::SDRPlayGui* ui; Ui::SDRPlayGui* ui;
DeviceSourceAPI* m_deviceAPI; DeviceSourceAPI* m_deviceAPI;
DeviceUISet* m_deviceUISet;
bool m_forceSettings; bool m_forceSettings;
SDRPlaySettings m_settings; SDRPlaySettings m_settings;
QTimer m_updateTimer; QTimer m_updateTimer;

View File

@ -83,11 +83,15 @@ PluginInterface::SamplingDevices SDRPlayPlugin::enumSampleSources()
return result; return result;
} }
PluginInstanceGUI* SDRPlayPlugin::createSampleSourcePluginInstanceGUI(const QString& sourceId,QWidget **widget, DeviceSourceAPI *deviceAPI) PluginInstanceGUI* SDRPlayPlugin::createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet)
{ {
if(sourceId == m_deviceTypeID) if(sourceId == m_deviceTypeID)
{ {
SDRPlayGui* gui = new SDRPlayGui(deviceAPI); SDRPlayGui* gui = new SDRPlayGui(deviceAPI, deviceUISet);
*widget = gui; *widget = gui;
return gui; return gui;
} }

View File

@ -36,7 +36,11 @@ public:
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);
virtual SamplingDevices enumSampleSources(); virtual SamplingDevices enumSampleSources();
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI); virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId,
QWidget **widget,
DeviceSourceAPI *deviceAPI,
DeviceUISet *deviceUISet);
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI); virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI);
static const QString m_hardwareID; static const QString m_hardwareID;

View File

@ -112,7 +112,7 @@ public:
bool isBuddyLeader() const { return m_isBuddyLeader; } bool isBuddyLeader() const { return m_isBuddyLeader; }
void setBuddyLeader(bool isBuddyLeader) { m_isBuddyLeader = isBuddyLeader; } void setBuddyLeader(bool isBuddyLeader) { m_isBuddyLeader = isBuddyLeader; }
const QTimer& getMasterTimer() const { return m_masterTimer; } const QTimer& getMasterTimer() const { return m_masterTimer; } //!< This is the DSPEngine master timer
protected: protected:
struct ChannelInstanceRegistration struct ChannelInstanceRegistration
@ -156,7 +156,7 @@ protected:
std::vector<DeviceSinkAPI*> m_sinkBuddies; //!< Device sink APIs referencing the same physical device std::vector<DeviceSinkAPI*> m_sinkBuddies; //!< Device sink APIs referencing the same physical device
void *m_buddySharedPtr; void *m_buddySharedPtr;
bool m_isBuddyLeader; bool m_isBuddyLeader;
const QTimer& m_masterTimer; const QTimer& m_masterTimer; //!< This is the DSPEngine master timer
friend class DeviceSourceAPI; friend class DeviceSourceAPI;
}; };

View File

@ -128,11 +128,6 @@ void DeviceSourceAPI::configureCorrections(bool dcOffsetCorrection, bool iqImbal
m_deviceSourceEngine->configureCorrections(dcOffsetCorrection, iqImbalanceCorrection); m_deviceSourceEngine->configureCorrections(dcOffsetCorrection, iqImbalanceCorrection);
} }
GLSpectrum *DeviceSourceAPI::getSpectrum()
{
return m_spectrum;
}
void DeviceSourceAPI::addChannelMarker(ChannelMarker* channelMarker) void DeviceSourceAPI::addChannelMarker(ChannelMarker* channelMarker)
{ {
m_spectrum->addChannelMarker(channelMarker); m_spectrum->addChannelMarker(channelMarker);

View File

@ -68,7 +68,6 @@ public:
void configureCorrections(bool dcOffsetCorrection, bool iqImbalanceCorrection); //!< Configure current device engine DSP corrections void configureCorrections(bool dcOffsetCorrection, bool iqImbalanceCorrection); //!< Configure current device engine DSP corrections
// device related stuff // device related stuff
GLSpectrum *getSpectrum(); //!< Direct spectrum getter
void addChannelMarker(ChannelMarker* channelMarker); //!< Add channel marker to spectrum void addChannelMarker(ChannelMarker* channelMarker); //!< Add channel marker to spectrum
void addRollupWidget(QWidget *widget); //!< Add rollup widget to channel window void addRollupWidget(QWidget *widget); //!< Add rollup widget to channel window
@ -113,7 +112,7 @@ public:
bool isBuddyLeader() const { return m_isBuddyLeader; } bool isBuddyLeader() const { return m_isBuddyLeader; }
void setBuddyLeader(bool isBuddyLeader) { m_isBuddyLeader = isBuddyLeader; } void setBuddyLeader(bool isBuddyLeader) { m_isBuddyLeader = isBuddyLeader; }
const QTimer& getMasterTimer() const { return m_masterTimer; } const QTimer& getMasterTimer() const { return m_masterTimer; } //!< This is the DSPEngine master timer
protected: protected:
struct ChannelInstanceRegistration struct ChannelInstanceRegistration
@ -158,7 +157,7 @@ protected:
std::vector<DeviceSinkAPI*> m_sinkBuddies; //!< Device sink APIs referencing the same physical device std::vector<DeviceSinkAPI*> m_sinkBuddies; //!< Device sink APIs referencing the same physical device
void *m_buddySharedPtr; void *m_buddySharedPtr;
bool m_isBuddyLeader; bool m_isBuddyLeader;
const QTimer& m_masterTimer; const QTimer& m_masterTimer; //!< This is the DSPEngine master timer
friend class DeviceSinkAPI; friend class DeviceSinkAPI;
}; };

View File

@ -29,6 +29,7 @@ class DSPDeviceSourceEngine;
class DeviceSourceAPI; class DeviceSourceAPI;
class DSPDeviceSinkEngine; class DSPDeviceSinkEngine;
class DeviceSinkAPI; class DeviceSinkAPI;
class ChannelMarker;
struct DeviceUISet struct DeviceUISet
{ {
@ -45,6 +46,10 @@ struct DeviceUISet
DeviceUISet(QTimer& timer); DeviceUISet(QTimer& timer);
~DeviceUISet(); ~DeviceUISet();
GLSpectrum *getSpectrum() { return m_spectrum; } //!< Direct spectrum getter
void addChannelMarker(ChannelMarker* channelMarker); //!< Add channel marker to spectrum
void addRollupWidget(QWidget *widget); //!< Add rollup widget to channel window
}; };

View File

@ -84,7 +84,7 @@
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Version 3.7.8 - Copyright (C) 2015-2017 Edouard Griffiths, F4EXB. &lt;/p&gt;&lt;p&gt;Code at &lt;a href=&quot;https://github.com/f4exb/sdrangel&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/f4exb/sdrangel&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Many thanks to the original developers:&lt;/p&gt;&lt;p&gt;The osmocom developer team - especially horizon, Hoernchen &amp;amp; tnt.&lt;/p&gt;&lt;p&gt;Christian Daniel from maintech GmbH.&lt;/p&gt;&lt;p&gt;John Greb (hexameron) for the contributions in &lt;a href=&quot;https://github.com/hexameron/rtl-sdrangelove&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;RTL-SDRangelove&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The following rules apply to the SDRangel main application and libsdrbase:&lt;br/&gt;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have received a copy of the GNU General Public License along with this program. If not, see &lt;a href=&quot;http://www.gnu.org/licenses/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://www.gnu.org/licenses/&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;For the license of installed plugins, look into the plugin list.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Version 3.7.9 - Copyright (C) 2015-2017 Edouard Griffiths, F4EXB. &lt;/p&gt;&lt;p&gt;Code at &lt;a href=&quot;https://github.com/f4exb/sdrangel&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/f4exb/sdrangel&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Many thanks to the original developers:&lt;/p&gt;&lt;p&gt;The osmocom developer team - especially horizon, Hoernchen &amp;amp; tnt.&lt;/p&gt;&lt;p&gt;Christian Daniel from maintech GmbH.&lt;/p&gt;&lt;p&gt;John Greb (hexameron) for the contributions in &lt;a href=&quot;https://github.com/hexameron/rtl-sdrangelove&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;RTL-SDRangelove&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The following rules apply to the SDRangel main application and libsdrbase:&lt;br/&gt;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have received a copy of the GNU General Public License along with this program. If not, see &lt;a href=&quot;http://www.gnu.org/licenses/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://www.gnu.org/licenses/&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;For the license of installed plugins, look into the plugin list.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>

View File

@ -152,7 +152,10 @@ MainWindow::MainWindow(QWidget* parent) :
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSource(source); m_deviceUIs.back()->m_deviceSourceAPI->setSampleSource(source);
QWidget *gui; QWidget *gui;
PluginInstanceGUI *pluginGUI = m_deviceUIs.back()->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI( PluginInstanceGUI *pluginGUI = m_deviceUIs.back()->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI(
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSourceId(), &gui, m_deviceUIs.back()->m_deviceSourceAPI); m_deviceUIs.back()->m_deviceSourceAPI->getSampleSourceId(),
&gui,
m_deviceUIs.back()->m_deviceSourceAPI,
m_deviceUIs.back());
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginGUI->getInputMessageQueue()); m_deviceUIs.back()->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginGUI->getInputMessageQueue());
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourcePluginInstanceGUI(pluginGUI); m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourcePluginInstanceGUI(pluginGUI);
setDeviceGUI(0, gui, m_deviceUIs.back()->m_deviceSourceAPI->getSampleSourceDisplayName()); setDeviceGUI(0, gui, m_deviceUIs.back()->m_deviceSourceAPI->getSampleSourceDisplayName());
@ -236,7 +239,10 @@ void MainWindow::addSourceDevice()
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSource(source); m_deviceUIs.back()->m_deviceSourceAPI->setSampleSource(source);
QWidget *gui; QWidget *gui;
PluginInstanceGUI *pluginGUI = m_deviceUIs.back()->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI( PluginInstanceGUI *pluginGUI = m_deviceUIs.back()->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI(
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSourceId(), &gui, m_deviceUIs.back()->m_deviceSourceAPI); m_deviceUIs.back()->m_deviceSourceAPI->getSampleSourceId(),
&gui,
m_deviceUIs.back()->m_deviceSourceAPI,
m_deviceUIs.back());
m_deviceUIs.back()->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginGUI->getInputMessageQueue()); m_deviceUIs.back()->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginGUI->getInputMessageQueue());
m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourcePluginInstanceGUI(pluginGUI); m_deviceUIs.back()->m_deviceSourceAPI->setSampleSourcePluginInstanceGUI(pluginGUI);
setDeviceGUI(deviceTabIndex, gui, m_deviceUIs.back()->m_deviceSourceAPI->getSampleSourceDisplayName()); setDeviceGUI(deviceTabIndex, gui, m_deviceUIs.back()->m_deviceSourceAPI->getSampleSourceDisplayName());
@ -506,9 +512,9 @@ void MainWindow::createStatusBar()
{ {
QString qtVersionStr = QString("Qt %1 ").arg(QT_VERSION_STR); QString qtVersionStr = QString("Qt %1 ").arg(QT_VERSION_STR);
#if QT_VERSION >= 0x050400 #if QT_VERSION >= 0x050400
m_showSystemWidget = new QLabel("SDRangel v3.7.8 " + qtVersionStr + QSysInfo::prettyProductName(), this); m_showSystemWidget = new QLabel("SDRangel v3.7.9 " + qtVersionStr + QSysInfo::prettyProductName(), this);
#else #else
m_showSystemWidget = new QLabel("SDRangel v3.7.8 " + qtVersionStr, this); m_showSystemWidget = new QLabel("SDRangel v3.7.9 " + qtVersionStr, this);
#endif #endif
statusBar()->addPermanentWidget(m_showSystemWidget); statusBar()->addPermanentWidget(m_showSystemWidget);
@ -901,7 +907,10 @@ void MainWindow::on_sampleSource_confirmClicked(bool checked __attribute__((unus
deviceUI->m_deviceSourceAPI->setSampleSource(source); deviceUI->m_deviceSourceAPI->setSampleSource(source);
QWidget *gui; QWidget *gui;
PluginInstanceGUI *pluginUI = deviceUI->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI( PluginInstanceGUI *pluginUI = deviceUI->m_deviceSourceAPI->getPluginInterface()->createSampleSourcePluginInstanceGUI(
deviceUI->m_deviceSourceAPI->getSampleSourceId(), &gui, deviceUI->m_deviceSourceAPI); deviceUI->m_deviceSourceAPI->getSampleSourceId(),
&gui,
deviceUI->m_deviceSourceAPI,
deviceUI);
deviceUI->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginUI->getInputMessageQueue()); deviceUI->m_deviceSourceAPI->getSampleSource()->setMessageQueueToGUI(pluginUI->getInputMessageQueue());
deviceUI->m_deviceSourceAPI->setSampleSourcePluginInstanceGUI(pluginUI); deviceUI->m_deviceSourceAPI->setSampleSourcePluginInstanceGUI(pluginUI);
setDeviceGUI(currentSourceTabIndex, gui, deviceUI->m_deviceSourceAPI->getSampleSourceDisplayName()); setDeviceGUI(currentSourceTabIndex, gui, deviceUI->m_deviceSourceAPI->getSampleSourceDisplayName());

View File

@ -16,6 +16,7 @@ struct PluginDescriptor {
class PluginAPI; class PluginAPI;
class DeviceSourceAPI; class DeviceSourceAPI;
class DeviceUISet;
class DeviceSinkAPI; class DeviceSinkAPI;
class PluginInstanceGUI; class PluginInstanceGUI;
class QWidget; class QWidget;
@ -59,7 +60,14 @@ public:
// device source plugins only // device source plugins only
virtual SamplingDevices enumSampleSources() { return SamplingDevices(); } virtual SamplingDevices enumSampleSources() { return SamplingDevices(); }
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(const QString& sourceId __attribute__((unused)), QWidget **widget __attribute__((unused)), DeviceSourceAPI *deviceAPI __attribute__((unused))) { return 0; }
virtual PluginInstanceGUI* createSampleSourcePluginInstanceGUI(
const QString& sourceId __attribute__((unused)),
QWidget **widget __attribute__((unused)),
DeviceSourceAPI *deviceAPI __attribute__((unused)),
DeviceUISet *deviceUISet __attribute__((unused)))
{ return 0; }
virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId __attribute__((unused)), DeviceSourceAPI *deviceAPI __attribute__((unused))) { return 0; } // creates the input "core" virtual DeviceSampleSource* createSampleSourcePluginInstanceInput(const QString& sourceId __attribute__((unused)), DeviceSourceAPI *deviceAPI __attribute__((unused))) { return 0; } // creates the input "core"
virtual void deleteSampleSourcePluginInstanceGUI(PluginInstanceGUI *ui); virtual void deleteSampleSourcePluginInstanceGUI(PluginInstanceGUI *ui);
virtual void deleteSampleSourcePluginInstanceInput(DeviceSampleSource *source); virtual void deleteSampleSourcePluginInstanceInput(DeviceSampleSource *source);