1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 01:18:38 -05:00

Channel API rework: make it inherit from QObject and removed QObject inheritance from DSP interfaces. Fixes #1147

This commit is contained in:
f4exb 2022-02-13 00:57:33 +01:00
parent 41061de50b
commit 634b25ac1e
66 changed files with 274 additions and 324 deletions

View File

@ -37,7 +37,6 @@ class BasebandSampleSink;
class BeamSteeringCWMod: public MIMOChannel, public ChannelAPI
{
Q_OBJECT
public:
class MsgConfigureBeamSteeringCWMod : public Message {
MESSAGE_CLASS_DECLARATION
@ -95,7 +94,8 @@ public:
virtual void stopSources(); //!< thread exit() and wait()
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int sinkIndex);
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples, unsigned int sourceIndex);
virtual bool handleMessage(const Message& cmd); //!< Processing of a message. Returns true if message has actually been processed
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getMIMOName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = "BeamSteeringCWMod"; }
@ -160,6 +160,7 @@ private:
uint32_t m_basebandSampleRate;
int m_count0, m_count1;
virtual bool handleMessage(const Message& cmd); //!< Processing of a message. Returns true if message has actually been processed
void applySettings(const BeamSteeringCWModSettings& settings, bool force = false);
static void validateFilterChainHash(BeamSteeringCWModSettings& settings);
void calculateFrequencyOffset();

View File

@ -38,7 +38,6 @@ class QNetworkAccessManager;
class Interferometer: public MIMOChannel, public ChannelAPI
{
Q_OBJECT
public:
class MsgConfigureInterferometer : public Message {
MESSAGE_CLASS_DECLARATION
@ -96,7 +95,8 @@ public:
virtual void stopSources() {}
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int sinkIndex);
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples, unsigned int sourceIndex);
virtual bool handleMessage(const Message& cmd); //!< Processing of a message. Returns true if message has actually been processed
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getMIMOName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = "Interferometer"; }
@ -165,6 +165,7 @@ private:
uint32_t m_deviceSampleRate;
int m_count0, m_count1;
virtual bool handleMessage(const Message& cmd); //!< Processing of a message. Returns true if message has actually been processed
void applySettings(const InterferometerSettings& settings, bool force = false);
static void validateFilterChainHash(InterferometerSettings& settings);
void calculateFrequencyOffset();

View File

@ -80,7 +80,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = objectName(); }
@ -135,6 +136,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const ChannelAnalyzerSettings& settings, bool force = false);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const ChannelAnalyzerSettings& settings, bool force);
void sendChannelSettings(

View File

@ -38,7 +38,6 @@ class DeviceAPI;
class ADSBDemodWorker;
class ADSBDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureADSBDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -71,7 +70,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -145,6 +145,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd); //!< Processing of a message. Returns true if message has actually been processed
void applySettings(const ADSBDemodSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const ADSBDemodSettings& settings, bool force);

View File

@ -42,7 +42,6 @@ class DeviceAPI;
class ScopeVis;
class AISDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureAISDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -99,7 +98,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual const QString& getURI() const { return getName(); }
@ -169,6 +169,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const AISDemodSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const AISDemodSettings& settings, bool force);

View File

@ -36,7 +36,6 @@ class QThread;
class DeviceAPI;
class AMDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureAMDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -69,7 +68,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -140,6 +140,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const AMDemodSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);

View File

@ -42,7 +42,6 @@ class DeviceAPI;
class APTDemodImageWorker;
class APTDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureAPTDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -194,11 +193,12 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual void startBasebandSink();
virtual void stopBasebandSink();
virtual void startImageWorker();
virtual void stopImageWorker();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
void startBasebandSink();
void stopBasebandSink();
void startImageWorker();
void stopImageWorker();
void setMessageQueueToGUI(MessageQueue* queue) override
{
@ -273,6 +273,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const APTDemodSettings& settings, bool force = false);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const APTDemodSettings& settings, bool force);
void webapiFormatChannelSettings(

View File

@ -36,7 +36,6 @@ class ScopeVis;
class ATVDemod : public BasebandSampleSink, public ChannelAPI
{
Q_OBJECT
public:
class MsgConfigureATVDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -69,7 +68,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = objectName(); }
@ -106,6 +106,7 @@ private:
qint64 m_centerFrequency; //!< center frequency stored from device message used when starting baseband sink
int m_basebandSampleRate; //!< sample rate stored from device message used when starting baseband sink
virtual bool handleMessage(const Message& cmd);
void applySettings(const ATVDemodSettings& settings, bool force = false);
};

View File

@ -42,7 +42,6 @@ namespace SWGSDRangel {
}
class BFMDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureBFMDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -77,7 +76,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -154,6 +154,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const BFMDemodSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);

View File

@ -207,7 +207,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -288,6 +289,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const ChirpChatDemodSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const ChirpChatDemodSettings& settings, bool force);

View File

@ -37,7 +37,6 @@ class QThread;
class DeviceAPI;
class DABDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureDABDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -319,7 +318,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual const QString& getURI() const { return getName(); }
@ -386,6 +386,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const DABDemodSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const DABDemodSettings& settings, bool force);

View File

@ -38,8 +38,6 @@ class QNetworkReply;
class DATVDemod : public BasebandSampleSink, public ChannelAPI
{
Q_OBJECT
public:
DATVDemod(DeviceAPI *);
@ -58,7 +56,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual int getNbSinkStreams() const { return 1; }
virtual int getNbSourceStreams() const { return 0; }
@ -161,6 +160,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const DATVDemodSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const DATVDemodSettings& settings, bool force);

View File

@ -37,7 +37,6 @@ class QThread;
class DownChannelizer;
class DSDDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureDSDDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -70,7 +69,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -138,6 +138,7 @@ private:
static const int m_udpBlockSize;
virtual bool handleMessage(const Message& cmd);
void applySettings(const DSDDemodSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);

View File

@ -36,7 +36,6 @@ class DeviceAPI;
class QThread;
class FreeDVDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureFreeDVDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -83,7 +82,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -157,6 +157,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const FreeDVDemodSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const FreeDVDemodSettings& settings, bool force);

View File

@ -36,7 +36,6 @@ class QThread;
class DeviceAPI;
class NFMDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureNFMDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -69,7 +68,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -138,6 +138,7 @@ private:
static const int m_udpBlockSize;
virtual bool handleMessage(const Message& cmd);
void applySettings(const NFMDemodSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);

