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>

View File

@ -42,19 +42,19 @@
#include "vordemodscreport.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 VORDemodSC::m_channelId = "VORDemodSC";
const char * const VORDemod::m_channelIdURI = "sdrangel.channel.vordemodsc";
const char * const VORDemod::m_channelId = "VORDemod";
VORDemodSC::VORDemodSC(DeviceAPI *deviceAPI) :
VORDemod::VORDemod(DeviceAPI *deviceAPI) :
ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI),
m_basebandSampleRate(0)
{
setObjectName(m_channelId);
m_basebandSink = new VORDemodSCBaseband();
m_basebandSink = new VORDemodBaseband();
m_basebandSink->setMessageQueueToChannel(getInputMessageQueue());
m_basebandSink->moveToThread(&m_thread);
@ -68,24 +68,24 @@ VORDemodSC::VORDemodSC(DeviceAPI *deviceAPI) :
m_networkManager,
&QNetworkAccessManager::finished,
this,
&VORDemodSC::networkManagerFinished
&VORDemod::networkManagerFinished
);
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&VORDemodSC::handleIndexInDeviceSetChanged
&VORDemod::handleIndexInDeviceSetChanged
);
}
VORDemodSC::~VORDemodSC()
VORDemod::~VORDemod()
{
qDebug("VORDemodSC::~VORDemodSC");
qDebug("VORDemod::~VORDemod");
QObject::disconnect(
m_networkManager,
&QNetworkAccessManager::finished,
this,
&VORDemodSC::networkManagerFinished
&VORDemod::networkManagerFinished
);
delete m_networkManager;
m_deviceAPI->removeChannelSinkAPI(this);
@ -98,7 +98,7 @@ VORDemodSC::~VORDemodSC()
delete m_basebandSink;
}
void VORDemodSC::setDeviceAPI(DeviceAPI *deviceAPI)
void VORDemod::setDeviceAPI(DeviceAPI *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();
}
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;
m_basebandSink->feed(begin, end);
}
void VORDemodSC::start()
void VORDemod::start()
{
qDebug("VORDemodSC::start");
qDebug("VORDemod::start");
m_basebandSink->reset();
m_basebandSink->startWork();
@ -132,24 +132,24 @@ void VORDemodSC::start()
DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency);
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);
}
void VORDemodSC::stop()
void VORDemod::stop()
{
qDebug("VORDemodSC::stop");
qDebug("VORDemod::stop");
m_basebandSink->stopWork();
m_thread.quit();
m_thread.wait();
}
bool VORDemodSC::handleMessage(const Message& cmd)
bool VORDemod::handleMessage(const Message& cmd)
{
if (MsgConfigureVORDemod::match(cmd))
{
MsgConfigureVORDemod& cfg = (MsgConfigureVORDemod&) cmd;
qDebug() << "VORDemodSC::handleMessage: MsgConfigureVORDemod";
qDebug() << "VORDemod::handleMessage: MsgConfigureVORDemod";
applySettings(cfg.getSettings(), cfg.getForce());
return true;
@ -161,7 +161,7 @@ bool VORDemodSC::handleMessage(const Message& cmd)
m_centerFrequency = notif.getCenterFrequency();
// Forward to the sink
DSPSignalNotification* rep = new DSPSignalNotification(notif); // make a copy
qDebug() << "VORDemodSC::handleMessage: DSPSignalNotification";
qDebug() << "VORDemod::handleMessage: DSPSignalNotification";
m_basebandSink->getInputMessageQueue()->push(rep);
// Forward to GUI if any
if (m_guiMessageQueue) {
@ -170,16 +170,16 @@ bool VORDemodSC::handleMessage(const Message& cmd)
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_refMag = report.getRefMag();
m_varMag = report.getVarMag();
if (m_guiMessageQueue)
{
VORDemodSCReport::MsgReportRadial *msg = new VORDemodSCReport::MsgReportRadial(report);
VORDemodReport::MsgReportRadial *msg = new VORDemodReport::MsgReportRadial(report);
m_guiMessageQueue->push(msg);
}
@ -193,14 +193,14 @@ bool VORDemodSC::handleMessage(const Message& cmd)
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();
if (m_guiMessageQueue)
{
VORDemodSCReport::MsgReportIdent *msg = new VORDemodSCReport::MsgReportIdent(report);
VORDemodReport::MsgReportIdent *msg = new VORDemodReport::MsgReportIdent(report);
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;
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_navId: " << settings.m_navId
<< " m_volume: " << settings.m_volume
@ -290,7 +290,7 @@ void VORDemodSC::applySettings(const VORDemodSCSettings& settings, bool force)
reverseAPIKeys.append("identThreshold");
}
VORDemodSCBaseband::MsgConfigureVORDemodBaseband *msg = VORDemodSCBaseband::MsgConfigureVORDemodBaseband::create(settings, force);
VORDemodBaseband::MsgConfigureVORDemodBaseband *msg = VORDemodBaseband::MsgConfigureVORDemodBaseband::create(settings, force);
m_basebandSink->getInputMessageQueue()->push(msg);
if (settings.m_useReverseAPI)
@ -313,12 +313,12 @@ void VORDemodSC::applySettings(const VORDemodSCSettings& settings, bool force)
m_settings = settings;
}
QByteArray VORDemodSC::serialize() const
QByteArray VORDemod::serialize() const
{
return m_settings.serialize();
}
bool VORDemodSC::deserialize(const QByteArray& data)
bool VORDemod::deserialize(const QByteArray& 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,
QString& errorMessage)
{
@ -346,20 +346,20 @@ int VORDemodSC::webapiSettingsGet(
return 200;
}
int VORDemodSC::webapiSettingsPutPatch(
int VORDemod::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage)
{
(void) errorMessage;
VORDemodSCSettings settings = m_settings;
VORDemodSettings settings = m_settings;
webapiUpdateChannelSettings(settings, channelSettingsKeys, response);
MsgConfigureVORDemod *msg = MsgConfigureVORDemod::create(settings, force);
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
{
MsgConfigureVORDemod *msgToGUI = MsgConfigureVORDemod::create(settings, force);
@ -371,8 +371,8 @@ int VORDemodSC::webapiSettingsPutPatch(
return 200;
}
void VORDemodSC::webapiUpdateChannelSettings(
VORDemodSCSettings& settings,
void VORDemod::webapiUpdateChannelSettings(
VORDemodSettings& settings,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response)
{
@ -429,7 +429,7 @@ void VORDemodSC::webapiUpdateChannelSettings(
}
}
int VORDemodSC::webapiReportGet(
int VORDemod::webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage)
{
@ -440,7 +440,7 @@ int VORDemodSC::webapiReportGet(
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()->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;
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();
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
@ -557,10 +557,10 @@ void VORDemodSC::webapiReverseSendSettings(QList<QString>& channelSettingsKeys,
delete swgChannelSettings;
}
void VORDemodSC::sendChannelSettings(
void VORDemod::sendChannelSettings(
const QList<ObjectPipe*>& pipes,
QList<QString>& channelSettingsKeys,
const VORDemodSCSettings& settings,
const VORDemodSettings& settings,
bool force)
{
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)
{
@ -601,17 +601,17 @@ void VORDemodSC::sendChannelReport(QList<ObjectPipe*>& messagePipes)
}
}
void VORDemodSC::webapiFormatChannelSettings(
void VORDemod::webapiFormatChannelSettings(
QList<QString>& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings *swgChannelSettings,
const VORDemodSCSettings& settings,
const VORDemodSettings& settings,
bool force
)
{
swgChannelSettings->setDirection(0); // Single sink (Rx)
swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
swgChannelSettings->setChannelType(new QString("VORDemodSC"));
swgChannelSettings->setChannelType(new QString("VORDemod"));
swgChannelSettings->setVorDemodScSettings(new SWGSDRangel::SWGVORDemodSCSettings());
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();
if (replyError)
{
qWarning() << "VORDemodSC::networkManagerFinished:"
qWarning() << "VORDemod::networkManagerFinished:"
<< " error(" << (int) replyError
<< "): " << replyError
<< ": " << reply->errorString();
@ -678,13 +678,13 @@ void VORDemodSC::networkManagerFinished(QNetworkReply *reply)
{
QString answer = reply->readAll();
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();
}
void VORDemodSC::handleIndexInDeviceSetChanged(int index)
void VORDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;

View File

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

View File

@ -25,14 +25,14 @@
#include "vordemodscbaseband.h"
#include "vordemodscreport.h"
MESSAGE_CLASS_DEFINITION(VORDemodSCBaseband::MsgConfigureVORDemodBaseband, Message)
MESSAGE_CLASS_DEFINITION(VORDemodBaseband::MsgConfigureVORDemodBaseband, Message)
VORDemodSCBaseband::VORDemodSCBaseband() :
VORDemodBaseband::VORDemodBaseband() :
m_messageQueueToGUI(nullptr),
m_running(false),
m_mutex(QMutex::Recursive)
{
qDebug("VORDemodSCBaseband::VORDemodSCBaseband");
qDebug("VORDemodBaseband::VORDemodBaseband");
m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(48000));
m_channelizer = new DownChannelizer(&m_sink);
@ -41,14 +41,14 @@ VORDemodSCBaseband::VORDemodSCBaseband() :
m_channelSampleRate = 0;
}
VORDemodSCBaseband::~VORDemodSCBaseband()
VORDemodBaseband::~VORDemodBaseband()
{
m_inputMessageQueue.clear();
DSPEngine::instance()->getAudioDeviceManager()->removeAudioSink(m_sink.getAudioFifo());
delete m_channelizer;
}
void VORDemodSCBaseband::reset()
void VORDemodBaseband::reset()
{
QMutexLocker mutexLocker(&m_mutex);
m_inputMessageQueue.clear();
@ -56,21 +56,21 @@ void VORDemodSCBaseband::reset()
m_channelSampleRate = 0;
}
void VORDemodSCBaseband::startWork()
void VORDemodBaseband::startWork()
{
QMutexLocker mutexLocker(&m_mutex);
QObject::connect(
&m_sampleFifo,
&SampleSinkFifo::dataReady,
this,
&VORDemodSCBaseband::handleData,
&VORDemodBaseband::handleData,
Qt::QueuedConnection
);
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
m_running = true;
}
void VORDemodSCBaseband::stopWork()
void VORDemodBaseband::stopWork()
{
QMutexLocker mutexLocker(&m_mutex);
disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
@ -78,17 +78,17 @@ void VORDemodSCBaseband::stopWork()
&m_sampleFifo,
&SampleSinkFifo::dataReady,
this,
&VORDemodSCBaseband::handleData
&VORDemodBaseband::handleData
);
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);
}
void VORDemodSCBaseband::handleData()
void VORDemodBaseband::handleData()
{
QMutexLocker mutexLocker(&m_mutex);
@ -115,7 +115,7 @@ void VORDemodSCBaseband::handleData()
}
}
void VORDemodSCBaseband::handleInputMessages()
void VORDemodBaseband::handleInputMessages()
{
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))
{
QMutexLocker mutexLocker(&m_mutex);
MsgConfigureVORDemodBaseband& cfg = (MsgConfigureVORDemodBaseband&) cmd;
qDebug() << "VORDemodSCBaseband::handleMessage: MsgConfigureVORDemodBaseband";
qDebug() << "VORDemodBaseband::handleMessage: MsgConfigureVORDemodBaseband";
applySettings(cfg.getSettings(), cfg.getForce());
@ -143,7 +143,7 @@ bool VORDemodSCBaseband::handleMessage(const Message& cmd)
{
QMutexLocker mutexLocker(&m_mutex);
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_channelizer->setBasebandSampleRate(notif.getSampleRate());
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)
{

View File

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

View File

@ -42,30 +42,30 @@
#include "vordemodscreport.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;
}
void VORDemodSCGUI::destroy()
void VORDemodGUI::destroy()
{
delete this;
}
void VORDemodSCGUI::resetToDefaults()
void VORDemodGUI::resetToDefaults()
{
m_settings.resetToDefaults();
displaySettings();
applySettings(true);
}
QByteArray VORDemodSCGUI::serialize() const
QByteArray VORDemodGUI::serialize() const
{
return m_settings.serialize();
}
bool VORDemodSCGUI::deserialize(const QByteArray& data)
bool VORDemodGUI::deserialize(const QByteArray& data)
{
if(m_settings.deserialize(data)) {
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 minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight();
@ -85,12 +85,12 @@ void VORDemodSCGUI::resizeEvent(QResizeEvent* size)
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");
const VORDemodSC::MsgConfigureVORDemod& cfg = (VORDemodSC::MsgConfigureVORDemod&) message;
qDebug("VORDemodGUI::handleMessage: VORDemod::MsgConfigureVORDemod");
const VORDemod::MsgConfigureVORDemod& cfg = (VORDemod::MsgConfigureVORDemod&) message;
m_settings = cfg.getSettings();
blockApplySettings(true);
displaySettings();
@ -107,9 +107,9 @@ bool VORDemodSCGUI::handleMessage(const Message& message)
updateAbsoluteCenterFrequency();
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
Real varMagDB = std::round(20.0*std::log10(report.getVarMag()));
@ -143,9 +143,9 @@ bool VORDemodSCGUI::handleMessage(const Message& message)
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 identString = Morse::toString(ident); // Convert Morse to a string
@ -172,7 +172,7 @@ bool VORDemodSCGUI::handleMessage(const Message& message)
return false;
}
void VORDemodSCGUI::handleInputMessages()
void VORDemodGUI::handleInputMessages()
{
Message* message;
@ -185,19 +185,19 @@ void VORDemodSCGUI::handleInputMessages()
}
}
void VORDemodSCGUI::channelMarkerChangedByCursor()
void VORDemodGUI::channelMarkerChangedByCursor()
{
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
applySettings();
}
void VORDemodSCGUI::channelMarkerHighlightedByCursor()
void VORDemodGUI::channelMarkerHighlightedByCursor()
{
setHighlighted(m_channelMarker.getHighlighted());
}
void VORDemodSCGUI::on_deltaFrequency_changed(qint64 value)
void VORDemodGUI::on_deltaFrequency_changed(qint64 value)
{
m_channelMarker.setCenterFrequency(value);
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
@ -205,34 +205,34 @@ void VORDemodSCGUI::on_deltaFrequency_changed(qint64 value)
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));
m_settings.m_identThreshold = value / 10.0;
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));
m_settings.m_volume = value / 10.0;
applySettings();
}
void VORDemodSCGUI::on_squelch_valueChanged(int value)
void VORDemodGUI::on_squelch_valueChanged(int value)
{
ui->squelchText->setText(QString("%1 dB").arg(value));
m_settings.m_squelch = value;
applySettings();
}
void VORDemodSCGUI::on_audioMute_toggled(bool checked)
void VORDemodGUI::on_audioMute_toggled(bool checked)
{
m_settings.m_audioMute = checked;
applySettings();
}
void VORDemodSCGUI::onWidgetRolled(QWidget* widget, bool rollDown)
void VORDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
{
(void) widget;
(void) rollDown;
@ -241,7 +241,7 @@ void VORDemodSCGUI::onWidgetRolled(QWidget* widget, bool rollDown)
applySettings();
}
void VORDemodSCGUI::onMenuDialogCalled(const QPoint &p)
void VORDemodGUI::onMenuDialogCalled(const QPoint &p)
{
if (m_contextMenuType == ContextMenuChannelSettings)
{
@ -288,9 +288,9 @@ void VORDemodSCGUI::onMenuDialogCalled(const QPoint &p)
resetContextMenuType();
}
VORDemodSCGUI::VORDemodSCGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) :
VORDemodGUI::VORDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) :
ChannelGUI(parent),
ui(new Ui::VORDemodSCGUI),
ui(new Ui::VORDemodGUI),
m_pluginAPI(pluginAPI),
m_deviceUISet(deviceUISet),
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(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());
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.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.setTitle("VOR Demodulator");
m_channelMarker.blockSignals(false);
@ -344,30 +344,30 @@ VORDemodSCGUI::VORDemodSCGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
applySettings(true);
}
VORDemodSCGUI::~VORDemodSCGUI()
VORDemodGUI::~VORDemodGUI()
{
delete ui;
}
void VORDemodSCGUI::blockApplySettings(bool block)
void VORDemodGUI::blockApplySettings(bool block)
{
m_doApplySettings = !block;
}
void VORDemodSCGUI::applySettings(bool force)
void VORDemodGUI::applySettings(bool force)
{
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);
}
}
void VORDemodSCGUI::displaySettings()
void VORDemodGUI::displaySettings()
{
m_channelMarker.blockSignals(true);
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.blockSignals(false);
m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
@ -398,21 +398,21 @@ void VORDemodSCGUI::displaySettings()
blockApplySettings(false);
}
void VORDemodSCGUI::leaveEvent(QEvent* event)
void VORDemodGUI::leaveEvent(QEvent* event)
{
m_channelMarker.setHighlighted(false);
ChannelGUI::leaveEvent(event);
}
void VORDemodSCGUI::enterEvent(QEvent* event)
void VORDemodGUI::enterEvent(QEvent* event)
{
m_channelMarker.setHighlighted(true);
ChannelGUI::enterEvent(event);
}
void VORDemodSCGUI::audioSelect()
void VORDemodGUI::audioSelect()
{
qDebug("VORDemodSCGUI::audioSelect");
qDebug("VORDemodGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName);
audioSelect.exec();
@ -423,7 +423,7 @@ void VORDemodSCGUI::audioSelect()
}
}
void VORDemodSCGUI::tick()
void VORDemodGUI::tick()
{
double magsqAvg, magsqPeak;
int nbMagsqSamples;
@ -459,16 +459,16 @@ void VORDemodSCGUI::tick()
m_tickCount++;
}
void VORDemodSCGUI::makeUIConnections()
void VORDemodGUI::makeUIConnections()
{
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &VORDemodSCGUI::on_deltaFrequency_changed);
QObject::connect(ui->thresh, &QDial::valueChanged, this, &VORDemodSCGUI::on_thresh_valueChanged);
QObject::connect(ui->volume, &QDial::valueChanged, this, &VORDemodSCGUI::on_volume_valueChanged);
QObject::connect(ui->squelch, &QDial::valueChanged, this, &VORDemodSCGUI::on_squelch_valueChanged);
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &VORDemodSCGUI::on_audioMute_toggled);
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &VORDemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->thresh, &QDial::valueChanged, this, &VORDemodGUI::on_thresh_valueChanged);
QObject::connect(ui->volume, &QDial::valueChanged, this, &VORDemodGUI::on_volume_valueChanged);
QObject::connect(ui->squelch, &QDial::valueChanged, this, &VORDemodGUI::on_squelch_valueChanged);
QObject::connect(ui->audioMute, &QToolButton::toggled, this, &VORDemodGUI::on_audioMute_toggled);
}
void VORDemodSCGUI::updateAbsoluteCenterFrequency()
void VORDemodGUI::updateAbsoluteCenterFrequency()
{
setStatusFrequency(m_deviceCenterFrequency + m_settings.m_inputFrequencyOffset);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -24,7 +24,7 @@
class Serializable;
struct VORDemodSCSettings
struct VORDemodSettings
{
qint32 m_inputFrequencyOffset;
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
static const int VORDEMOD_CHANNEL_SAMPLE_RATE = 48000;
VORDemodSCSettings();
VORDemodSettings();
void resetToDefaults();
void setChannelMarker(Serializable *channelMarker) { m_channelMarker = channelMarker; }
void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; }

View File

@ -33,7 +33,7 @@
VORDemodSCSink::VORDemodSCSink() :
m_channelFrequencyOffset(0),
m_channelSampleRate(VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE),
m_channelSampleRate(VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE),
m_audioSampleRate(48000),
m_squelchCount(0),
m_squelchOpen(false),
@ -47,8 +47,8 @@ VORDemodSCSink::VORDemodSCSink() :
m_movingAverageIdent(5000),
m_prevBit(0),
m_bitTime(0),
m_varGoertzel(30, VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE),
m_refGoertzel(30, VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE)
m_varGoertzel(30, VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE),
m_refGoertzel(30, VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE)
{
m_audioBuffer.resize(1<<14);
m_audioBufferFill = 0;
@ -197,7 +197,7 @@ void VORDemodSCSink::processOneSample(Complex &ci)
// Calculate phase of 30Hz variable AM signal
double varPhase;
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);
varPhase = Units::radiansToDegrees(m_varGoertzel.phase());
@ -220,13 +220,13 @@ void VORDemodSCSink::processOneSample(Complex &ci)
m_refPrev = fmfilt;
// 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);
float phaseDeg = Units::radiansToDegrees(m_refGoertzel.phase());
double refMag = m_refGoertzel.mag();
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;
// Calculate difference in phase, which is the radial
@ -240,7 +240,7 @@ void VORDemodSCSink::processOneSample(Complex &ci)
if (getMessageQueueToChannel())
{
VORDemodSCReport::MsgReportRadial *msg = VORDemodSCReport::MsgReportRadial::create(phaseDifference, refMag, varMag);
VORDemodReport::MsgReportRadial *msg = VORDemodReport::MsgReportRadial::create(phaseDifference, refMag, varMag);
getMessageQueueToChannel()->push(msg);
}
@ -295,7 +295,7 @@ void VORDemodSCSink::processOneSample(Complex &ci)
if (getMessageQueueToChannel())
{
VORDemodSCReport::MsgReportIdent *msg = VORDemodSCReport::MsgReportIdent::create(m_ident);
VORDemodReport::MsgReportIdent *msg = VORDemodReport::MsgReportIdent::create(m_ident);
getMessageQueueToChannel()->push(msg);
}
@ -336,7 +336,7 @@ void VORDemodSCSink::processOneSample(Complex &ci)
if (getMessageQueueToChannel())
{
VORDemodSCReport::MsgReportIdent *msg = VORDemodSCReport::MsgReportIdent::create(m_ident);
VORDemodReport::MsgReportIdent *msg = VORDemodReport::MsgReportIdent::create(m_ident);
getMessageQueueToChannel()->push(msg);
}
@ -362,17 +362,17 @@ void VORDemodSCSink::applyChannelSettings(int channelSampleRate, int channelFreq
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_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_samplesPerDot10wpm = VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE*60/(50*10);
m_samplesPerDot7wpm = VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE*60/(50*7);
m_samplesPerDot10wpm = VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE*60/(50*10);
m_ncoIdent.setFreq(-1020, VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE); // +-50Hz source offset allowed
m_ncoRef.setFreq(-9960, VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE);
m_lowpassIdent.create(301, VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE, 100.0f);
m_lowpassRef.create(301, VORDemodSCSettings::VORDEMOD_CHANNEL_SAMPLE_RATE, 600.0f); // Max deviation is 480Hz
m_ncoIdent.setFreq(-1020, VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE); // +-50Hz source offset allowed
m_ncoRef.setFreq(-9960, VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE);
m_lowpassIdent.create(301, VORDemodSettings::VORDEMOD_CHANNEL_SAMPLE_RATE, 100.0f);
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_binSampleCnt = 0;
@ -388,7 +388,7 @@ void VORDemodSCSink::applyChannelSettings(int channelSampleRate, int channelFreq
m_channelFrequencyOffset = channelFrequencyOffset;
}
void VORDemodSCSink::applySettings(const VORDemodSCSettings& settings, bool force)
void VORDemodSCSink::applySettings(const VORDemodSettings& settings, bool force)
{
qDebug() << "VORDemodSCSink::applySettings:"
<< " 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);
// (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_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_audioFifo.setSize(sampleRate);
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);
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 applyAudioSampleRate(int sampleRate);
@ -83,7 +83,7 @@ private:
double m_magsqPeak;
};
VORDemodSCSettings m_settings;
VORDemodSettings m_settings;
int m_channelSampleRate;
int m_audioSampleRate;

View File

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

View File

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

View File

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

View File

@ -13,7 +13,7 @@
/*
* SWGVORDemodSCReport.h
*
* VORDemodSC
* VORDemod
*/
#ifndef SWGVORDemodSCReport_H_

View File

@ -13,7 +13,7 @@
/*
* SWGVORDemodSCSettings.h
*
* VORDemodSC
* VORDemod
*/
#ifndef SWGVORDemodSCSettings_H_