1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-28 15:56:33 -04:00

v7: rename VORDemodSC classes to VORDemod classes. Part of #1223

This commit is contained in:
f4exb 2022-05-01 11:43:23 +02:00
parent c2bcd990b9
commit ca44e253ec
21 changed files with 210 additions and 210 deletions

View File

@ -1,4 +1,4 @@
<h1>VOR demodulator plugin - Single channel version</h1> <h1>VOR demodulator plugin</h1>
<h2>Introduction</h2> <h2>Introduction</h2>

View File

@ -42,19 +42,19 @@
#include "vordemodscreport.h" #include "vordemodscreport.h"
#include "vordemodsc.h" #include "vordemodsc.h"
MESSAGE_CLASS_DEFINITION(VORDemodSC::MsgConfigureVORDemod, Message) MESSAGE_CLASS_DEFINITION(VORDemod::MsgConfigureVORDemod, Message)
const char * const VORDemodSC::m_channelIdURI = "sdrangel.channel.vordemodsc"; const char * const VORDemod::m_channelIdURI = "sdrangel.channel.vordemodsc";
const char * const VORDemodSC::m_channelId = "VORDemodSC"; const char * const VORDemod::m_channelId = "VORDemod";
VORDemodSC::VORDemodSC(DeviceAPI *deviceAPI) : VORDemod::VORDemod(DeviceAPI *deviceAPI) :
ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink), ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI), m_deviceAPI(deviceAPI),
m_basebandSampleRate(0) m_basebandSampleRate(0)
{ {
setObjectName(m_channelId); setObjectName(m_channelId);
m_basebandSink = new VORDemodSCBaseband(); m_basebandSink = new VORDemodBaseband();
m_basebandSink->setMessageQueueToChannel(getInputMessageQueue()); m_basebandSink->setMessageQueueToChannel(getInputMessageQueue());
m_basebandSink->moveToThread(&m_thread); m_basebandSink->moveToThread(&m_thread);
@ -68,24 +68,24 @@ VORDemodSC::VORDemodSC(DeviceAPI *deviceAPI) :
m_networkManager, m_networkManager,
&QNetworkAccessManager::finished, &QNetworkAccessManager::finished,
this, this,
&VORDemodSC::networkManagerFinished &VORDemod::networkManagerFinished
); );
QObject::connect( QObject::connect(
this, this,
&ChannelAPI::indexInDeviceSetChanged, &ChannelAPI::indexInDeviceSetChanged,
this, this,
&VORDemodSC::handleIndexInDeviceSetChanged &VORDemod::handleIndexInDeviceSetChanged
); );
} }
VORDemodSC::~VORDemodSC() VORDemod::~VORDemod()
{ {
qDebug("VORDemodSC::~VORDemodSC"); qDebug("VORDemod::~VORDemod");
QObject::disconnect( QObject::disconnect(
m_networkManager, m_networkManager,
&QNetworkAccessManager::finished, &QNetworkAccessManager::finished,
this, this,
&VORDemodSC::networkManagerFinished &VORDemod::networkManagerFinished
); );
delete m_networkManager; delete m_networkManager;
m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSinkAPI(this);
@ -98,7 +98,7 @@ VORDemodSC::~VORDemodSC()
delete m_basebandSink; delete m_basebandSink;
} }
void VORDemodSC::setDeviceAPI(DeviceAPI *deviceAPI) void VORDemod::setDeviceAPI(DeviceAPI *deviceAPI)
{ {
if (deviceAPI != m_deviceAPI) if (deviceAPI != m_deviceAPI)
{ {
@ -110,20 +110,20 @@ void VORDemodSC::setDeviceAPI(DeviceAPI *deviceAPI)
} }
} }
uint32_t VORDemodSC::getNumberOfDeviceStreams() const uint32_t VORDemod::getNumberOfDeviceStreams() const
{ {
return m_deviceAPI->getNbSourceStreams(); return m_deviceAPI->getNbSourceStreams();
} }
void VORDemodSC::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool firstOfBurst) void VORDemod::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool firstOfBurst)
{ {
(void) firstOfBurst; (void) firstOfBurst;
m_basebandSink->feed(begin, end); m_basebandSink->feed(begin, end);
} }
void VORDemodSC::start() void VORDemod::start()
{ {
qDebug("VORDemodSC::start"); qDebug("VORDemod::start");
m_basebandSink->reset(); m_basebandSink->reset();
m_basebandSink->startWork(); m_basebandSink->startWork();
@ -132,24 +132,24 @@ void VORDemodSC::start()
DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency);
m_basebandSink->getInputMessageQueue()->push(dspMsg); m_basebandSink->getInputMessageQueue()->push(dspMsg);
VORDemodSCBaseband::MsgConfigureVORDemodBaseband *msg = VORDemodSCBaseband::MsgConfigureVORDemodBaseband::create(m_settings, true); VORDemodBaseband::MsgConfigureVORDemodBaseband *msg = VORDemodBaseband::MsgConfigureVORDemodBaseband::create(m_settings, true);
m_basebandSink->getInputMessageQueue()->push(msg); m_basebandSink->getInputMessageQueue()->push(msg);
} }
void VORDemodSC::stop() void VORDemod::stop()
{ {
qDebug("VORDemodSC::stop"); qDebug("VORDemod::stop");
m_basebandSink->stopWork(); m_basebandSink->stopWork();
m_thread.quit(); m_thread.quit();
m_thread.wait(); m_thread.wait();
} }
bool VORDemodSC::handleMessage(const Message& cmd) bool VORDemod::handleMessage(const Message& cmd)
{ {
if (MsgConfigureVORDemod::match(cmd)) if (MsgConfigureVORDemod::match(cmd))
{ {
MsgConfigureVORDemod& cfg = (MsgConfigureVORDemod&) cmd; MsgConfigureVORDemod& cfg = (MsgConfigureVORDemod&) cmd;
qDebug() << "VORDemodSC::handleMessage: MsgConfigureVORDemod"; qDebug() << "VORDemod::handleMessage: MsgConfigureVORDemod";
applySettings(cfg.getSettings(), cfg.getForce()); applySettings(cfg.getSettings(), cfg.getForce());
return true; return true;
@ -161,7 +161,7 @@ bool VORDemodSC::handleMessage(const Message& cmd)
m_centerFrequency = notif.getCenterFrequency(); m_centerFrequency = notif.getCenterFrequency();
// Forward to the sink // Forward to the sink
DSPSignalNotification* rep = new DSPSignalNotification(notif); // make a copy DSPSignalNotification* rep = new DSPSignalNotification(notif); // make a copy
qDebug() << "VORDemodSC::handleMessage: DSPSignalNotification"; qDebug() << "VORDemod::handleMessage: DSPSignalNotification";
m_basebandSink->getInputMessageQueue()->push(rep); m_basebandSink->getInputMessageQueue()->push(rep);
// Forward to GUI if any // Forward to GUI if any
if (m_guiMessageQueue) { if (m_guiMessageQueue) {
@ -170,16 +170,16 @@ bool VORDemodSC::handleMessage(const Message& cmd)
return true; return true;
} }
else if (VORDemodSCReport::MsgReportRadial::match(cmd)) else if (VORDemodReport::MsgReportRadial::match(cmd))
{ {
VORDemodSCReport::MsgReportRadial& report = (VORDemodSCReport::MsgReportRadial&) cmd; VORDemodReport::MsgReportRadial& report = (VORDemodReport::MsgReportRadial&) cmd;
m_radial = report.getRadial(); m_radial = report.getRadial();
m_refMag = report.getRefMag(); m_refMag = report.getRefMag();
m_varMag = report.getVarMag(); m_varMag = report.getVarMag();
if (m_guiMessageQueue) if (m_guiMessageQueue)
{ {
VORDemodSCReport::MsgReportRadial *msg = new VORDemodSCReport::MsgReportRadial(report); VORDemodReport::MsgReportRadial *msg = new VORDemodReport::MsgReportRadial(report);
m_guiMessageQueue->push(msg); m_guiMessageQueue->push(msg);
} }
@ -193,14 +193,14 @@ bool VORDemodSC::handleMessage(const Message& cmd)
return true; return true;
} }
else if (VORDemodSCReport::MsgReportIdent::match(cmd)) else if (VORDemodReport::MsgReportIdent::match(cmd))
{ {
VORDemodSCReport::MsgReportIdent& report = (VORDemodSCReport::MsgReportIdent&) cmd; VORDemodReport::MsgReportIdent& report = (VORDemodReport::MsgReportIdent&) cmd;
m_morseIdent = report.getIdent(); m_morseIdent = report.getIdent();
if (m_guiMessageQueue) if (m_guiMessageQueue)
{ {
VORDemodSCReport::MsgReportIdent *msg = new VORDemodSCReport::MsgReportIdent(report); VORDemodReport::MsgReportIdent *msg = new VORDemodReport::MsgReportIdent(report);
m_guiMessageQueue->push(msg); m_guiMessageQueue->push(msg);
} }
@ -220,9 +220,9 @@ bool VORDemodSC::handleMessage(const Message& cmd)
} }
} }
void VORDemodSC::setCenterFrequency(qint64 frequency) void VORDemod::setCenterFrequency(qint64 frequency)
{ {
VORDemodSCSettings settings = m_settings; VORDemodSettings settings = m_settings;
settings.m_inputFrequencyOffset = frequency; settings.m_inputFrequencyOffset = frequency;
applySettings(settings, false); applySettings(settings, false);
@ -233,9 +233,9 @@ void VORDemodSC::setCenterFrequency(qint64 frequency)
} }
} }
void VORDemodSC::applySettings(const VORDemodSCSettings& settings, bool force) void VORDemod::applySettings(const VORDemodSettings& settings, bool force)
{ {
qDebug() << "VORDemodSC::applySettings:" qDebug() << "VORDemod::applySettings:"
<< " m_inputFrequencyOffset: " << settings.m_inputFrequencyOffset << " m_inputFrequencyOffset: " << settings.m_inputFrequencyOffset
<< " m_navId: " << settings.m_navId << " m_navId: " << settings.m_navId
<< " m_volume: " << settings.m_volume << " m_volume: " << settings.m_volume
@ -290,7 +290,7 @@ void VORDemodSC::applySettings(const VORDemodSCSettings& settings, bool force)
reverseAPIKeys.append("identThreshold"); reverseAPIKeys.append("identThreshold");
} }
VORDemodSCBaseband::MsgConfigureVORDemodBaseband *msg = VORDemodSCBaseband::MsgConfigureVORDemodBaseband::create(settings, force); VORDemodBaseband::MsgConfigureVORDemodBaseband *msg = VORDemodBaseband::MsgConfigureVORDemodBaseband::create(settings, force);
m_basebandSink->getInputMessageQueue()->push(msg); m_basebandSink->getInputMessageQueue()->push(msg);
if (settings.m_useReverseAPI) if (settings.m_useReverseAPI)
@ -313,12 +313,12 @@ void VORDemodSC::applySettings(const VORDemodSCSettings& settings, bool force)
m_settings = settings; m_settings = settings;
} }
QByteArray VORDemodSC::serialize() const QByteArray VORDemod::serialize() const
{ {
return m_settings.serialize(); return m_settings.serialize();
} }
bool VORDemodSC::deserialize(const QByteArray& data) bool VORDemod::deserialize(const QByteArray& data)
{ {
if (m_settings.deserialize(data)) if (m_settings.deserialize(data))
{ {
@ -335,7 +335,7 @@ bool VORDemodSC::deserialize(const QByteArray& data)
} }
} }
int VORDemodSC::webapiSettingsGet( int VORDemod::webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage) QString& errorMessage)
{ {
@ -346,20 +346,20 @@ int VORDemodSC::webapiSettingsGet(
return 200; return 200;
} }
int VORDemodSC::webapiSettingsPutPatch( int VORDemod::webapiSettingsPutPatch(
bool force, bool force,
const QStringList& channelSettingsKeys, const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage) QString& errorMessage)
{ {
(void) errorMessage; (void) errorMessage;
VORDemodSCSettings settings = m_settings; VORDemodSettings settings = m_settings;
webapiUpdateChannelSettings(settings, channelSettingsKeys, response); webapiUpdateChannelSettings(settings, channelSettingsKeys, response);
MsgConfigureVORDemod *msg = MsgConfigureVORDemod::create(settings, force); MsgConfigureVORDemod *msg = MsgConfigureVORDemod::create(settings, force);
m_inputMessageQueue.push(msg); m_inputMessageQueue.push(msg);
qDebug("VORDemodSC::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue); qDebug("VORDemod::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue);
if (m_guiMessageQueue) // forward to GUI if any if (m_guiMessageQueue) // forward to GUI if any
{ {
MsgConfigureVORDemod *msgToGUI = MsgConfigureVORDemod::create(settings, force); MsgConfigureVORDemod *msgToGUI = MsgConfigureVORDemod::create(settings, force);
@ -371,8 +371,8 @@ int VORDemodSC::webapiSettingsPutPatch(
return 200; return 200;
} }
void VORDemodSC::webapiUpdateChannelSettings( void VORDemod::webapiUpdateChannelSettings(
VORDemodSCSettings& settings, VORDemodSettings& settings,
const QStringList& channelSettingsKeys, const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response) SWGSDRangel::SWGChannelSettings& response)
{ {
@ -429,7 +429,7 @@ void VORDemodSC::webapiUpdateChannelSettings(
} }
} }
int VORDemodSC::webapiReportGet( int VORDemod::webapiReportGet(
SWGSDRangel::SWGChannelReport& response, SWGSDRangel::SWGChannelReport& response,
QString& errorMessage) QString& errorMessage)
{ {
@ -440,7 +440,7 @@ int VORDemodSC::webapiReportGet(
return 200; return 200;
} }
void VORDemodSC::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const VORDemodSCSettings& settings) void VORDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const VORDemodSettings& settings)
{ {
response.getVorDemodScSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset); response.getVorDemodScSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
response.getVorDemodScSettings()->setNavId(settings.m_navId); response.getVorDemodScSettings()->setNavId(settings.m_navId);
@ -504,7 +504,7 @@ void VORDemodSC::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& re
} }
} }
void VORDemodSC::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) void VORDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
{ {
double magsqAvg, magsqPeak; double magsqAvg, magsqPeak;
int nbMagsqSamples; int nbMagsqSamples;
@ -532,7 +532,7 @@ void VORDemodSC::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& respon
} }
} }
void VORDemodSC::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const VORDemodSCSettings& settings, bool force) void VORDemod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const VORDemodSettings& settings, bool force)
{ {
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
@ -557,10 +557,10 @@ void VORDemodSC::webapiReverseSendSettings(QList<QString>& channelSettingsKeys,
delete swgChannelSettings; delete swgChannelSettings;
} }
void VORDemodSC::sendChannelSettings( void VORDemod::sendChannelSettings(
const QList<ObjectPipe*>& pipes, const QList<ObjectPipe*>& pipes,
QList<QString>& channelSettingsKeys, QList<QString>& channelSettingsKeys,
const VORDemodSCSettings& settings, const VORDemodSettings& settings,
bool force) bool force)
{ {
for (const auto& pipe : pipes) for (const auto& pipe : pipes)
@ -582,7 +582,7 @@ void VORDemodSC::sendChannelSettings(
} }
} }
void VORDemodSC::sendChannelReport(QList<ObjectPipe*>& messagePipes) void VORDemod::sendChannelReport(QList<ObjectPipe*>& messagePipes)
{ {
for (const auto& pipe : messagePipes) for (const auto& pipe : messagePipes)
{ {
@ -601,17 +601,17 @@ void VORDemodSC::sendChannelReport(QList<ObjectPipe*>& messagePipes)
} }
} }
void VORDemodSC::webapiFormatChannelSettings( void VORDemod::webapiFormatChannelSettings(
QList<QString>& channelSettingsKeys, QList<QString>& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings *swgChannelSettings, SWGSDRangel::SWGChannelSettings *swgChannelSettings,
const VORDemodSCSettings& settings, const VORDemodSettings& settings,
bool force bool force
) )
{ {
swgChannelSettings->setDirection(0); // Single sink (Rx) swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet()); swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex()); swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("VORDemodSC")); swgChannelSettings->setChannelType(new QString("VORDemod"));
swgChannelSettings->setVorDemodScSettings(new SWGSDRangel::SWGVORDemodSCSettings()); swgChannelSettings->setVorDemodScSettings(new SWGSDRangel::SWGVORDemodSCSettings());
SWGSDRangel::SWGVORDemodSCSettings *swgVORDemodSCSettings = swgChannelSettings->getVorDemodScSettings(); SWGSDRangel::SWGVORDemodSCSettings *swgVORDemodSCSettings = swgChannelSettings->getVorDemodScSettings();
@ -663,13 +663,13 @@ void VORDemodSC::webapiFormatChannelSettings(
} }
} }
void VORDemodSC::networkManagerFinished(QNetworkReply *reply) void VORDemod::networkManagerFinished(QNetworkReply *reply)
{ {
QNetworkReply::NetworkError replyError = reply->error(); QNetworkReply::NetworkError replyError = reply->error();
if (replyError) if (replyError)
{ {
qWarning() << "VORDemodSC::networkManagerFinished:" qWarning() << "VORDemod::networkManagerFinished:"
<< " error(" << (int) replyError << " error(" << (int) replyError
<< "): " << replyError << "): " << replyError
<< ": " << reply->errorString(); << ": " << reply->errorString();
@ -678,13 +678,13 @@ void VORDemodSC::networkManagerFinished(QNetworkReply *reply)
{ {
QString answer = reply->readAll(); QString answer = reply->readAll();
answer.chop(1); // remove last \n answer.chop(1); // remove last \n
qDebug("VORDemodSC::networkManagerFinished: reply:\n%s", answer.toStdString().c_str()); qDebug("VORDemod::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
} }
reply->deleteLater(); reply->deleteLater();
} }
void VORDemodSC::handleIndexInDeviceSetChanged(int index) void VORDemod::handleIndexInDeviceSetChanged(int index)
{ {
if (index < 0) { if (index < 0) {
return; return;

View File

@ -37,33 +37,33 @@ class QThread;
class DeviceAPI; class DeviceAPI;
class ObjectPipe; class ObjectPipe;
class VORDemodSC : public BasebandSampleSink, public ChannelAPI { class VORDemod : public BasebandSampleSink, public ChannelAPI {
public: public:
class MsgConfigureVORDemod : public Message { class MsgConfigureVORDemod : public Message {
MESSAGE_CLASS_DECLARATION MESSAGE_CLASS_DECLARATION
public: public:
const VORDemodSCSettings& getSettings() const { return m_settings; } const VORDemodSettings& getSettings() const { return m_settings; }
bool getForce() const { return m_force; } bool getForce() const { return m_force; }
static MsgConfigureVORDemod* create(const VORDemodSCSettings& settings, bool force) static MsgConfigureVORDemod* create(const VORDemodSettings& settings, bool force)
{ {
return new MsgConfigureVORDemod(settings, force); return new MsgConfigureVORDemod(settings, force);
} }
private: private:
VORDemodSCSettings m_settings; VORDemodSettings m_settings;
bool m_force; bool m_force;
MsgConfigureVORDemod(const VORDemodSCSettings& settings, bool force) : MsgConfigureVORDemod(const VORDemodSettings& settings, bool force) :
Message(), Message(),
m_settings(settings), m_settings(settings),
m_force(force) m_force(force)
{ } { }
}; };
VORDemodSC(DeviceAPI *deviceAPI); VORDemod(DeviceAPI *deviceAPI);
virtual ~VORDemodSC(); virtual ~VORDemod();
virtual void destroy() { delete this; } virtual void destroy() { delete this; }
virtual void setDeviceAPI(DeviceAPI *deviceAPI); virtual void setDeviceAPI(DeviceAPI *deviceAPI);
virtual DeviceAPI *getDeviceAPI() { return m_deviceAPI; } virtual DeviceAPI *getDeviceAPI() { return m_deviceAPI; }
@ -111,10 +111,10 @@ public:
static void webapiFormatChannelSettings( static void webapiFormatChannelSettings(
SWGSDRangel::SWGChannelSettings& response, SWGSDRangel::SWGChannelSettings& response,
const VORDemodSCSettings& settings); const VORDemodSettings& settings);
static void webapiUpdateChannelSettings( static void webapiUpdateChannelSettings(
VORDemodSCSettings& settings, VORDemodSettings& settings,
const QStringList& channelSettingsKeys, const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response); SWGSDRangel::SWGChannelSettings& response);
@ -134,8 +134,8 @@ public:
private: private:
DeviceAPI *m_deviceAPI; DeviceAPI *m_deviceAPI;
QThread m_thread; QThread m_thread;
VORDemodSCBaseband* m_basebandSink; VORDemodBaseband* m_basebandSink;
VORDemodSCSettings m_settings; VORDemodSettings m_settings;
int m_basebandSampleRate; //!< stored from device message used when starting baseband sink int m_basebandSampleRate; //!< stored from device message used when starting baseband sink
qint64 m_centerFrequency; qint64 m_centerFrequency;
@ -148,20 +148,20 @@ private:
QNetworkRequest m_networkRequest; QNetworkRequest m_networkRequest;
virtual bool handleMessage(const Message& cmd); virtual bool handleMessage(const Message& cmd);
void applySettings(const VORDemodSCSettings& settings, bool force = false); void applySettings(const VORDemodSettings& settings, bool force = false);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const VORDemodSCSettings& settings, bool force); void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const VORDemodSettings& settings, bool force);
void sendChannelSettings( void sendChannelSettings(
const QList<ObjectPipe*>& pipes, const QList<ObjectPipe*>& pipes,
QList<QString>& channelSettingsKeys, QList<QString>& channelSettingsKeys,
const VORDemodSCSettings& settings, const VORDemodSettings& settings,
bool force bool force
); );
void sendChannelReport(QList<ObjectPipe*>& messagePipes); void sendChannelReport(QList<ObjectPipe*>& messagePipes);
void webapiFormatChannelSettings( void webapiFormatChannelSettings(
QList<QString>& channelSettingsKeys, QList<QString>& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings *swgChannelSettings, SWGSDRangel::SWGChannelSettings *swgChannelSettings,
const VORDemodSCSettings& settings, const VORDemodSettings& settings,
bool force bool force
); );

View File

@ -25,14 +25,14 @@
#include "vordemodscbaseband.h" #include "vordemodscbaseband.h"
#include "vordemodscreport.h" #include "vordemodscreport.h"
MESSAGE_CLASS_DEFINITION(VORDemodSCBaseband::MsgConfigureVORDemodBaseband, Message) MESSAGE_CLASS_DEFINITION(VORDemodBaseband::MsgConfigureVORDemodBaseband, Message)
VORDemodSCBaseband::VORDemodSCBaseband() : VORDemodBaseband::VORDemodBaseband() :
m_messageQueueToGUI(nullptr), m_messageQueueToGUI(nullptr),
m_running(false), m_running(false),
m_mutex(QMutex::Recursive) m_mutex(QMutex::Recursive)
{ {
qDebug("VORDemodSCBaseband::VORDemodSCBaseband"); qDebug("VORDemodBaseband::VORDemodBaseband");
m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(48000)); m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(48000));
m_channelizer = new DownChannelizer(&m_sink); m_channelizer = new DownChannelizer(&m_sink);
@ -41,14 +41,14 @@ VORDemodSCBaseband::VORDemodSCBaseband() :
m_channelSampleRate = 0; m_channelSampleRate = 0;
} }
VORDemodSCBaseband::~VORDemodSCBaseband() VORDemodBaseband::~VORDemodBaseband()
{ {
m_inputMessageQueue.clear(); m_inputMessageQueue.clear();
DSPEngine::instance()->getAudioDeviceManager()->removeAudioSink(m_sink.getAudioFifo()); DSPEngine::instance()->getAudioDeviceManager()->removeAudioSink(m_sink.getAudioFifo());
delete m_channelizer; delete m_channelizer;
} }
void VORDemodSCBaseband::reset() void VORDemodBaseband::reset()
{ {
QMutexLocker mutexLocker(&m_mutex); QMutexLocker mutexLocker(&m_mutex);
m_inputMessageQueue.clear(); m_inputMessageQueue.clear();
@ -56,21 +56,21 @@ void VORDemodSCBaseband::reset()
m_channelSampleRate = 0; m_channelSampleRate = 0;
} }
void VORDemodSCBaseband::startWork() void VORDemodBaseband::startWork()
{ {
QMutexLocker mutexLocker(&m_mutex); QMutexLocker mutexLocker(&m_mutex);
QObject::connect( QObject::connect(
&m_sampleFifo, &m_sampleFifo,
&SampleSinkFifo::dataReady, &SampleSinkFifo::dataReady,
this, this,
&VORDemodSCBaseband::handleData, &VORDemodBaseband::handleData,
Qt::QueuedConnection Qt::QueuedConnection
); );
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
m_running = true; m_running = true;
} }
void VORDemodSCBaseband::stopWork() void VORDemodBaseband::stopWork()
{ {
QMutexLocker mutexLocker(&m_mutex); QMutexLocker mutexLocker(&m_mutex);
disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
@ -78,17 +78,17 @@ void VORDemodSCBaseband::stopWork()
&m_sampleFifo, &m_sampleFifo,
&SampleSinkFifo::dataReady, &SampleSinkFifo::dataReady,
this, this,
&VORDemodSCBaseband::handleData &VORDemodBaseband::handleData
); );
m_running = false; m_running = false;
} }
void VORDemodSCBaseband::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end) void VORDemodBaseband::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end)
{ {
m_sampleFifo.write(begin, end); m_sampleFifo.write(begin, end);
} }
void VORDemodSCBaseband::handleData() void VORDemodBaseband::handleData()
{ {
QMutexLocker mutexLocker(&m_mutex); QMutexLocker mutexLocker(&m_mutex);
@ -115,7 +115,7 @@ void VORDemodSCBaseband::handleData()
} }
} }
void VORDemodSCBaseband::handleInputMessages() void VORDemodBaseband::handleInputMessages()
{ {
Message* message; Message* message;
@ -127,13 +127,13 @@ void VORDemodSCBaseband::handleInputMessages()
} }
} }
bool VORDemodSCBaseband::handleMessage(const Message& cmd) bool VORDemodBaseband::handleMessage(const Message& cmd)
{ {
if (MsgConfigureVORDemodBaseband::match(cmd)) if (MsgConfigureVORDemodBaseband::match(cmd))
{ {
QMutexLocker mutexLocker(&m_mutex); QMutexLocker mutexLocker(&m_mutex);
MsgConfigureVORDemodBaseband& cfg = (MsgConfigureVORDemodBaseband&) cmd; MsgConfigureVORDemodBaseband& cfg = (MsgConfigureVORDemodBaseband&) cmd;
qDebug() << "VORDemodSCBaseband::handleMessage: MsgConfigureVORDemodBaseband"; qDebug() << "VORDemodBaseband::handleMessage: MsgConfigureVORDemodBaseband";
applySettings(cfg.getSettings(), cfg.getForce()); applySettings(cfg.getSettings(), cfg.getForce());
@ -143,7 +143,7 @@ bool VORDemodSCBaseband::handleMessage(const Message& cmd)
{ {
QMutexLocker mutexLocker(&m_mutex); QMutexLocker mutexLocker(&m_mutex);
DSPSignalNotification& notif = (DSPSignalNotification&) cmd; DSPSignalNotification& notif = (DSPSignalNotification&) cmd;
qDebug() << "VORDemodSCBaseband::handleMessage: DSPSignalNotification: basebandSampleRate: " << notif.getSampleRate() << " centerFrequency: " << notif.getCenterFrequency(); qDebug() << "VORDemodBaseband::handleMessage: DSPSignalNotification: basebandSampleRate: " << notif.getSampleRate() << " centerFrequency: " << notif.getCenterFrequency();
m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(notif.getSampleRate())); m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(notif.getSampleRate()));
m_channelizer->setBasebandSampleRate(notif.getSampleRate()); m_channelizer->setBasebandSampleRate(notif.getSampleRate());
m_sink.applyChannelSettings(m_channelizer->getChannelSampleRate(), m_channelizer->getChannelFrequencyOffset()); m_sink.applyChannelSettings(m_channelizer->getChannelSampleRate(), m_channelizer->getChannelFrequencyOffset());
@ -162,7 +162,7 @@ bool VORDemodSCBaseband::handleMessage(const Message& cmd)
} }
} }
void VORDemodSCBaseband::applySettings(const VORDemodSCSettings& settings, bool force) void VORDemodBaseband::applySettings(const VORDemodSettings& settings, bool force)
{ {
if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) || force) if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) || force)
{ {

View File

@ -30,7 +30,7 @@
class DownChannelizer; class DownChannelizer;
class VORDemodSCBaseband : public QObject class VORDemodBaseband : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
@ -38,27 +38,27 @@ public:
MESSAGE_CLASS_DECLARATION MESSAGE_CLASS_DECLARATION
public: public:
const VORDemodSCSettings& getSettings() const { return m_settings; } const VORDemodSettings& getSettings() const { return m_settings; }
bool getForce() const { return m_force; } bool getForce() const { return m_force; }
static MsgConfigureVORDemodBaseband* create(const VORDemodSCSettings& settings, bool force) static MsgConfigureVORDemodBaseband* create(const VORDemodSettings& settings, bool force)
{ {
return new MsgConfigureVORDemodBaseband(settings, force); return new MsgConfigureVORDemodBaseband(settings, force);
} }
private: private:
VORDemodSCSettings m_settings; VORDemodSettings m_settings;
bool m_force; bool m_force;
MsgConfigureVORDemodBaseband(const VORDemodSCSettings& settings, bool force) : MsgConfigureVORDemodBaseband(const VORDemodSettings& settings, bool force) :
Message(), Message(),
m_settings(settings), m_settings(settings),
m_force(force) m_force(force)
{ } { }
}; };
VORDemodSCBaseband(); VORDemodBaseband();
~VORDemodSCBaseband(); ~VORDemodBaseband();
void reset(); void reset();
void startWork(); void startWork();
void stopWork(); void stopWork();
@ -79,13 +79,13 @@ private:
int m_channelSampleRate; int m_channelSampleRate;
VORDemodSCSink m_sink; VORDemodSCSink m_sink;
MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication
VORDemodSCSettings m_settings; VORDemodSettings m_settings;
MessageQueue *m_messageQueueToGUI; MessageQueue *m_messageQueueToGUI;
bool m_running; bool m_running;
QMutex m_mutex; QMutex m_mutex;
bool handleMessage(const Message& cmd); bool handleMessage(const Message& cmd);
void applySettings(const VORDemodSCSettings& settings, bool force = false); void applySettings(const VORDemodSettings& settings, bool force = false);
private slots: private slots:
void handleInputMessages(); void handleInputMessages();