View File

@ -40,7 +40,6 @@ class QThread;
class DeviceAPI;
class PacketDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigurePacketDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -73,7 +72,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual const QString& getURI() const { return getName(); }
@ -146,6 +146,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const PacketDemodSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const PacketDemodSettings& settings, bool force);

View File

@ -42,7 +42,6 @@ class DeviceAPI;
class ScopeVis;
class PagerDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigurePagerDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -128,7 +127,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual const QString& getURI() const { return getName(); }
@ -202,6 +202,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const PagerDemodSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const PagerDemodSettings& settings, bool force);

View File

@ -38,7 +38,6 @@ class QThread;
class DeviceAPI;
class SSBDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureSSBDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -72,7 +71,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -142,6 +142,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const SSBDemodSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);

View File

@ -29,6 +29,7 @@
class DownChannelizer;
class ChannelAPI;
class SpectrumVis;
class SSBDemodBaseband : public QObject
{

View File

@ -24,7 +24,7 @@
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "dsp/devicesamplemimo.h"
#include "dsp/basebandsamplesink.h"
#include "dsp/spectrumvis.h"
#include "dsp/datafifo.h"
#include "device/deviceapi.h"
#include "util/db.h"

View File

@ -30,7 +30,7 @@
#include "ssbdemodsettings.h"
class BasebandSampleSink;
class SpectrumVis;
class ChannelAPI;
class SSBDemodSink : public ChannelSampleSink {
@ -40,7 +40,7 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end);
void setSpectrumSink(BasebandSampleSink* spectrumSink) { m_spectrumSink = spectrumSink; }
void setSpectrumSink(SpectrumVis* spectrumSink) { m_spectrumSink = spectrumSink; }
void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = false);
void applySettings(const SSBDemodSettings& settings, bool force = false);
void applyAudioSampleRate(int sampleRate);
@ -116,7 +116,7 @@ private:
fftfilt* SSBFilter;
fftfilt* DSBFilter;
BasebandSampleSink* m_spectrumSink;
SpectrumVis* m_spectrumSink;
SampleVector m_sampleBuffer;
AudioVector m_audioBuffer;

View File

@ -37,7 +37,6 @@ class QThread;
class DeviceAPI;
class VORDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureVORDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -70,7 +69,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual const QString& getURI() const { return getName(); }
@ -142,6 +142,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const VORDemodSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const VORDemodSettings& settings, bool force);

View File

@ -37,7 +37,6 @@ class QThread;
class DeviceAPI;
class VORDemodSC : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureVORDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -70,7 +69,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual const QString& getURI() const { return getName(); }
@ -143,6 +143,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const VORDemodSCSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const VORDemodSCSettings& settings, bool force);

View File

@ -35,7 +35,6 @@ class QNetworkReply;
class DeviceAPI;
class WFMDemod : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureWFMDemod : public Message {
MESSAGE_CLASS_DECLARATION
@ -68,7 +67,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -134,6 +134,7 @@ private:
static const int m_udpBlockSize;
virtual bool handleMessage(const Message& cmd);
void applySettings(const WFMDemodSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);

View File

@ -37,7 +37,6 @@ class DeviceSampleSource;
class FileSinkBaseband;
class FileSink : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureFileSink : public Message {
MESSAGE_CLASS_DECLARATION
@ -89,7 +88,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = "File Sink"; }
@ -163,6 +163,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const FileSinkSettings& settings, bool force = false);
void propagateSampleRateAndFrequency(uint32_t index, uint32_t log2Decim);
DeviceSampleSource *getLocalDevice(uint32_t index);

View File

@ -35,7 +35,6 @@ class QNetworkReply;
class DeviceAPI;
class FreqTracker : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureFreqTracker : public Message {
MESSAGE_CLASS_DECLARATION
@ -68,7 +67,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -140,6 +140,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const FreqTrackerSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const FreqTrackerSettings& settings, bool force);

View File

@ -18,7 +18,6 @@
#ifndef INCLUDE_LOCALSINK_H_
#define INCLUDE_LOCALSINK_H_
#include <QObject>
#include <QMutex>
#include <QNetworkRequest>
@ -37,7 +36,6 @@ class DeviceSampleSource;
class LocalSinkBaseband;
class LocalSink : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureLocalSink : public Message {
MESSAGE_CLASS_DECLARATION
@ -90,7 +88,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = "Local Sink"; }
@ -148,6 +147,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const LocalSinkSettings& settings, bool force = false);
void propagateSampleRateAndFrequency(uint32_t index, uint32_t log2Decim);
static void validateFilterChainHash(LocalSinkSettings& settings);

View File

@ -40,7 +40,6 @@ class QThread;
class DeviceAPI;
class NoiseFigure : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureNoiseFigure : public Message {
MESSAGE_CLASS_DECLARATION
@ -178,7 +177,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual const QString& getURI() const { return getName(); }
@ -247,6 +247,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const NoiseFigureSettings& settings, bool force = false);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const NoiseFigureSettings& settings, bool force);
void webapiFormatChannelSettings(

View File

@ -42,7 +42,6 @@ class DeviceAPI;
class RadioAstronomyWorker;
class RadioAstronomy : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureRadioAstronomy : public Message {
MESSAGE_CLASS_DECLARATION
@ -316,7 +315,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual const QString& getURI() const { return getName(); }
@ -408,6 +408,7 @@ private:
QTimer m_sweepTimer;
QMetaObject::Connection m_sweepTimerConnection;
virtual bool handleMessage(const Message& cmd);
void applySettings(const RadioAstronomySettings& settings, bool force = false);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const RadioAstronomySettings& settings, bool force);
void webapiFormatChannelSettings(

View File

@ -39,7 +39,6 @@ class DeviceAPI;
class ScopeVis;
class RadioClock : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureRadioClock : public Message {
MESSAGE_CLASS_DECLARATION
@ -118,7 +117,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual const QString& getURI() const { return getName(); }
@ -186,6 +186,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const RadioClockSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const RadioClockSettings& settings, bool force);

View File

@ -37,7 +37,6 @@ class QNetworkReply;
class DeviceAPI;
class RemoteSink : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureRemoteSink : public Message {
MESSAGE_CLASS_DECLARATION
@ -70,7 +69,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = "Remote Sink"; }
@ -128,6 +128,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const RemoteSinkSettings& settings, bool force = false);
static void validateFilterChainHash(RemoteSinkSettings& settings);
void calculateFrequencyOffset();

View File

@ -37,7 +37,6 @@ class DeviceSampleSource;
class SigMFFileSinkBaseband;
class SigMFFileSink : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureSigMFFileSink : public Message {
MESSAGE_CLASS_DECLARATION
@ -89,7 +88,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = "SigMF File Sink"; }
@ -163,6 +163,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const SigMFFileSinkSettings& settings, bool force = false);
void propagateSampleRateAndFrequency(uint32_t index, uint32_t log2Decim);
DeviceSampleSource *getLocalDevice(uint32_t index);

View File

@ -34,8 +34,6 @@ class QNetworkReply;
class DeviceAPI;
class UDPSink : public BasebandSampleSink, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureUDPSink : public Message {
MESSAGE_CLASS_DECLARATION
@ -76,7 +74,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -142,8 +141,9 @@ protected:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
void applySettings(const UDPSinkSettings& settings, bool force = false);
virtual bool handleMessage(const Message& cmd);
void applySettings(const UDPSinkSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const UDPSinkSettings& settings, bool force);
void sendChannelSettings(

View File

@ -42,8 +42,6 @@ class DeviceAPI;
class FileSourceBaseband;
class FileSource : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureFileSource : public Message {
MESSAGE_CLASS_DECLARATION
@ -172,7 +170,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -249,6 +248,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const FileSourceSettings& settings, bool force = false);
static void validateFilterChainHash(FileSourceSettings& settings);
void calculateFrequencyOffset();

View File

@ -35,7 +35,6 @@ class DeviceSampleSink;
class LocalSourceBaseband;
class LocalSource : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureLocalSource : public Message {
MESSAGE_CLASS_DECLARATION
@ -87,7 +86,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = "Local Sink"; }
@ -145,6 +145,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const LocalSourceSettings& settings, bool force = false);
void propagateSampleRateAndFrequency(uint32_t index, uint32_t log2Interp);
static void validateFilterChainHash(LocalSourceSettings& settings);

View File

@ -42,8 +42,6 @@ class IEEE_802_15_4_ModBaseband;
class ScopeVis;
class IEEE_802_15_4_Mod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureIEEE_802_15_4_Mod : public Message {
MESSAGE_CLASS_DECLARATION
@ -96,7 +94,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -168,6 +167,7 @@ private:
QNetworkRequest m_networkRequest;
// QUdpSocket *m_udpSocket;
virtual bool handleMessage(const Message& cmd);
void applySettings(const IEEE_802_15_4_ModSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const IEEE_802_15_4_ModSettings& settings, bool force);

View File

@ -40,8 +40,6 @@ class AISModBaseband;
class ScopeVis;
class AISMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureAISMod : public Message {
MESSAGE_CLASS_DECLARATION
@ -157,7 +155,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -229,6 +228,7 @@ private:
QNetworkRequest m_networkRequest;
QUdpSocket *m_udpSocket;
virtual bool handleMessage(const Message& cmd);
void applySettings(const AISModSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);

View File

@ -39,8 +39,6 @@ class DeviceAPI;
class CWKeyer;
class AMMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureAMMod : public Message {
MESSAGE_CLASS_DECLARATION
@ -179,7 +177,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -255,6 +254,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const AMModSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void openFileStream();

View File

@ -38,8 +38,6 @@ class ATVModBaseband;
class DeviceAPI;
class ATVMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureATVMod : public Message {
MESSAGE_CLASS_DECLARATION
@ -251,7 +249,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -314,6 +313,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const ATVModSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const ATVModSettings& settings, bool force);

View File

@ -41,8 +41,6 @@ class CWKeyer;
class ChirpChatModBaseband;
class ChirpChatMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureChirpChatMod : public Message {
MESSAGE_CLASS_DECLARATION
@ -94,7 +92,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -163,6 +162,7 @@ private:
QNetworkRequest m_networkRequest;
QUdpSocket *m_udpSocket;
virtual bool handleMessage(const Message& cmd);
void applySettings(const ChirpChatModSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const ChirpChatModSettings& settings, bool force);

View File

@ -39,8 +39,6 @@ class DATVModBaseband;
class DeviceAPI;
class DATVMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureDATVMod : public Message {
MESSAGE_CLASS_DECLARATION
@ -207,7 +205,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -268,6 +267,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const DATVModSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const DATVModSettings& settings, bool force);

View File

@ -43,8 +43,6 @@ class FreeDVModBaseband;
struct freedv;
class FreeDVMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureFreeDVMod : public Message {
MESSAGE_CLASS_DECLARATION
@ -183,7 +181,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -263,6 +262,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const FreeDVModSettings& settings, bool force = false);
void openFileStream();
void seekFileStream(int seekPercentage);

View File

@ -39,8 +39,6 @@ class CWKeyer;
class NFMModBaseband;
class NFMMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureNFMMod : public Message {
MESSAGE_CLASS_DECLARATION
@ -179,7 +177,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -255,6 +254,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const NFMModSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void openFileStream();

View File

@ -41,8 +41,6 @@ class DeviceAPI;
class PacketModBaseband;
class PacketMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigurePacketMod : public Message {
MESSAGE_CLASS_DECLARATION
@ -147,7 +145,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -225,6 +224,7 @@ private:
QNetworkRequest m_networkRequest;
QUdpSocket *m_udpSocket;
virtual bool handleMessage(const Message& cmd);
void applySettings(const PacketModSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);

View File

@ -41,8 +41,6 @@ class CWKeyer;
class SSBModBaseband;
class SSBMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureSSBMod : public Message {
MESSAGE_CLASS_DECLARATION
@ -181,7 +179,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -259,6 +258,7 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd);
void applySettings(const SSBModSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void openFileStream();

View File

@ -39,8 +39,6 @@ class CWKeyer;
class WFMModBaseband;
class WFMMod : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureWFMMod : public Message {
MESSAGE_CLASS_DECLARATION
@ -179,7 +177,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -267,6 +266,7 @@ private:
static const int m_levelNbSamples;
virtual bool handleMessage(const Message& cmd);
void applySettings(const WFMModSettings& settings, bool force = false);
void sendSampleRateToDemodAnalyzer();
void openFileStream();

View File

@ -35,8 +35,6 @@ class DeviceAPI;
class RemoteSourceBaseband;
class RemoteSource : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureRemoteSource : public Message {
MESSAGE_CLASS_DECLARATION
@ -183,7 +181,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -244,6 +243,7 @@ private:
int64_t m_frequencyOffset;
uint32_t m_basebandSampleRate;
virtual bool handleMessage(const Message& cmd);
void applySettings(const RemoteSourceSettings& settings, bool force = false);
static void validateFilterChainHash(RemoteSourceSettings& settings);
void calculateFrequencyOffset(uint32_t log2Interp, uint32_t filterChainHash);

View File

@ -36,8 +36,6 @@ class DeviceAPI;
class UDPSourceBaseband;
class UDPSource : public BasebandSampleSource, public ChannelAPI {
Q_OBJECT
public:
class MsgConfigureUDPSource : public Message {
MESSAGE_CLASS_DECLARATION
@ -100,7 +98,8 @@ public:
virtual void start();
virtual void stop();
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples);
virtual bool handleMessage(const Message& cmd);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSourceName() { return objectName(); }
virtual void getIdentifier(QString& id) { id = objectName(); }
virtual void getTitle(QString& title) { title = m_settings.m_title; }
@ -172,8 +171,9 @@ private:
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;
void applySettings(const UDPSourceSettings& settings, bool force = false);
virtual bool handleMessage(const Message& cmd);
void applySettings(const UDPSourceSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const UDPSourceSettings& settings, bool force);
void sendChannelSettings(

View File

@ -143,7 +143,6 @@ set(sdrbase_SOURCES
dsp/scopevis.cpp
dsp/basebandsamplesink.cpp
dsp/basebandsamplesource.cpp
dsp/nullsink.cpp
dsp/recursivefilters.cpp
dsp/wfir.cpp
dsp/devicesamplesource.cpp
@ -351,7 +350,6 @@ set(sdrbase_HEADERS
dsp/scopevis.h
dsp/basebandsamplesink.h
dsp/basebandsamplesource.h
dsp/nullsink.h
dsp/wfir.h
dsp/devicesamplesource.h
dsp/devicesamplesink.h

View File

@ -30,4 +30,18 @@ ChannelAPI::ChannelAPI(const QString& uri, StreamType streamType) :
m_deviceSetIndex(0),
m_deviceAPI(0),
m_uid(UidCalculator::getNewObjectId())
{ }
{
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
}
void ChannelAPI::handleInputMessages()
{
Message* message;
while ((message = m_inputMessageQueue.pop()) != 0)
{
if (handleMessage(*message)) {
delete message;
}
}
}

View File

@ -20,6 +20,7 @@
#ifndef SDRBASE_CHANNEL_CHANNELAPI_H_
#define SDRBASE_CHANNEL_CHANNELAPI_H_
#include <QObject>
#include <QString>
#include <QByteArray>
#include <QList>
@ -39,7 +40,8 @@ namespace SWGSDRangel
class SWGChannelActions;
}
class SDRBASE_API ChannelAPI : public PipeEndPoint {
class SDRBASE_API ChannelAPI : public QObject, public PipeEndPoint {
Q_OBJECT
public:
enum StreamType //!< This is the same enum as in PluginInterface
{
@ -65,6 +67,7 @@ public:
virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
MessageQueue *getChannelMessageQueue() { return &m_channelMessageQueue; } //!< Get the queue for plugin communication
/**
@ -141,8 +144,13 @@ public:
}
protected:
virtual bool handleMessage(const Message& cmd) = 0; //!< Processing of a message. Returns true if message has actually been processed
MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI
MessageQueue m_channelMessageQueue; //!< Input message queue for inter plugin communication
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
protected slots:
void handleInputMessages();
private:
StreamType m_streamType;

View File

@ -21,28 +21,8 @@
BasebandSampleSink::BasebandSampleSink()
{
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
}
BasebandSampleSink::~BasebandSampleSink()
{
}
void BasebandSampleSink::pushMessage(Message *msg)
{
m_inputMessageQueue.push(msg);
}
void BasebandSampleSink::handleInputMessages()
{
Message* message;
while ((message = m_inputMessageQueue.pop()) != 0)
{
if (handleMessage(*message))
{
delete message;
}
}
}

View File

@ -19,15 +19,13 @@
#ifndef INCLUDE_SAMPLESINK_H
#define INCLUDE_SAMPLESINK_H
#include <QObject>
#include "dsp/dsptypes.h"
#include "export.h"
#include "util/messagequeue.h"
class Message;
class SDRBASE_API BasebandSampleSink : public QObject {
Q_OBJECT
class SDRBASE_API BasebandSampleSink {
public:
BasebandSampleSink();
virtual ~BasebandSampleSink();
@ -35,22 +33,10 @@ public:
virtual void start() = 0;
virtual void stop() = 0;
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly) = 0;
void pushMessage(Message *msg);
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
virtual void feed(const Complex *begin, unsigned int length) //!< Special feed directly with complex array
{
(void) begin;
(void) length;
virtual void feed(const Complex*, unsigned int) { //!< Special feed directly with complex array
}
protected:
virtual bool handleMessage(const Message& cmd) = 0; //!< Processing of a message. Returns true if message has actually been processed
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
protected slots:
void handleInputMessages();
virtual void pushMessage(Message *msg) = 0;
virtual QString getSinkName() = 0;
};
#endif // INCLUDE_SAMPLESINK_H

View File

@ -21,26 +21,8 @@
BasebandSampleSource::BasebandSampleSource()
{
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
}
BasebandSampleSource::~BasebandSampleSource()
{
}
void BasebandSampleSource::pushMessage(Message *msg)
{
m_inputMessageQueue.push(msg);
}
void BasebandSampleSource::handleInputMessages()
{
Message* message;
while ((message = m_inputMessageQueue.pop()) != 0)
{
if (handleMessage(*message)) {
delete message;
}
}
}

View File

@ -19,15 +19,13 @@
#ifndef SDRBASE_DSP_BASEBANDSAMPLESOURCE_H_
#define SDRBASE_DSP_BASEBANDSAMPLESOURCE_H_
#include <QObject>
#include "dsp/dsptypes.h"
#include "export.h"
#include "util/messagequeue.h"
class Message;
class SDRBASE_API BasebandSampleSource : public QObject {
Q_OBJECT
class SDRBASE_API BasebandSampleSource {
public:
BasebandSampleSource();
virtual ~BasebandSampleSource();
@ -35,16 +33,8 @@ public:
virtual void start() = 0;
virtual void stop() = 0;
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples) = 0;
void pushMessage(Message *msg);
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
protected:
virtual bool handleMessage(const Message& cmd) = 0; //!< Processing of a message. Returns true if message has actually been processed
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
protected slots:
void handleInputMessages();
virtual void pushMessage(Message *msg) = 0;
virtual QString getSourceName() = 0;
};
#endif /* SDRBASE_DSP_BASEBANDSAMPLESOURCE_H_ */

View File

@ -152,7 +152,7 @@ void DSPDeviceMIMOEngine::setMIMOSequence(int sequence)
void DSPDeviceMIMOEngine::addChannelSource(BasebandSampleSource* source, int index)
{
qDebug() << "DSPDeviceMIMOEngine::addChannelSource: "
<< source->objectName().toStdString().c_str()
<< source->getSourceName().toStdString().c_str()
<< " at: "
<< index;
AddBasebandSampleSource cmd(source, index);
@ -162,7 +162,7 @@ void DSPDeviceMIMOEngine::addChannelSource(BasebandSampleSource* source, int ind
void DSPDeviceMIMOEngine::removeChannelSource(BasebandSampleSource* source, int index)
{
qDebug() << "DSPDeviceMIMOEngine::removeChannelSource: "
<< source->objectName().toStdString().c_str()
<< source->getSourceName().toStdString().c_str()
<< " at: "
<< index;
RemoveBasebandSampleSource cmd(source, index);
@ -172,7 +172,7 @@ void DSPDeviceMIMOEngine::removeChannelSource(BasebandSampleSource* source, int
void DSPDeviceMIMOEngine::addChannelSink(BasebandSampleSink* sink, int index)
{
qDebug() << "DSPDeviceMIMOEngine::addChannelSink: "
<< sink->objectName().toStdString().c_str()
<< sink->getSinkName().toStdString().c_str()
<< " at: "
<< index;
AddBasebandSampleSink cmd(sink, index);
@ -182,7 +182,7 @@ void DSPDeviceMIMOEngine::addChannelSink(BasebandSampleSink* sink, int index)
void DSPDeviceMIMOEngine::removeChannelSink(BasebandSampleSink* sink, int index)
{
qDebug() << "DSPDeviceMIMOEngine::removeChannelSink: "
<< sink->objectName().toStdString().c_str()
<< sink->getSinkName().toStdString().c_str()
<< " at: "
<< index;
RemoveBasebandSampleSink cmd(sink, index);
@ -192,7 +192,7 @@ void DSPDeviceMIMOEngine::removeChannelSink(BasebandSampleSink* sink, int index)
void DSPDeviceMIMOEngine::addMIMOChannel(MIMOChannel *channel)
{
qDebug() << "DSPDeviceMIMOEngine::addMIMOChannel: "
<< channel->objectName().toStdString().c_str();
<< channel->getMIMOName().toStdString().c_str();
AddMIMOChannel cmd(channel);
m_syncMessenger.sendWait(cmd);
}
@ -200,21 +200,21 @@ void DSPDeviceMIMOEngine::addMIMOChannel(MIMOChannel *channel)
void DSPDeviceMIMOEngine::removeMIMOChannel(MIMOChannel *channel)
{
qDebug() << "DSPDeviceMIMOEngine::removeMIMOChannel: "
<< channel->objectName().toStdString().c_str();
<< channel->getMIMOName().toStdString().c_str();
RemoveMIMOChannel cmd(channel);
m_syncMessenger.sendWait(cmd);
}
void DSPDeviceMIMOEngine::addSpectrumSink(BasebandSampleSink* spectrumSink)
{
qDebug() << "DSPDeviceMIMOEngine::addSpectrumSink: " << spectrumSink->objectName().toStdString().c_str();
qDebug() << "DSPDeviceMIMOEngine::addSpectrumSink: " << spectrumSink->getSinkName().toStdString().c_str();
AddSpectrumSink cmd(spectrumSink);
m_syncMessenger.sendWait(cmd);
}
void DSPDeviceMIMOEngine::removeSpectrumSink(BasebandSampleSink* spectrumSink)
{
qDebug() << "DSPDeviceSinkEngine::removeSpectrumSink: " << spectrumSink->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSinkEngine::removeSpectrumSink: " << spectrumSink->getSinkName().toStdString().c_str();
DSPRemoveSpectrumSink cmd(spectrumSink);
m_syncMessenger.sendWait(cmd);
}
@ -505,14 +505,14 @@ DSPDeviceMIMOEngine::State DSPDeviceMIMOEngine::gotoIdle(int subsystemIndex)
{
for (BasebandSampleSinks::const_iterator it = vbit->begin(); it != vbit->end(); ++it)
{
qDebug() << "DSPDeviceMIMOEngine::gotoIdle: stopping BasebandSampleSink: " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceMIMOEngine::gotoIdle: stopping BasebandSampleSink: " << (*it)->getSinkName().toStdString().c_str();
(*it)->stop();
}
}
for (MIMOChannels::const_iterator it = m_mimoChannels.begin(); it != m_mimoChannels.end(); ++it)
{
qDebug() << "DSPDeviceMIMOEngine::gotoIdle: stopping MIMOChannel sinks: " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceMIMOEngine::gotoIdle: stopping MIMOChannel sinks: " << (*it)->getMIMOName().toStdString().c_str();
(*it)->stopSinks();
}
}
@ -539,14 +539,14 @@ DSPDeviceMIMOEngine::State DSPDeviceMIMOEngine::gotoIdle(int subsystemIndex)
{
for (BasebandSampleSources::const_iterator it = vSourceIt->begin(); it != vSourceIt->end(); ++it)
{
qDebug() << "DSPDeviceMIMOEngine::gotoIdle: stopping BasebandSampleSource(" << (*it)->objectName().toStdString().c_str() << ")";
qDebug() << "DSPDeviceMIMOEngine::gotoIdle: stopping BasebandSampleSource(" << (*it)->getSourceName().toStdString().c_str() << ")";
(*it)->stop();
}
}
for (MIMOChannels::const_iterator it = m_mimoChannels.begin(); it != m_mimoChannels.end(); ++it)
{
qDebug() << "DSPDeviceMIMOEngine::gotoIdle: stopping MIMOChannel sources: " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceMIMOEngine::gotoIdle: stopping MIMOChannel sources: " << (*it)->getMIMOName().toStdString().c_str();
(*it)->stopSources();
}
}
@ -612,7 +612,7 @@ DSPDeviceMIMOEngine::State DSPDeviceMIMOEngine::gotoInit(int subsystemIndex)
{
for (BasebandSampleSinks::const_iterator it = m_basebandSampleSinks[isource].begin(); it != m_basebandSampleSinks[isource].end(); ++it)
{
qDebug() << "DSPDeviceMIMOEngine::gotoInit: initializing " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceMIMOEngine::gotoInit: initializing " << (*it)->getSinkName().toStdString().c_str();
(*it)->pushMessage(new DSPSignalNotification(notif));
}
}
@ -649,7 +649,7 @@ DSPDeviceMIMOEngine::State DSPDeviceMIMOEngine::gotoInit(int subsystemIndex)
{
for (BasebandSampleSources::const_iterator it = m_basebandSampleSources[isink].begin(); it != m_basebandSampleSources[isink].end(); ++it)
{
qDebug() << "DSPDeviceMIMOEngine::gotoInit: initializing BasebandSampleSource(" << (*it)->objectName().toStdString().c_str() << ")";
qDebug() << "DSPDeviceMIMOEngine::gotoInit: initializing BasebandSampleSource(" << (*it)->getSourceName().toStdString().c_str() << ")";
(*it)->pushMessage(new DSPSignalNotification(notif));
}
}
@ -697,14 +697,14 @@ DSPDeviceMIMOEngine::State DSPDeviceMIMOEngine::gotoRunning(int subsystemIndex)
{
for (BasebandSampleSinks::const_iterator it = vbit->begin(); it != vbit->end(); ++it)
{
qDebug() << "DSPDeviceMIMOEngine::gotoRunning: starting BasebandSampleSink: " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceMIMOEngine::gotoRunning: starting BasebandSampleSink: " << (*it)->getSinkName().toStdString().c_str();
(*it)->start();
}
}
for (MIMOChannels::const_iterator it = m_mimoChannels.begin(); it != m_mimoChannels.end(); ++it)
{
qDebug() << "DSPDeviceMIMOEngine::gotoRunning: starting MIMOChannel sinks: " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceMIMOEngine::gotoRunning: starting MIMOChannel sinks: " << (*it)->getMIMOName().toStdString().c_str();
(*it)->startSinks();
}
}
@ -736,14 +736,14 @@ DSPDeviceMIMOEngine::State DSPDeviceMIMOEngine::gotoRunning(int subsystemIndex)
{
for (BasebandSampleSources::const_iterator it = vSourceIt->begin(); it != vSourceIt->end(); ++it)
{
qDebug() << "DSPDeviceMIMOEngine::gotoRunning: starting BasebandSampleSource(" << (*it)->objectName().toStdString().c_str() << ")";
qDebug() << "DSPDeviceMIMOEngine::gotoRunning: starting BasebandSampleSource(" << (*it)->getSourceName().toStdString().c_str() << ")";
(*it)->start();
}
}
for (MIMOChannels::const_iterator it = m_mimoChannels.begin(); it != m_mimoChannels.end(); ++it)
{
qDebug() << "DSPDeviceMIMOEngine::gotoRunning: starting MIMOChannel sources: " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceMIMOEngine::gotoRunning: starting MIMOChannel sources: " << (*it)->getMIMOName().toStdString().c_str();
(*it)->startSources();
}
}
@ -1179,7 +1179,7 @@ void DSPDeviceMIMOEngine::handleInputMessages()
for (BasebandSampleSinks::const_iterator it = m_basebandSampleSinks[istream].begin(); it != m_basebandSampleSinks[istream].end(); ++it)
{
DSPSignalNotification *message = new DSPSignalNotification(sampleRate, centerFrequency);
qDebug() << "DSPDeviceMIMOEngine::handleInputMessages: starting " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceMIMOEngine::handleInputMessages: starting " << (*it)->getSinkName().toStdString().c_str();
(*it)->pushMessage(message);
}
}
@ -1212,7 +1212,7 @@ void DSPDeviceMIMOEngine::handleInputMessages()
for (BasebandSampleSources::const_iterator it = m_basebandSampleSources[istream].begin(); it != m_basebandSampleSources[istream].end(); ++it)
{
DSPSignalNotification *message = new DSPSignalNotification(sampleRate, centerFrequency);
qDebug() << "DSPDeviceMIMOEngine::handleSinkMessages: forward message to BasebandSampleSource(" << (*it)->objectName().toStdString().c_str() << ")";
qDebug() << "DSPDeviceMIMOEngine::handleSinkMessages: forward message to BasebandSampleSource(" << (*it)->getSourceName().toStdString().c_str() << ")";
(*it)->pushMessage(message);
}
}

View File

@ -112,28 +112,28 @@ void DSPDeviceSinkEngine::setSinkSequence(int sequence)
void DSPDeviceSinkEngine::addChannelSource(BasebandSampleSource* source)
{
qDebug() << "DSPDeviceSinkEngine::addChannelSource: " << source->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSinkEngine::addChannelSource: " << source->getSourceName().toStdString().c_str();
DSPAddBasebandSampleSource cmd(source);
m_syncMessenger.sendWait(cmd);
}
void DSPDeviceSinkEngine::removeChannelSource(BasebandSampleSource* source)
{
qDebug() << "DSPDeviceSinkEngine::removeChannelSource: " << source->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSinkEngine::removeChannelSource: " << source->getSourceName().toStdString().c_str();
DSPRemoveBasebandSampleSource cmd(source);
m_syncMessenger.sendWait(cmd);
}
void DSPDeviceSinkEngine::addSpectrumSink(BasebandSampleSink* spectrumSink)
{
qDebug() << "DSPDeviceSinkEngine::addSpectrumSink: " << spectrumSink->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSinkEngine::addSpectrumSink: " << spectrumSink->getSinkName().toStdString().c_str();
DSPAddSpectrumSink cmd(spectrumSink);
m_syncMessenger.sendWait(cmd);
}
void DSPDeviceSinkEngine::removeSpectrumSink(BasebandSampleSink* spectrumSink)
{
qDebug() << "DSPDeviceSinkEngine::removeSpectrumSink: " << spectrumSink->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSinkEngine::removeSpectrumSink: " << spectrumSink->getSinkName().toStdString().c_str();
DSPRemoveSpectrumSink cmd(spectrumSink);
m_syncMessenger.sendWait(cmd);
}
@ -268,7 +268,7 @@ DSPDeviceSinkEngine::State DSPDeviceSinkEngine::gotoIdle()
for(BasebandSampleSources::const_iterator it = m_basebandSampleSources.begin(); it != m_basebandSampleSources.end(); it++)
{
qDebug() << "DSPDeviceSinkEngine::gotoIdle: stopping " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSinkEngine::gotoIdle: stopping " << (*it)->getSourceName().toStdString().c_str();
(*it)->stop();
}
@ -315,7 +315,7 @@ DSPDeviceSinkEngine::State DSPDeviceSinkEngine::gotoInit()
for (BasebandSampleSources::const_iterator it = m_basebandSampleSources.begin(); it != m_basebandSampleSources.end(); ++it)
{
qDebug() << "DSPDeviceSinkEngine::gotoInit: initializing " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSinkEngine::gotoInit: initializing " << (*it)->getSourceName().toStdString().c_str();
(*it)->pushMessage(new DSPSignalNotification(notif));
}
@ -368,7 +368,7 @@ DSPDeviceSinkEngine::State DSPDeviceSinkEngine::gotoRunning()
for(BasebandSampleSources::const_iterator it = m_basebandSampleSources.begin(); it != m_basebandSampleSources.end(); it++)
{
qDebug() << "DSPDeviceSinkEngine::gotoRunning: starting " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSinkEngine::gotoRunning: starting " << (*it)->getSourceName().toStdString().c_str();
(*it)->start();
}
@ -519,7 +519,7 @@ void DSPDeviceSinkEngine::handleInputMessages()
for(BasebandSampleSources::const_iterator it = m_basebandSampleSources.begin(); it != m_basebandSampleSources.end(); it++)
{
DSPSignalNotification* rep = new DSPSignalNotification(*notif); // make a copy
qDebug() << "DSPDeviceSinkEngine::handleInputMessages: forward message to " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSinkEngine::handleInputMessages: forward message to " << (*it)->getSourceName().toStdString().c_str();
(*it)->pushMessage(rep);
}

View File

@ -122,14 +122,14 @@ void DSPDeviceSourceEngine::setSourceSequence(int sequence)
void DSPDeviceSourceEngine::addSink(BasebandSampleSink* sink)
{
qDebug() << "DSPDeviceSourceEngine::addSink: " << sink->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSourceEngine::addSink: " << sink->getSinkName().toStdString().c_str();
DSPAddBasebandSampleSink cmd(sink);
m_syncMessenger.sendWait(cmd);
}
void DSPDeviceSourceEngine::removeSink(BasebandSampleSink* sink)
{
qDebug() << "DSPDeviceSourceEngine::removeSink: " << sink->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSourceEngine::removeSink: " << sink->getSinkName().toStdString().c_str();
DSPRemoveBasebandSampleSink cmd(sink);
m_syncMessenger.sendWait(cmd);
}
@ -444,7 +444,7 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoInit()
for (BasebandSampleSinks::const_iterator it = m_basebandSampleSinks.begin(); it != m_basebandSampleSinks.end(); ++it)
{
DSPSignalNotification *notif = new DSPSignalNotification(m_sampleRate, m_centerFrequency);
qDebug() << "DSPDeviceSourceEngine::gotoInit: initializing " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSourceEngine::gotoInit: initializing " << (*it)->getSinkName().toStdString().c_str();
(*it)->pushMessage(notif);
}
@ -493,7 +493,7 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoRunning()
for(BasebandSampleSinks::const_iterator it = m_basebandSampleSinks.begin(); it != m_basebandSampleSinks.end(); it++)
{
qDebug() << "DSPDeviceSourceEngine::gotoRunning: starting " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSourceEngine::gotoRunning: starting " << (*it)->getSinkName().toStdString().c_str();
(*it)->start();
}
@ -659,7 +659,7 @@ void DSPDeviceSourceEngine::handleInputMessages()
for(BasebandSampleSinks::const_iterator it = m_basebandSampleSinks.begin(); it != m_basebandSampleSinks.end(); it++)
{
DSPSignalNotification* rep = new DSPSignalNotification(*notif); // make a copy
qDebug() << "DSPDeviceSourceEngine::handleInputMessages: forward message to " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSourceEngine::handleInputMessages: forward message to " << (*it)->getSinkName().toStdString().c_str();
(*it)->pushMessage(rep);
}

View File

@ -20,26 +20,8 @@
MIMOChannel::MIMOChannel()
{
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
}
MIMOChannel::~MIMOChannel()
{
}
void MIMOChannel::pushMessage(Message *msg)
{
m_inputMessageQueue.push(msg);
}
void MIMOChannel::handleInputMessages()
{
Message* message;
while ((message = m_inputMessageQueue.pop()) != 0)
{
if (handleMessage(*message)) {
delete message;
}
}
}

View File

@ -19,16 +19,13 @@
#ifndef SDRBASE_MIMOCHANNEL_H
#define SDRBASE_MIMOCHANNEL_H
#include <QObject>
#include "export.h"
#include "dsp/dsptypes.h"
#include "util/messagequeue.h"
#include "util/message.h"
class SDRBASE_API MIMOChannel : public QObject {
Q_OBJECT
class SDRBASE_API MIMOChannel {
public:
MIMOChannel();
virtual ~MIMOChannel();
@ -39,16 +36,8 @@ public:
virtual void stopSources() = 0;
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, unsigned int sinkIndex) = 0;
virtual void pull(SampleVector::iterator& begin, unsigned int nbSamples, unsigned int sourceIndex) = 0;
void pushMessage(Message *msg);
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
protected:
virtual bool handleMessage(const Message& cmd) = 0; //!< Processing of a message. Returns true if message has actually been processed
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
protected slots:
void handleInputMessages();
virtual void pushMessage(Message *msg) = 0;
virtual QString getMIMOName() = 0;
};
#endif // SDRBASE_MIMOCHANNEL_H

View File

@ -1,39 +0,0 @@
#include "dsp/nullsink.h"
#include "dsp/dspcommands.h"
#include "util/messagequeue.h"
NullSink::NullSink()
{
setObjectName("NullSink");
}
NullSink::~NullSink()
{
}
bool NullSink::init(const Message& message)
{
(void) message;
return false;
}
void NullSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly)
{
(void) begin;
(void) end;
(void) positiveOnly;
}
void NullSink::start()
{
}
void NullSink::stop()
{
}
bool NullSink::handleMessage(const Message& message)
{
(void) message;
return false;
}

View File

@ -1,23 +0,0 @@
#ifndef INCLUDE_NULLSINK_H
#define INCLUDE_NULLSINK_H
#include <dsp/basebandsamplesink.h>
#include "export.h"
class Message;
class SDRBASE_API NullSink : public BasebandSampleSink {
public:
NullSink();
virtual ~NullSink();
virtual bool init(const Message& cmd);
using BasebandSampleSink::feed;
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& message);
};
#endif // INCLUDE_NULLSINK_H

View File

@ -66,6 +66,7 @@ SpectrumVis::SpectrumVis(Real scalef) :
m_mutex(QMutex::Recursive)
{
setObjectName("SpectrumVis");
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
applySettings(m_settings, true);
}
@ -78,13 +79,13 @@ SpectrumVis::~SpectrumVis()
void SpectrumVis::setScalef(Real scalef)
{
MsgConfigureScalingFactor* cmd = new MsgConfigureScalingFactor(scalef);
getInputMessageQueue()->push(cmd);
m_inputMessageQueue.push(cmd);
}
void SpectrumVis::configureWSSpectrum(const QString& address, uint16_t port)
{
MsgConfigureWSpectrum* cmd = new MsgConfigureWSpectrum(address, port);
getInputMessageQueue()->push(cmd);
m_inputMessageQueue.push(cmd);
}
void SpectrumVis::feedTriggered(const SampleVector::const_iterator& triggerPoint, const SampleVector::const_iterator& end, bool positiveOnly)
@ -764,6 +765,28 @@ void SpectrumVis::stop()
}
}
void SpectrumVis::pushMessage(Message *msg)
{
m_inputMessageQueue.push(msg);
}
QString SpectrumVis::getSinkName()
{
return objectName();
}
void SpectrumVis::handleInputMessages()
{
Message* message;
while ((message = m_inputMessageQueue.pop()) != 0)
{
if (handleMessage(*message)) {
delete message;
}
}
}
bool SpectrumVis::handleMessage(const Message& message)
{
if (DSPSignalNotification::match(message))

View File

@ -18,6 +18,7 @@
#ifndef INCLUDE_SPECTRUMVIS_H
#define INCLUDE_SPECTRUMVIS_H
#include <QObject>
#include <QMutex>
#include "dsp/basebandsamplesink.h"
@ -26,13 +27,13 @@
#include "dsp/spectrumsettings.h"
#include "export.h"
#include "util/message.h"
#include "util/messagequeue.h"
#include "util/movingaverage2d.h"
#include "util/fixedaverage2d.h"
#include "util/max2d.h"
#include "websockets/wsspectrum.h"
class GLSpectrumInterface;
class MessageQueue;
namespace SWGSDRangel {
class SWGGLSpectrum;
@ -40,8 +41,8 @@ namespace SWGSDRangel {
class SWGSuccessResponse;
};
class SDRBASE_API SpectrumVis : public BasebandSampleSink {
class SDRBASE_API SpectrumVis : public QObject, public BasebandSampleSink {
Q_OBJECT
public:
class SDRBASE_API MsgConfigureSpectrumVis : public Message {
MESSAGE_CLASS_DECLARATION
@ -153,7 +154,9 @@ public:
void feedTriggered(const SampleVector::const_iterator& triggerPoint, const SampleVector::const_iterator& end, bool positiveOnly);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& message);
virtual void pushMessage(Message *msg);
virtual QString getSinkName();
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
@ -237,6 +240,7 @@ private:
Real m_powFFTDiv;
static const Real m_mult;
MessageQueue m_inputMessageQueue;
MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI
QMutex m_mutex;
@ -244,6 +248,7 @@ private:
void processFFT(bool positiveOnly);
void setRunning(bool running) { m_running = running; }
void applySettings(const SpectrumSettings& settings, bool force = false);
bool handleMessage(const Message& message);
void handleConfigureDSP(uint64_t centerFrequency, int sampleRate);
void handleScalef(Real scalef);
void handleWSOpenClose(bool openClose);
@ -254,6 +259,9 @@ private:
SpectrumSettings& settings,
const QStringList& spectrumSettingsKeys,
SWGSDRangel::SWGGLSpectrum& response);
private slots:
void handleInputMessages();
};
#endif // INCLUDE_SPECTRUMVIS_H

View File

@ -20,6 +20,7 @@
#include <thread>
#include "scopevisxy.h"
#include "util/message.h"
#include "gui/tvscreen.h"
ScopeVisXY::ScopeVisXY(TVScreen *tvScreen) :
@ -102,6 +103,18 @@ void ScopeVisXY::stop()
{
}
void ScopeVisXY::handleInputMessages()
{
Message* message;
while ((message = m_inputMessageQueue.pop()) != 0)
{
if (handleMessage(*message)) {
delete message;
}
}
}
bool ScopeVisXY::handleMessage(const Message& message)
{
(void) message;

View File

@ -21,15 +21,17 @@
#include "dsp/basebandsamplesink.h"
#include "export.h"
#include "util/message.h"
#include "util/messagequeue.h"
#include <QObject>
#include <QColor>
#include <vector>
#include <complex>
class TVScreen;
class SDRGUI_API ScopeVisXY : public BasebandSampleSink {
class SDRGUI_API ScopeVisXY : public QObject, public BasebandSampleSink {
Q_OBJECT
public:
ScopeVisXY(TVScreen *tvScreen);
virtual ~ScopeVisXY();
@ -38,7 +40,8 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly);
virtual void start();
virtual void stop();
virtual bool handleMessage(const Message& message);
virtual void pushMessage(Message *msg) { m_inputMessageQueue.push(msg); }
virtual QString getSinkName() { return objectName(); }
void setScale(float scale) { m_scale = scale; }
void setStroke(int stroke) { m_alphaTrace = stroke; }
@ -53,6 +56,7 @@ public:
void clearGraticule();
private:
virtual bool handleMessage(const Message& message);
void drawGraticule();
TVScreen *m_tvScreen;
@ -68,6 +72,10 @@ private:
std::vector<std::complex<float> > m_graticule;
std::vector<int> m_graticuleRows;
std::vector<int> m_graticuleCols;
MessageQueue m_inputMessageQueue;
private slots:
void handleInputMessages();
};