View File

@ -42,30 +42,30 @@
#include "vordemodscreport.h" #include "vordemodscreport.h"
#include "vordemodscgui.h" #include "vordemodscgui.h"
VORDemodSCGUI* VORDemodSCGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) VORDemodGUI* VORDemodGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{ {
VORDemodSCGUI* gui = new VORDemodSCGUI(pluginAPI, deviceUISet, rxChannel); VORDemodGUI* gui = new VORDemodGUI(pluginAPI, deviceUISet, rxChannel);
return gui; return gui;
} }
void VORDemodSCGUI::destroy() void VORDemodGUI::destroy()
{ {
delete this; delete this;
} }
void VORDemodSCGUI::resetToDefaults() void VORDemodGUI::resetToDefaults()
{ {
m_settings.resetToDefaults(); m_settings.resetToDefaults();
displaySettings(); displaySettings();
applySettings(true); applySettings(true);
} }
QByteArray VORDemodSCGUI::serialize() const QByteArray VORDemodGUI::serialize() const
{ {
return m_settings.serialize(); return m_settings.serialize();
} }
bool VORDemodSCGUI::deserialize(const QByteArray& data) bool VORDemodGUI::deserialize(const QByteArray& data)
{ {
if(m_settings.deserialize(data)) { if(m_settings.deserialize(data)) {
displaySettings(); displaySettings();
@ -77,7 +77,7 @@ bool VORDemodSCGUI::deserialize(const QByteArray& data)
} }
} }
void VORDemodSCGUI::resizeEvent(QResizeEvent* size) void VORDemodGUI::resizeEvent(QResizeEvent* size)
{ {
int maxWidth = getRollupContents()->maximumWidth(); int maxWidth = getRollupContents()->maximumWidth();
int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight(); int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight();
@ -85,12 +85,12 @@ void VORDemodSCGUI::resizeEvent(QResizeEvent* size)
size->accept(); size->accept();
} }
bool VORDemodSCGUI::handleMessage(const Message& message) bool VORDemodGUI::handleMessage(const Message& message)
{ {
if (VORDemodSC::MsgConfigureVORDemod::match(message)) if (VORDemod::MsgConfigureVORDemod::match(message))
{ {
qDebug("VORDemodSCGUI::handleMessage: VORDemodSC::MsgConfigureVORDemod"); qDebug("VORDemodGUI::handleMessage: VORDemod::MsgConfigureVORDemod");
const VORDemodSC::MsgConfigureVORDemod& cfg = (VORDemodSC::MsgConfigureVORDemod&) message; const VORDemod::MsgConfigureVORDemod& cfg = (VORDemod::MsgConfigureVORDemod&) message;
m_settings = cfg.getSettings(); m_settings = cfg.getSettings();
blockApplySettings(true); blockApplySettings(true);
displaySettings(); displaySettings();
@ -107,9 +107,9 @@ bool VORDemodSCGUI::handleMessage(const Message& message)
updateAbsoluteCenterFrequency(); updateAbsoluteCenterFrequency();
return true; return true;
} }
else if (VORDemodSCReport::MsgReportRadial::match(message)) else if (VORDemodReport::MsgReportRadial::match(message))
{ {
VORDemodSCReport::MsgReportRadial& report = (VORDemodSCReport::MsgReportRadial&) message; VORDemodReport::MsgReportRadial& report = (VORDemodReport::MsgReportRadial&) message;
// Display radial and signal magnitudes // Display radial and signal magnitudes
Real varMagDB = std::round(20.0*std::log10(report.getVarMag())); Real varMagDB = std::round(20.0*std::log10(report.getVarMag()));
@ -143,9 +143,9 @@ bool VORDemodSCGUI::handleMessage(const Message& message)
return true; return true;
} }
else if (VORDemodSCReport::MsgReportIdent::match(message)) else if (VORDemodReport::MsgReportIdent::match(message))
{ {
VORDemodSCReport::MsgReportIdent& report = (VORDemodSCReport::MsgReportIdent&) message; VORDemodReport::MsgReportIdent& report = (VORDemodReport::MsgReportIdent&) message;
QString ident = report.getIdent(); QString ident = report.getIdent();
QString identString = Morse::toString(ident); // Convert Morse to a string QString identString = Morse::toString(ident); // Convert Morse to a string
@ -172,7 +172,7 @@ bool VORDemodSCGUI::handleMessage(const Message& message)
return false; return false;
} }
void VORDemodSCGUI::handleInputMessages() void VORDemodGUI::handleInputMessages()
{ {
Message* message; Message* message;
@ -185,19 +185,19 @@ void VORDemodSCGUI::handleInputMessages()
} }
} }
void VORDemodSCGUI::channelMarkerChangedByCursor() void VORDemodGUI::channelMarkerChangedByCursor()
{ {
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency(); m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
applySettings(); applySettings();
} }
void VORDemodSCGUI::channelMarkerHighlightedByCursor() void VORDemodGUI::channelMarkerHighlightedByCursor()
{ {
setHighlighted(m_channelMarker.getHighlighted()); setHighlighted(m_channelMarker.getHighlighted());
} }
void VORDemodSCGUI::on_deltaFrequency_changed(qint64 value) void VORDemodGUI::on_deltaFrequency_changed(qint64 value)
{ {
m_channelMarker.setCenterFrequency(value); m_channelMarker.setCenterFrequency(value);
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency(); m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
@ -205,34 +205,34 @@ void VORDemodSCGUI::on_deltaFrequency_changed(qint64 value)
applySettings(); applySettings();
} }
void VORDemodSCGUI::on_thresh_valueChanged(int value) void VORDemodGUI::on_thresh_valueChanged(int value)
{ {
ui->threshText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1)); ui->threshText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
m_settings.m_identThreshold = value / 10.0; m_settings.m_identThreshold = value / 10.0;
applySettings(); applySettings();
} }
void VORDemodSCGUI::on_volume_valueChanged(int value) void VORDemodGUI::on_volume_valueChanged(int value)
{ {
ui->volumeText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1)); ui->volumeText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
m_settings.m_volume = value / 10.0; m_settings.m_volume = value / 10.0;
applySettings(); applySettings();
} }
void VORDemodSCGUI::on_squelch_valueChanged(int value) void VORDemodGUI::on_squelch_valueChanged(int value)
{ {
ui->squelchText->setText(QString("%1 dB").arg(value)); ui->squelchText->setText(QString("%1 dB").arg(value));
m_settings.m_squelch = value; m_settings.m_squelch = value;
applySettings(); applySettings();
} }
void VORDemodSCGUI::on_audioMute_toggled(bool checked) void VORDemodGUI::on_audioMute_toggled(bool checked)
{ {
m_settings.m_audioMute = checked; m_settings.m_audioMute = checked;
applySettings(); applySettings();
} }
void VORDemodSCGUI::onWidgetRolled(QWidget* widget, bool rollDown) void VORDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
{ {
(void) widget; (void) widget;
(void) rollDown; (void) rollDown;
@ -241,7 +241,7 @@ void VORDemodSCGUI::onWidgetRolled(QWidget* widget, bool rollDown)
applySettings(); applySettings();
} }
void VORDemodSCGUI::onMenuDialogCalled(const QPoint &p) void VORDemodGUI::onMenuDialogCalled(const QPoint &p)
{ {
if (m_contextMenuType == ContextMenuChannelSettings) if (m_contextMenuType == ContextMenuChannelSettings)
{ {
@ -288,9 +288,9 @@ void VORDemodSCGUI::onMenuDialogCalled(const QPoint &p)
resetContextMenuType(); resetContextMenuType();
} }
VORDemodSCGUI::VORDemodSCGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) : VORDemodGUI::VORDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) :
ChannelGUI(parent), ChannelGUI(parent),
ui(new Ui::VORDemodSCGUI), ui(new Ui::VORDemodGUI),
m_pluginAPI(pluginAPI), m_pluginAPI(pluginAPI),
m_deviceUISet(deviceUISet), m_deviceUISet(deviceUISet),
m_channelMarker(this), m_channelMarker(this),
@ -308,7 +308,7 @@ VORDemodSCGUI::VORDemodSCGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
m_vorDemod = reinterpret_cast<VORDemodSC*>(rxChannel); m_vorDemod = reinterpret_cast<VORDemod*>(rxChannel);
m_vorDemod->setMessageQueueToGUI(getInputMessageQueue()); m_vorDemod->setMessageQueueToGUI(getInputMessageQueue());
connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms
@ -323,7 +323,7 @@ VORDemodSCGUI::VORDemodSCGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
m_channelMarker.blockSignals(true); m_channelMarker.blockSignals(true);
m_channelMarker.setColor(Qt::yellow); m_channelMarker.setColor(Qt::yellow);
m_channelMarker.setBandwidth(2*VORDemodSCSettings::VORDEMOD_CHANNEL_BANDWIDTH); m_channelMarker.setBandwidth(2*VORDemodSettings::VORDEMOD_CHANNEL_BANDWIDTH);
m_channelMarker.setCenterFrequency(0); m_channelMarker.setCenterFrequency(0);
m_channelMarker.setTitle("VOR Demodulator"); m_channelMarker.setTitle("VOR Demodulator");
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
@ -344,30 +344,30 @@ VORDemodSCGUI::VORDemodSCGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
applySettings(true); applySettings(true);
} }
VORDemodSCGUI::~VORDemodSCGUI() VORDemodGUI::~VORDemodGUI()
{ {
delete ui; delete ui;
} }
void VORDemodSCGUI::blockApplySettings(bool block) void VORDemodGUI::blockApplySettings(bool block)
{ {
m_doApplySettings = !block; m_doApplySettings = !block;
} }
void VORDemodSCGUI::applySettings(bool force) void VORDemodGUI::applySettings(bool force)
{ {
if (m_doApplySettings) if (m_doApplySettings)
{ {
VORDemodSC::MsgConfigureVORDemod* message = VORDemodSC::MsgConfigureVORDemod::create( m_settings, force); VORDemod::MsgConfigureVORDemod* message = VORDemod::MsgConfigureVORDemod::create( m_settings, force);
m_vorDemod->getInputMessageQueue()->push(message); m_vorDemod->getInputMessageQueue()->push(message);
} }
} }
void VORDemodSCGUI::displaySettings() void VORDemodGUI::displaySettings()
{ {
m_channelMarker.blockSignals(true); m_channelMarker.blockSignals(true);
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset); m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
m_channelMarker.setBandwidth(2*VORDemodSCSettings::VORDEMOD_CHANNEL_BANDWIDTH); m_channelMarker.setBandwidth(2*VORDemodSettings::VORDEMOD_CHANNEL_BANDWIDTH);
m_channelMarker.setTitle(m_settings.m_title); m_channelMarker.setTitle(m_settings.m_title);
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
@ -398,21 +398,21 @@ void VORDemodSCGUI::displaySettings()
blockApplySettings(false); blockApplySettings(false);
} }
void VORDemodSCGUI::leaveEvent(QEvent* event) void VORDemodGUI::leaveEvent(QEvent* event)
{ {
m_channelMarker.setHighlighted(false); m_channelMarker.setHighlighted(false);
ChannelGUI::leaveEvent(event); ChannelGUI::leaveEvent(event);
} }
void VORDemodSCGUI::enterEvent(QEvent* event) void VORDemodGUI::enterEvent(QEvent* event)
{ {
m_channelMarker.setHighlighted(true); m_channelMarker.setHighlighted(true);
ChannelGUI::enterEvent(event); ChannelGUI::enterEvent(event);
} }
void VORDemodSCGUI::audioSelect() void VORDemodGUI::audioSelect()
{ {
qDebug("VORDemodSCGUI::audioSelect"); qDebug("VORDemodGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName); AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.exec(); audioSelect.exec();
@ -423,7 +423,7 @@ void VORDemodSCGUI::audioSelect()
} }
} }
void VORDemodSCGUI::tick() void VORDemodGUI::tick()
{ {
double magsqAvg, magsqPeak; double magsqAvg, magsqPeak;
int nbMagsqSamples; int nbMagsqSamples;
@ -459,16 +459,16 @@ void VORDemodSCGUI::tick()
m_tickCount++; m_tickCount++;
} }
void VORDemodSCGUI::makeUIConnections() void VORDemodGUI::makeUIConnections()
{ {
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &VORDemodSCGUI::on_deltaFrequency_changed); QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &VORDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->thresh, &QDial::valueChanged, this, &VORDemodSCGUI::on_thresh_valueChanged); QObject::connect(ui->thresh, &QDial::valueChanged, this, &VORDemodGUI::on_thresh_valueChanged);
QObject::connect(ui->volume, &QDial::valueChanged, this, &VORDemodSCGUI::on_volume_valueChanged); QObject::connect(ui->volume, &QDial::valueChanged, this, &VORDemodGUI::on_volume_valueChanged);
QObject::connect(ui->squelch, &QDial::valueChanged, this, &VORDemodSCGUI::on_squelch_valueChanged); QObject::connect(ui->squelch, &QDial::valueChanged, this, &VORDemodGUI::on_squelch_valueChanged);
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &VORDemodSCGUI::on_audioMute_toggled); QObject::connect(ui->audioMute, &QToolButton::toggled, this, &VORDemodGUI::on_audioMute_toggled);
} }
void VORDemodSCGUI::updateAbsoluteCenterFrequency() void VORDemodGUI::updateAbsoluteCenterFrequency()
{ {
setStatusFrequency(m_deviceCenterFrequency + m_settings.m_inputFrequencyOffset); setStatusFrequency(m_deviceCenterFrequency + m_settings.m_inputFrequencyOffset);
} }

View File

@ -29,19 +29,19 @@
class PluginAPI; class PluginAPI;
class DeviceUISet; class DeviceUISet;
class BasebandSampleSink; class BasebandSampleSink;
class VORDemodSC; class VORDemod;
class VORDemodSCGUI; class VORDemodGUI;
namespace Ui { namespace Ui {
class VORDemodSCGUI; class VORDemodGUI;
} }
class VORDemodSCGUI; class VORDemodGUI;
class VORDemodSCGUI : public ChannelGUI { class VORDemodGUI : public ChannelGUI {
Q_OBJECT Q_OBJECT
public: public:
static VORDemodSCGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); static VORDemodGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel);
virtual void destroy(); virtual void destroy();
void resetToDefaults(); void resetToDefaults();
@ -68,23 +68,23 @@ protected:
void resizeEvent(QResizeEvent* size); void resizeEvent(QResizeEvent* size);
private: private:
Ui::VORDemodSCGUI* ui; Ui::VORDemodGUI* ui;
PluginAPI* m_pluginAPI; PluginAPI* m_pluginAPI;
DeviceUISet* m_deviceUISet; DeviceUISet* m_deviceUISet;
ChannelMarker m_channelMarker; ChannelMarker m_channelMarker;
RollupState m_rollupState; RollupState m_rollupState;
VORDemodSCSettings m_settings; VORDemodSettings m_settings;
qint64 m_deviceCenterFrequency; qint64 m_deviceCenterFrequency;
bool m_doApplySettings; bool m_doApplySettings;
VORDemodSC* m_vorDemod; VORDemod* m_vorDemod;
bool m_squelchOpen; bool m_squelchOpen;
int m_basebandSampleRate; int m_basebandSampleRate;
uint32_t m_tickCount; uint32_t m_tickCount;
MessageQueue m_inputMessageQueue; MessageQueue m_inputMessageQueue;
explicit VORDemodSCGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0); explicit VORDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
virtual ~VORDemodSCGUI(); virtual ~VORDemodGUI();
void blockApplySettings(bool block); void blockApplySettings(bool block);
void applySettings(bool force = false); void applySettings(bool force = false);

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>VORDemodSCGUI</class> <class>VORDemodGUI</class>
<widget class="RollupContents" name="VORDemodSCGUI"> <widget class="RollupContents" name="VORDemodSCGUI">
<property name="geometry"> <property name="geometry">
<rect> <rect>

View File

@ -26,8 +26,8 @@
#include "vordemodscwebapiadapter.h" #include "vordemodscwebapiadapter.h"
#include "vordemodscplugin.h" #include "vordemodscplugin.h"
const PluginDescriptor VORDemodSCPlugin::m_pluginDescriptor = { const PluginDescriptor VORDemodPlugin::m_pluginDescriptor = {
VORDemodSC::m_channelId, VORDemod::m_channelId,
QStringLiteral("VOR Single Channel Demodulator"), QStringLiteral("VOR Single Channel Demodulator"),
QStringLiteral("6.20.2"), QStringLiteral("6.20.2"),
QStringLiteral("(c) Jon Beniston, M7RCE"), QStringLiteral("(c) Jon Beniston, M7RCE"),
@ -36,29 +36,29 @@ const PluginDescriptor VORDemodSCPlugin::m_pluginDescriptor = {
QStringLiteral("https://github.com/f4exb/sdrangel") QStringLiteral("https://github.com/f4exb/sdrangel")
}; };
VORDemodSCPlugin::VORDemodSCPlugin(QObject* parent) : VORDemodPlugin::VORDemodPlugin(QObject* parent) :
QObject(parent), QObject(parent),
m_pluginAPI(0) m_pluginAPI(0)
{ {
} }
const PluginDescriptor& VORDemodSCPlugin::getPluginDescriptor() const const PluginDescriptor& VORDemodPlugin::getPluginDescriptor() const
{ {
return m_pluginDescriptor; return m_pluginDescriptor;
} }
void VORDemodSCPlugin::initPlugin(PluginAPI* pluginAPI) void VORDemodPlugin::initPlugin(PluginAPI* pluginAPI)
{ {
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
m_pluginAPI->registerRxChannel(VORDemodSC::m_channelIdURI, VORDemodSC::m_channelId, this); m_pluginAPI->registerRxChannel(VORDemod::m_channelIdURI, VORDemod::m_channelId, this);
} }
void VORDemodSCPlugin::createRxChannel(DeviceAPI *deviceAPI, BasebandSampleSink **bs, ChannelAPI **cs) const void VORDemodPlugin::createRxChannel(DeviceAPI *deviceAPI, BasebandSampleSink **bs, ChannelAPI **cs) const
{ {
if (bs || cs) if (bs || cs)
{ {
VORDemodSC *instance = new VORDemodSC(deviceAPI); VORDemod *instance = new VORDemod(deviceAPI);
if (bs) { if (bs) {
*bs = instance; *bs = instance;
@ -71,7 +71,7 @@ void VORDemodSCPlugin::createRxChannel(DeviceAPI *deviceAPI, BasebandSampleSink
} }
#ifdef SERVER_MODE #ifdef SERVER_MODE
ChannelGUI* VORDemodSCPlugin::createRxChannelGUI( ChannelGUI* VORDemodPlugin::createRxChannelGUI(
DeviceUISet *deviceUISet, DeviceUISet *deviceUISet,
BasebandSampleSink *rxChannel) const BasebandSampleSink *rxChannel) const
{ {
@ -80,13 +80,13 @@ ChannelGUI* VORDemodSCPlugin::createRxChannelGUI(
return 0; return 0;
} }
#else #else
ChannelGUI* VORDemodSCPlugin::createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const ChannelGUI* VORDemodPlugin::createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const
{ {
return VORDemodSCGUI::create(m_pluginAPI, deviceUISet, rxChannel); return VORDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel);
} }
#endif #endif
ChannelWebAPIAdapter* VORDemodSCPlugin::createChannelWebAPIAdapter() const ChannelWebAPIAdapter* VORDemodPlugin::createChannelWebAPIAdapter() const
{ {
return new VORDemodSCWebAPIAdapter(); return new VORDemodSCWebAPIAdapter();
} }

View File

@ -25,13 +25,13 @@
class DeviceUISet; class DeviceUISet;
class BasebandSampleSink; class BasebandSampleSink;
class VORDemodSCPlugin : public QObject, PluginInterface { class VORDemodPlugin : public QObject, PluginInterface {
Q_OBJECT Q_OBJECT
Q_INTERFACES(PluginInterface) Q_INTERFACES(PluginInterface)
Q_PLUGIN_METADATA(IID "sdrangel.channel.vordemodsc") Q_PLUGIN_METADATA(IID "sdrangel.channel.vordemodsc")
public: public:
explicit VORDemodSCPlugin(QObject* parent = NULL); explicit VORDemodPlugin(QObject* parent = NULL);
const PluginDescriptor& getPluginDescriptor() const; const PluginDescriptor& getPluginDescriptor() const;
void initPlugin(PluginAPI* pluginAPI); void initPlugin(PluginAPI* pluginAPI);

View File

@ -17,5 +17,5 @@
#include "vordemodscreport.h" #include "vordemodscreport.h"
MESSAGE_CLASS_DEFINITION(VORDemodSCReport::MsgReportRadial, Message) MESSAGE_CLASS_DEFINITION(VORDemodReport::MsgReportRadial, Message)
MESSAGE_CLASS_DEFINITION(VORDemodSCReport::MsgReportIdent, Message) MESSAGE_CLASS_DEFINITION(VORDemodReport::MsgReportIdent, Message)

View File

@ -23,7 +23,7 @@
#include "util/message.h" #include "util/message.h"
class VORDemodSCReport : public QObject class VORDemodReport : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
@ -75,8 +75,8 @@ public:
}; };
public: public:
VORDemodSCReport() {} VORDemodReport() {}
~VORDemodSCReport() {} ~VORDemodReport() {}
}; };
#endif // INCLUDE_VORDEMODSCREPORT_H #endif // INCLUDE_VORDEMODSCREPORT_H

View File

@ -23,14 +23,14 @@
#include "settings/serializable.h" #include "settings/serializable.h"
#include "vordemodscsettings.h" #include "vordemodscsettings.h"
VORDemodSCSettings::VORDemodSCSettings() : VORDemodSettings::VORDemodSettings() :
m_channelMarker(nullptr), m_channelMarker(nullptr),
m_rollupState(nullptr) m_rollupState(nullptr)
{ {
resetToDefaults(); resetToDefaults();
} }
void VORDemodSCSettings::resetToDefaults() void VORDemodSettings::resetToDefaults()
{ {
m_inputFrequencyOffset = 0; m_inputFrequencyOffset = 0;
m_navId = -1; m_navId = -1;
@ -54,7 +54,7 @@ void VORDemodSCSettings::resetToDefaults()
m_varThresholdDB = -90.0; m_varThresholdDB = -90.0;
} }
QByteArray VORDemodSCSettings::serialize() const QByteArray VORDemodSettings::serialize() const
{ {
SimpleSerializer s(1); SimpleSerializer s(1);
s.writeS32(1, m_inputFrequencyOffset); s.writeS32(1, m_inputFrequencyOffset);
@ -89,7 +89,7 @@ QByteArray VORDemodSCSettings::serialize() const
return s.final(); return s.final();
} }
bool VORDemodSCSettings::deserialize(const QByteArray& data) bool VORDemodSettings::deserialize(const QByteArray& data)
{ {
SimpleDeserializer d(data); SimpleDeserializer d(data);

View File

@ -24,7 +24,7 @@
class Serializable; class Serializable;
struct VORDemodSCSettings struct VORDemodSettings
{ {
qint32 m_inputFrequencyOffset; qint32 m_inputFrequencyOffset;
int m_navId; //!< VOR unique identifier when set by VOR localizer feature int m_navId; //!< VOR unique identifier when set by VOR localizer feature
@ -58,7 +58,7 @@ struct VORDemodSCSettings
// May as well make it a common audio rate, to possibly avoid decimation // May as well make it a common audio rate, to possibly avoid decimation
static const int VORDEMOD_CHANNEL_SAMPLE_RATE = 48000; static const int VORDEMOD_CHANNEL_SAMPLE_RATE = 48000;
VORDemodSCSettings(); VORDemodSettings();
void resetToDefaults(); void resetToDefaults();
void setChannelMarker(Serializable *channelMarker) { m_channelMarker = channelMarker; } void setChannelMarker(Serializable *channelMarker) { m_channelMarker = channelMarker; }
void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; } void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; }

View File

@ -33,7 +33,7 @@
VORDemodSCSink::VORDemodSCSink() : VORDemodSCSink::VORDemodSCSink() :
m_channelFrequencyOffset(0), m_channelFrequencyOffset(0),
m_channelSampleRate(VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE), m_channelSampleRate(VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE),
m_audioSampleRate(48000), m_audioSampleRate(48000),
m_squelchCount(0), m_squelchCount(0),
m_squelchOpen(false), m_squelchOpen(false),
@ -47,8 +47,8 @@ VORDemodSCSink::VORDemodSCSink() :
m_movingAverageIdent(5000), m_movingAverageIdent(5000),
m_prevBit(0), m_prevBit(0),
m_bitTime(0), m_bitTime(0),
m_varGoertzel(30, VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE), m_varGoertzel(30, VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE),
m_refGoertzel(30, VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE) m_refGoertzel(30, VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE)
{ {
m_audioBuffer.resize(1<<14); m_audioBuffer.resize(1<<14);
m_audioBufferFill = 0; m_audioBufferFill = 0;
@ -197,7 +197,7 @@ void VORDemodSCSink::processOneSample(Complex &ci)
// Calculate phase of 30Hz variable AM signal // Calculate phase of 30Hz variable AM signal
double varPhase; double varPhase;
double varMag; double varMag;
if (m_varGoertzel.size() == VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE - 1) if (m_varGoertzel.size() == VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE - 1)
{ {
m_varGoertzel.goertzel(mag); m_varGoertzel.goertzel(mag);
varPhase = Units::radiansToDegrees(m_varGoertzel.phase()); varPhase = Units::radiansToDegrees(m_varGoertzel.phase());
@ -220,13 +220,13 @@ void VORDemodSCSink::processOneSample(Complex &ci)
m_refPrev = fmfilt; m_refPrev = fmfilt;
// Calculate phase of 30Hz reference FM signal // Calculate phase of 30Hz reference FM signal
if (m_refGoertzel.size() == VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE - 1) if (m_refGoertzel.size() == VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE - 1)
{ {
m_refGoertzel.goertzel(phi); m_refGoertzel.goertzel(phi);
float phaseDeg = Units::radiansToDegrees(m_refGoertzel.phase()); float phaseDeg = Units::radiansToDegrees(m_refGoertzel.phase());
double refMag = m_refGoertzel.mag(); double refMag = m_refGoertzel.mag();
int groupDelay = (301-1)/2; int groupDelay = (301-1)/2;
float filterPhaseShift = 360.0*30.0*groupDelay/VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE; float filterPhaseShift = 360.0*30.0*groupDelay/VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE;
float shiftedPhase = phaseDeg + filterPhaseShift; float shiftedPhase = phaseDeg + filterPhaseShift;
// Calculate difference in phase, which is the radial // Calculate difference in phase, which is the radial
@ -240,7 +240,7 @@ void VORDemodSCSink::processOneSample(Complex &ci)
if (getMessageQueueToChannel()) if (getMessageQueueToChannel())
{ {
VORDemodSCReport::MsgReportRadial *msg = VORDemodSCReport::MsgReportRadial::create(phaseDifference, refMag, varMag); VORDemodReport::MsgReportRadial *msg = VORDemodReport::MsgReportRadial::create(phaseDifference, refMag, varMag);
getMessageQueueToChannel()->push(msg); getMessageQueueToChannel()->push(msg);
} }
@ -295,7 +295,7 @@ void VORDemodSCSink::processOneSample(Complex &ci)
if (getMessageQueueToChannel()) if (getMessageQueueToChannel())
{ {
VORDemodSCReport::MsgReportIdent *msg = VORDemodSCReport::MsgReportIdent::create(m_ident); VORDemodReport::MsgReportIdent *msg = VORDemodReport::MsgReportIdent::create(m_ident);
getMessageQueueToChannel()->push(msg); getMessageQueueToChannel()->push(msg);
} }
@ -336,7 +336,7 @@ void VORDemodSCSink::processOneSample(Complex &ci)
if (getMessageQueueToChannel()) if (getMessageQueueToChannel())
{ {
VORDemodSCReport::MsgReportIdent *msg = VORDemodSCReport::MsgReportIdent::create(m_ident); VORDemodReport::MsgReportIdent *msg = VORDemodReport::MsgReportIdent::create(m_ident);
getMessageQueueToChannel()->push(msg); getMessageQueueToChannel()->push(msg);
} }
@ -362,17 +362,17 @@ void VORDemodSCSink::applyChannelSettings(int channelSampleRate, int channelFreq
if ((m_channelSampleRate != channelSampleRate) || force) if ((m_channelSampleRate != channelSampleRate) || force)
{ {
m_interpolator.create(16, channelSampleRate, VORDemodSCSettings::VORDEMOD_CHANNEL_BANDWIDTH); m_interpolator.create(16, channelSampleRate, VORDemodSettings::VORDEMOD_CHANNEL_BANDWIDTH);
m_interpolatorDistanceRemain = 0; m_interpolatorDistanceRemain = 0;
m_interpolatorDistance = (Real) channelSampleRate / (Real) VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE; m_interpolatorDistance = (Real) channelSampleRate / (Real) VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE;
m_samplesPerDot7wpm = VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE*60/(50*7); m_samplesPerDot7wpm = VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE*60/(50*7);
m_samplesPerDot10wpm = VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE*60/(50*10); m_samplesPerDot10wpm = VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE*60/(50*10);
m_ncoIdent.setFreq(-1020, VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE); // +-50Hz source offset allowed m_ncoIdent.setFreq(-1020, VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE); // +-50Hz source offset allowed
m_ncoRef.setFreq(-9960, VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE); m_ncoRef.setFreq(-9960, VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE);
m_lowpassIdent.create(301, VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE, 100.0f); m_lowpassIdent.create(301, VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE, 100.0f);
m_lowpassRef.create(301, VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE, 600.0f); // Max deviation is 480Hz m_lowpassRef.create(301, VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE, 600.0f); // Max deviation is 480Hz
m_movingAverageIdent.resize(m_samplesPerDot10wpm/5); // Needs to be short enough for noise floor calculation m_movingAverageIdent.resize(m_samplesPerDot10wpm/5); // Needs to be short enough for noise floor calculation
m_binSampleCnt = 0; m_binSampleCnt = 0;
@ -388,7 +388,7 @@ void VORDemodSCSink::applyChannelSettings(int channelSampleRate, int channelFreq
m_channelFrequencyOffset = channelFrequencyOffset; m_channelFrequencyOffset = channelFrequencyOffset;
} }
void VORDemodSCSink::applySettings(const VORDemodSCSettings& settings, bool force) void VORDemodSCSink::applySettings(const VORDemodSettings& settings, bool force)
{ {
qDebug() << "VORDemodSCSink::applySettings:" qDebug() << "VORDemodSCSink::applySettings:"
<< " m_volume: " << settings.m_volume << " m_volume: " << settings.m_volume
@ -415,9 +415,9 @@ void VORDemodSCSink::applyAudioSampleRate(int sampleRate)
qDebug("VORDemodSCSink::applyAudioSampleRate: sampleRate: %d m_channelSampleRate: %d", sampleRate, m_channelSampleRate); qDebug("VORDemodSCSink::applyAudioSampleRate: sampleRate: %d m_channelSampleRate: %d", sampleRate, m_channelSampleRate);
// (ICAO Annex 10 3.3.6.3) - Optional voice audio is 300Hz to 3kHz // (ICAO Annex 10 3.3.6.3) - Optional voice audio is 300Hz to 3kHz
m_audioInterpolator.create(16, VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE, 3000.0f); m_audioInterpolator.create(16, VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE, 3000.0f);
m_audioInterpolatorDistanceRemain = 0; m_audioInterpolatorDistanceRemain = 0;
m_audioInterpolatorDistance = (Real) VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE / (Real) sampleRate; m_audioInterpolatorDistance = (Real) VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE / (Real) sampleRate;
m_bandpass.create(301, sampleRate, 300.0f, 3000.0f); m_bandpass.create(301, sampleRate, 300.0f, 3000.0f);
m_audioFifo.setSize(sampleRate); m_audioFifo.setSize(sampleRate);
m_squelchDelayLine.resize(sampleRate/5); m_squelchDelayLine.resize(sampleRate/5);

View File

@ -42,7 +42,7 @@ public:
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end); virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end);
void applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, bool force = false); void applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, bool force = false);
void applySettings(const VORDemodSCSettings& settings, bool force = false); void applySettings(const VORDemodSettings& settings, bool force = false);
void setMessageQueueToChannel(MessageQueue *messageQueue) { m_messageQueueToChannel = messageQueue; } void setMessageQueueToChannel(MessageQueue *messageQueue) { m_messageQueueToChannel = messageQueue; }
void applyAudioSampleRate(int sampleRate); void applyAudioSampleRate(int sampleRate);
@ -83,7 +83,7 @@ private:
double m_magsqPeak; double m_magsqPeak;
}; };
VORDemodSCSettings m_settings; VORDemodSettings m_settings;
int m_channelSampleRate; int m_channelSampleRate;
int m_audioSampleRate; int m_audioSampleRate;

View File

@ -33,7 +33,7 @@ int VORDemodSCWebAPIAdapter::webapiSettingsGet(
(void) errorMessage; (void) errorMessage;
response.setVorDemodScSettings(new SWGSDRangel::SWGVORDemodSCSettings()); response.setVorDemodScSettings(new SWGSDRangel::SWGVORDemodSCSettings());
response.getVorDemodScSettings()->init(); response.getVorDemodScSettings()->init();
VORDemodSC::webapiFormatChannelSettings(response, m_settings); VORDemod::webapiFormatChannelSettings(response, m_settings);
return 200; return 200;
} }
@ -46,7 +46,7 @@ int VORDemodSCWebAPIAdapter::webapiSettingsPutPatch(
{ {
(void) force; (void) force;
(void) errorMessage; (void) errorMessage;
VORDemodSC::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response); VORDemod::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response);
return 200; return 200;
} }

View File

@ -44,7 +44,7 @@ public:
QString& errorMessage); QString& errorMessage);
private: private:
VORDemodSCSettings m_settings; VORDemodSettings m_settings;
}; };
#endif // INCLUDE_VORDEMODSC_WEBAPIADAPTER_H #endif // INCLUDE_VORDEMODSC_WEBAPIADAPTER_H

View File

@ -152,7 +152,7 @@ bool VORLocalizer::handleMessage(const Message& cmd)
SWGSDRangel::SWGChannelReport* swgChannelReport = report.getSWGReport(); SWGSDRangel::SWGChannelReport* swgChannelReport = report.getSWGReport();
QString *channelType = swgChannelReport->getChannelType(); QString *channelType = swgChannelReport->getChannelType();
if (*channelType == "VORDemodSC") if (*channelType == "VORDemod")
{ {
SWGSDRangel::SWGVORDemodSCReport *swgVORDemodSCReport = swgChannelReport->getVorDemodScReport(); SWGSDRangel::SWGVORDemodSCReport *swgVORDemodSCReport = swgChannelReport->getVorDemodScReport();
int navId = swgVORDemodSCReport->getNavId(); int navId = swgVORDemodSCReport->getNavId();
@ -165,7 +165,7 @@ bool VORLocalizer::handleMessage(const Message& cmd)
m_vorSinglePlans[navId] : m_vorSinglePlans[navId] :
false; false;
// qDebug() << "VORLocalizer::handleMessage: MainCore::MsgChannelReport(VORDemodSC): " // qDebug() << "VORLocalizer::handleMessage: MainCore::MsgChannelReport(VORDemod): "
// << "navId:" << navId // << "navId:" << navId
// << "singlePlanProvided" << m_vorSinglePlans.contains(navId) // << "singlePlanProvided" << m_vorSinglePlans.contains(navId)
// << "singlePlan:" << singlePlan; // << "singlePlan:" << singlePlan;

View File

@ -1,6 +1,6 @@
/** /**
* SDRangel * SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
* *
* OpenAPI spec version: 6.0.0 * OpenAPI spec version: 6.0.0
* Contact: f4exb06@gmail.com * Contact: f4exb06@gmail.com
@ -13,7 +13,7 @@
/* /*
* SWGVORDemodSCReport.h * SWGVORDemodSCReport.h
* *
* VORDemodSC * VORDemod
*/ */
#ifndef SWGVORDemodSCReport_H_ #ifndef SWGVORDemodSCReport_H_

View File

@ -1,6 +1,6 @@
/** /**
* SDRangel * SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
* *
* OpenAPI spec version: 6.0.0 * OpenAPI spec version: 6.0.0
* Contact: f4exb06@gmail.com * Contact: f4exb06@gmail.com
@ -13,7 +13,7 @@
/* /*
* SWGVORDemodSCSettings.h * SWGVORDemodSCSettings.h
* *
* VORDemodSC * VORDemod
*/ */
#ifndef SWGVORDemodSCSettings_H_ #ifndef SWGVORDemodSCSettings_H_