From fd61700882796d5f0a7f92ab29cbb81596b799df Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 1 May 2022 09:59:24 +0200 Subject: [PATCH] v7: rename VORDemod classes to VORDemodMC classes. Part of #1223 --- plugins/channelrx/demodvor/vordemod.cpp | 90 +++++------ plugins/channelrx/demodvor/vordemod.h | 30 ++-- .../channelrx/demodvor/vordemodbaseband.cpp | 46 +++--- plugins/channelrx/demodvor/vordemodbaseband.h | 22 +-- plugins/channelrx/demodvor/vordemodgui.cpp | 144 +++++++++--------- plugins/channelrx/demodvor/vordemodgui.h | 30 ++-- plugins/channelrx/demodvor/vordemodgui.ui | 4 +- plugins/channelrx/demodvor/vordemodplugin.cpp | 24 +-- plugins/channelrx/demodvor/vordemodplugin.h | 4 +- plugins/channelrx/demodvor/vordemodreport.cpp | 6 +- plugins/channelrx/demodvor/vordemodreport.h | 6 +- .../channelrx/demodvor/vordemodsettings.cpp | 8 +- plugins/channelrx/demodvor/vordemodsettings.h | 4 +- plugins/channelrx/demodvor/vordemodsink.cpp | 32 ++-- plugins/channelrx/demodvor/vordemodsink.h | 10 +- .../demodvor/vordemodwebapiadapter.cpp | 4 +- .../demodvor/vordemodwebapiadapter.h | 2 +- 17 files changed, 233 insertions(+), 233 deletions(-) diff --git a/plugins/channelrx/demodvor/vordemod.cpp b/plugins/channelrx/demodvor/vordemod.cpp index f09204d93..fa4fd4b10 100644 --- a/plugins/channelrx/demodvor/vordemod.cpp +++ b/plugins/channelrx/demodvor/vordemod.cpp @@ -41,19 +41,19 @@ #include "util/db.h" #include "maincore.h" -MESSAGE_CLASS_DEFINITION(VORDemod::MsgConfigureVORDemod, Message) +MESSAGE_CLASS_DEFINITION(VORDemodMC::MsgConfigureVORDemod, Message) -const char * const VORDemod::m_channelIdURI = "sdrangel.channel.vordemod"; -const char * const VORDemod::m_channelId = "VORDemod"; +const char * const VORDemodMC::m_channelIdURI = "sdrangel.channel.vordemod"; +const char * const VORDemodMC::m_channelId = "VORDemodMC"; -VORDemod::VORDemod(DeviceAPI *deviceAPI) : +VORDemodMC::VORDemodMC(DeviceAPI *deviceAPI) : ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink), m_deviceAPI(deviceAPI), m_basebandSampleRate(0) { setObjectName(m_channelId); - m_basebandSink = new VORDemodBaseband(); + m_basebandSink = new VORDemodMCBaseband(); m_basebandSink->moveToThread(&m_thread); applySettings(m_settings, true); @@ -66,24 +66,24 @@ VORDemod::VORDemod(DeviceAPI *deviceAPI) : m_networkManager, &QNetworkAccessManager::finished, this, - &VORDemod::networkManagerFinished + &VORDemodMC::networkManagerFinished ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, this, - &VORDemod::handleIndexInDeviceSetChanged + &VORDemodMC::handleIndexInDeviceSetChanged ); } -VORDemod::~VORDemod() +VORDemodMC::~VORDemodMC() { - qDebug("VORDemod::~VORDemod"); + qDebug("VORDemodMC::~VORDemodMC"); QObject::disconnect( m_networkManager, &QNetworkAccessManager::finished, this, - &VORDemod::networkManagerFinished + &VORDemodMC::networkManagerFinished ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); @@ -96,7 +96,7 @@ VORDemod::~VORDemod() delete m_basebandSink; } -void VORDemod::setDeviceAPI(DeviceAPI *deviceAPI) +void VORDemodMC::setDeviceAPI(DeviceAPI *deviceAPI) { if (deviceAPI != m_deviceAPI) { @@ -108,20 +108,20 @@ void VORDemod::setDeviceAPI(DeviceAPI *deviceAPI) } } -uint32_t VORDemod::getNumberOfDeviceStreams() const +uint32_t VORDemodMC::getNumberOfDeviceStreams() const { return m_deviceAPI->getNbSourceStreams(); } -void VORDemod::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool firstOfBurst) +void VORDemodMC::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool firstOfBurst) { (void) firstOfBurst; m_basebandSink->feed(begin, end); } -void VORDemod::start() +void VORDemodMC::start() { - qDebug("VORDemod::start"); + qDebug("VORDemodMC::start"); m_basebandSink->reset(); m_basebandSink->startWork(); @@ -130,24 +130,24 @@ void VORDemod::start() DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); m_basebandSink->getInputMessageQueue()->push(dspMsg); - VORDemodBaseband::MsgConfigureVORDemodBaseband *msg = VORDemodBaseband::MsgConfigureVORDemodBaseband::create(m_settings, true); + VORDemodMCBaseband::MsgConfigureVORDemodBaseband *msg = VORDemodMCBaseband::MsgConfigureVORDemodBaseband::create(m_settings, true); m_basebandSink->getInputMessageQueue()->push(msg); } -void VORDemod::stop() +void VORDemodMC::stop() { - qDebug("VORDemod::stop"); + qDebug("VORDemodMC::stop"); m_basebandSink->stopWork(); m_thread.quit(); m_thread.wait(); } -bool VORDemod::handleMessage(const Message& cmd) +bool VORDemodMC::handleMessage(const Message& cmd) { if (MsgConfigureVORDemod::match(cmd)) { MsgConfigureVORDemod& cfg = (MsgConfigureVORDemod&) cmd; - qDebug() << "VORDemod::handleMessage: MsgConfigureVORDemod"; + qDebug() << "VORDemodMC::handleMessage: MsgConfigureVORDemod"; applySettings(cfg.getSettings(), cfg.getForce()); return true; @@ -159,7 +159,7 @@ bool VORDemod::handleMessage(const Message& cmd) m_centerFrequency = notif.getCenterFrequency(); // Forward to the sink DSPSignalNotification* rep = new DSPSignalNotification(notif); // make a copy - qDebug() << "VORDemod::handleMessage: DSPSignalNotification"; + qDebug() << "VORDemodMC::handleMessage: DSPSignalNotification"; m_basebandSink->getInputMessageQueue()->push(rep); // Forward to GUI if any if (m_guiMessageQueue) { @@ -174,9 +174,9 @@ bool VORDemod::handleMessage(const Message& cmd) } } -void VORDemod::applySettings(const VORDemodSettings& settings, bool force) +void VORDemodMC::applySettings(const VORDemodMCSettings& settings, bool force) { - qDebug() << "VORDemod::applySettings:" + qDebug() << "VORDemodMC::applySettings:" << " m_volume: " << settings.m_volume << " m_squelch: " << settings.m_squelch << " m_audioMute: " << settings.m_audioMute @@ -227,7 +227,7 @@ void VORDemod::applySettings(const VORDemodSettings& settings, bool force) reverseAPIKeys.append("magDecAdjust"); } - VORDemodBaseband::MsgConfigureVORDemodBaseband *msg = VORDemodBaseband::MsgConfigureVORDemodBaseband::create(settings, force); + VORDemodMCBaseband::MsgConfigureVORDemodBaseband *msg = VORDemodMCBaseband::MsgConfigureVORDemodBaseband::create(settings, force); m_basebandSink->getInputMessageQueue()->push(msg); if (settings.m_useReverseAPI) @@ -250,12 +250,12 @@ void VORDemod::applySettings(const VORDemodSettings& settings, bool force) m_settings = settings; } -QByteArray VORDemod::serialize() const +QByteArray VORDemodMC::serialize() const { return m_settings.serialize(); } -bool VORDemod::deserialize(const QByteArray& data) +bool VORDemodMC::deserialize(const QByteArray& data) { if (m_settings.deserialize(data)) { @@ -272,7 +272,7 @@ bool VORDemod::deserialize(const QByteArray& data) } } -int VORDemod::webapiSettingsGet( +int VORDemodMC::webapiSettingsGet( SWGSDRangel::SWGChannelSettings& response, QString& errorMessage) { @@ -283,20 +283,20 @@ int VORDemod::webapiSettingsGet( return 200; } -int VORDemod::webapiSettingsPutPatch( +int VORDemodMC::webapiSettingsPutPatch( bool force, const QStringList& channelSettingsKeys, SWGSDRangel::SWGChannelSettings& response, QString& errorMessage) { (void) errorMessage; - VORDemodSettings settings = m_settings; + VORDemodMCSettings settings = m_settings; webapiUpdateChannelSettings(settings, channelSettingsKeys, response); MsgConfigureVORDemod *msg = MsgConfigureVORDemod::create(settings, force); m_inputMessageQueue.push(msg); - qDebug("VORDemod::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue); + qDebug("VORDemodMC::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue); if (m_guiMessageQueue) // forward to GUI if any { MsgConfigureVORDemod *msgToGUI = MsgConfigureVORDemod::create(settings, force); @@ -308,8 +308,8 @@ int VORDemod::webapiSettingsPutPatch( return 200; } -void VORDemod::webapiUpdateChannelSettings( - VORDemodSettings& settings, +void VORDemodMC::webapiUpdateChannelSettings( + VORDemodMCSettings& settings, const QStringList& channelSettingsKeys, SWGSDRangel::SWGChannelSettings& response) { @@ -364,7 +364,7 @@ void VORDemod::webapiUpdateChannelSettings( } } -int VORDemod::webapiReportGet( +int VORDemodMC::webapiReportGet( SWGSDRangel::SWGChannelReport& response, QString& errorMessage) { @@ -375,7 +375,7 @@ int VORDemod::webapiReportGet( return 200; } -void VORDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const VORDemodSettings& settings) +void VORDemodMC::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const VORDemodMCSettings& settings) { response.getVorDemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0); response.getVorDemodSettings()->setRgbColor(settings.m_rgbColor); @@ -439,7 +439,7 @@ void VORDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp } } -void VORDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) +void VORDemodMC::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) { double magsqAvg, magsqPeak; int nbMagsqSamples; @@ -450,7 +450,7 @@ void VORDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response response.getVorDemodReport()->setAudioSampleRate(m_basebandSink->getAudioSampleRate()); } -void VORDemod::webapiReverseSendSettings(QList& channelSettingsKeys, const VORDemodSettings& settings, bool force) +void VORDemodMC::webapiReverseSendSettings(QList& channelSettingsKeys, const VORDemodMCSettings& settings, bool force) { SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); @@ -475,10 +475,10 @@ void VORDemod::webapiReverseSendSettings(QList& channelSettingsKeys, co delete swgChannelSettings; } -void VORDemod::sendChannelSettings( +void VORDemodMC::sendChannelSettings( const QList& pipes, QList& channelSettingsKeys, - const VORDemodSettings& settings, + const VORDemodMCSettings& settings, bool force) { for (const auto& pipe : pipes) @@ -500,17 +500,17 @@ void VORDemod::sendChannelSettings( } } -void VORDemod::webapiFormatChannelSettings( +void VORDemodMC::webapiFormatChannelSettings( QList& channelSettingsKeys, SWGSDRangel::SWGChannelSettings *swgChannelSettings, - const VORDemodSettings& settings, + const VORDemodMCSettings& settings, bool force ) { swgChannelSettings->setDirection(0); // Single sink (Rx) swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet()); swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex()); - swgChannelSettings->setChannelType(new QString("VORDemod")); + swgChannelSettings->setChannelType(new QString("VORDemodMC")); swgChannelSettings->setVorDemodSettings(new SWGSDRangel::SWGVORDemodSettings()); SWGSDRangel::SWGVORDemodSettings *swgVORDemodSettings = swgChannelSettings->getVorDemodSettings(); @@ -559,13 +559,13 @@ void VORDemod::webapiFormatChannelSettings( } } -void VORDemod::networkManagerFinished(QNetworkReply *reply) +void VORDemodMC::networkManagerFinished(QNetworkReply *reply) { QNetworkReply::NetworkError replyError = reply->error(); if (replyError) { - qWarning() << "VORDemod::networkManagerFinished:" + qWarning() << "VORDemodMC::networkManagerFinished:" << " error(" << (int) replyError << "): " << replyError << ": " << reply->errorString(); @@ -574,13 +574,13 @@ void VORDemod::networkManagerFinished(QNetworkReply *reply) { QString answer = reply->readAll(); answer.chop(1); // remove last \n - qDebug("VORDemod::networkManagerFinished: reply:\n%s", answer.toStdString().c_str()); + qDebug("VORDemodMC::networkManagerFinished: reply:\n%s", answer.toStdString().c_str()); } reply->deleteLater(); } -void VORDemod::handleIndexInDeviceSetChanged(int index) +void VORDemodMC::handleIndexInDeviceSetChanged(int index) { if (index < 0) { return; diff --git a/plugins/channelrx/demodvor/vordemod.h b/plugins/channelrx/demodvor/vordemod.h index ef16083d6..f6325b5d8 100644 --- a/plugins/channelrx/demodvor/vordemod.h +++ b/plugins/channelrx/demodvor/vordemod.h @@ -37,33 +37,33 @@ class QThread; class DeviceAPI; class ObjectPipe; -class VORDemod : public BasebandSampleSink, public ChannelAPI { +class VORDemodMC : public BasebandSampleSink, public ChannelAPI { public: class MsgConfigureVORDemod : public Message { MESSAGE_CLASS_DECLARATION public: - const VORDemodSettings& getSettings() const { return m_settings; } + const VORDemodMCSettings& getSettings() const { return m_settings; } bool getForce() const { return m_force; } - static MsgConfigureVORDemod* create(const VORDemodSettings& settings, bool force) + static MsgConfigureVORDemod* create(const VORDemodMCSettings& settings, bool force) { return new MsgConfigureVORDemod(settings, force); } private: - VORDemodSettings m_settings; + VORDemodMCSettings m_settings; bool m_force; - MsgConfigureVORDemod(const VORDemodSettings& settings, bool force) : + MsgConfigureVORDemod(const VORDemodMCSettings& settings, bool force) : Message(), m_settings(settings), m_force(force) { } }; - VORDemod(DeviceAPI *deviceAPI); - virtual ~VORDemod(); + VORDemodMC(DeviceAPI *deviceAPI); + virtual ~VORDemodMC(); 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 VORDemodSettings& settings); + const VORDemodMCSettings& settings); static void webapiUpdateChannelSettings( - VORDemodSettings& settings, + VORDemodMCSettings& settings, const QStringList& channelSettingsKeys, SWGSDRangel::SWGChannelSettings& response); @@ -138,8 +138,8 @@ public: private: DeviceAPI *m_deviceAPI; QThread m_thread; - VORDemodBaseband* m_basebandSink; - VORDemodSettings m_settings; + VORDemodMCBaseband* m_basebandSink; + VORDemodMCSettings m_settings; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink qint64 m_centerFrequency; @@ -147,19 +147,19 @@ private: QNetworkRequest m_networkRequest; virtual bool handleMessage(const Message& cmd); - void applySettings(const VORDemodSettings& settings, bool force = false); + void applySettings(const VORDemodMCSettings& settings, bool force = false); void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); - void webapiReverseSendSettings(QList& channelSettingsKeys, const VORDemodSettings& settings, bool force); + void webapiReverseSendSettings(QList& channelSettingsKeys, const VORDemodMCSettings& settings, bool force); void sendChannelSettings( const QList& pipes, QList& channelSettingsKeys, - const VORDemodSettings& settings, + const VORDemodMCSettings& settings, bool force ); void webapiFormatChannelSettings( QList& channelSettingsKeys, SWGSDRangel::SWGChannelSettings *swgChannelSettings, - const VORDemodSettings& settings, + const VORDemodMCSettings& settings, bool force ); diff --git a/plugins/channelrx/demodvor/vordemodbaseband.cpp b/plugins/channelrx/demodvor/vordemodbaseband.cpp index 41911eb34..9cdebd04f 100644 --- a/plugins/channelrx/demodvor/vordemodbaseband.cpp +++ b/plugins/channelrx/demodvor/vordemodbaseband.cpp @@ -25,15 +25,15 @@ #include "vordemodbaseband.h" #include "vordemodreport.h" -MESSAGE_CLASS_DEFINITION(VORDemodBaseband::MsgConfigureVORDemodBaseband, Message) +MESSAGE_CLASS_DEFINITION(VORDemodMCBaseband::MsgConfigureVORDemodBaseband, Message) -VORDemodBaseband::VORDemodBaseband() : +VORDemodMCBaseband::VORDemodMCBaseband() : m_running(false), m_mutex(QMutex::Recursive), m_messageQueueToGUI(nullptr), m_basebandSampleRate(0) { - qDebug("VORDemodBaseband::VORDemodBaseband"); + qDebug("VORDemodMCBaseband::VORDemodMCBaseband"); m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(48000)); @@ -41,7 +41,7 @@ VORDemodBaseband::VORDemodBaseband() : DSPEngine::instance()->getAudioDeviceManager()->addAudioSink(&m_audioFifoBug, getInputMessageQueue()); } -VORDemodBaseband::~VORDemodBaseband() +VORDemodMCBaseband::~VORDemodMCBaseband() { m_inputMessageQueue.clear(); @@ -60,28 +60,28 @@ VORDemodBaseband::~VORDemodBaseband() m_channelizers.clear(); } -void VORDemodBaseband::reset() +void VORDemodMCBaseband::reset() { QMutexLocker mutexLocker(&m_mutex); m_inputMessageQueue.clear(); m_sampleFifo.reset(); } -void VORDemodBaseband::startWork() +void VORDemodMCBaseband::startWork() { QMutexLocker mutexLocker(&m_mutex); QObject::connect( &m_sampleFifo, &SampleSinkFifo::dataReady, this, - &VORDemodBaseband::handleData, + &VORDemodMCBaseband::handleData, Qt::QueuedConnection ); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); m_running = true; } -void VORDemodBaseband::stopWork() +void VORDemodMCBaseband::stopWork() { QMutexLocker mutexLocker(&m_mutex); disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); @@ -89,17 +89,17 @@ void VORDemodBaseband::stopWork() &m_sampleFifo, &SampleSinkFifo::dataReady, this, - &VORDemodBaseband::handleData + &VORDemodMCBaseband::handleData ); m_running = false; } -void VORDemodBaseband::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end) +void VORDemodMCBaseband::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end) { m_sampleFifo.write(begin, end); } -void VORDemodBaseband::handleData() +void VORDemodMCBaseband::handleData() { QMutexLocker mutexLocker(&m_mutex); @@ -128,7 +128,7 @@ void VORDemodBaseband::handleData() } } -void VORDemodBaseband::handleInputMessages() +void VORDemodMCBaseband::handleInputMessages() { Message* message; @@ -140,13 +140,13 @@ void VORDemodBaseband::handleInputMessages() } } -bool VORDemodBaseband::handleMessage(const Message& cmd) +bool VORDemodMCBaseband::handleMessage(const Message& cmd) { if (MsgConfigureVORDemodBaseband::match(cmd)) { QMutexLocker mutexLocker(&m_mutex); MsgConfigureVORDemodBaseband& cfg = (MsgConfigureVORDemodBaseband&) cmd; - qDebug() << "VORDemodBaseband::handleMessage: MsgConfigureVORDemodBaseband"; + qDebug() << "VORDemodMCBaseband::handleMessage: MsgConfigureVORDemodBaseband"; applySettings(cfg.getSettings(), cfg.getForce()); @@ -156,7 +156,7 @@ bool VORDemodBaseband::handleMessage(const Message& cmd) { QMutexLocker mutexLocker(&m_mutex); DSPSignalNotification& notif = (DSPSignalNotification&) cmd; - qDebug() << "VORDemodBaseband::handleMessage: DSPSignalNotification: basebandSampleRate: " << notif.getSampleRate() << " centerFrequency: " << notif.getCenterFrequency(); + qDebug() << "VORDemodMCBaseband::handleMessage: DSPSignalNotification: basebandSampleRate: " << notif.getSampleRate() << " centerFrequency: " << notif.getCenterFrequency(); m_centerFrequency = notif.getCenterFrequency(); setBasebandSampleRate(notif.getSampleRate()); m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(m_basebandSampleRate)); @@ -170,14 +170,14 @@ bool VORDemodBaseband::handleMessage(const Message& cmd) } // Calculate offset of VOR center frequency from sample source center frequency -void VORDemodBaseband::calculateOffset(VORDemodSink *sink) +void VORDemodMCBaseband::calculateOffset(VORDemodMCSink *sink) { int frequencyOffset = sink->m_vorFrequencyHz - m_centerFrequency; bool outOfBand = std::abs(frequencyOffset)+VORDEMOD_CHANNEL_BANDWIDTH > (m_basebandSampleRate/2); if (m_messageQueueToGUI != nullptr) { - VORDemodReport::MsgReportFreqOffset *msg = VORDemodReport::MsgReportFreqOffset::create(sink->m_subChannelId, frequencyOffset, outOfBand); + VORDemodMCReport::MsgReportFreqOffset *msg = VORDemodMCReport::MsgReportFreqOffset::create(sink->m_subChannelId, frequencyOffset, outOfBand); m_messageQueueToGUI->push(msg); } @@ -185,15 +185,15 @@ void VORDemodBaseband::calculateOffset(VORDemodSink *sink) sink->m_outOfBand = outOfBand; } -void VORDemodBaseband::applySettings(const VORDemodSettings& settings, bool force) +void VORDemodMCBaseband::applySettings(const VORDemodMCSettings& settings, bool force) { // Remove sub-channels no longer needed for (int i = 0; i < m_sinks.size(); i++) { if (!settings.m_subChannelSettings.contains(m_sinks[i]->m_subChannelId)) { - qDebug() << "VORDemodBaseband::applySettings: Removing sink " << m_sinks[i]->m_subChannelId; - VORDemodSink *sink = m_sinks[i]; + qDebug() << "VORDemodMCBaseband::applySettings: Removing sink " << m_sinks[i]->m_subChannelId; + VORDemodMCSink *sink = m_sinks[i]; DSPEngine::instance()->getAudioDeviceManager()->removeAudioSink(m_sinks[i]->getAudioFifo()); m_sinks.removeAt(i); delete sink; @@ -217,8 +217,8 @@ void VORDemodBaseband::applySettings(const VORDemodSettings& settings, bool forc if (j == m_sinks.size()) { // Add a sub-channel sink - qDebug() << "VORDemodBaseband::applySettings: Adding sink " << subChannelSettings->m_id; - VORDemodSink *sink = new VORDemodSink(settings, subChannelSettings->m_id, m_messageQueueToGUI); + qDebug() << "VORDemodMCBaseband::applySettings: Adding sink " << subChannelSettings->m_id; + VORDemodMCSink *sink = new VORDemodMCSink(settings, subChannelSettings->m_id, m_messageQueueToGUI); DownChannelizer *channelizer = new DownChannelizer(sink); channelizer->setBasebandSampleRate(m_basebandSampleRate); DSPEngine::instance()->getAudioDeviceManager()->addAudioSink(sink->getAudioFifo(), getInputMessageQueue()); @@ -269,7 +269,7 @@ void VORDemodBaseband::applySettings(const VORDemodSettings& settings, bool forc m_settings = settings; } -void VORDemodBaseband::setBasebandSampleRate(int sampleRate) +void VORDemodMCBaseband::setBasebandSampleRate(int sampleRate) { m_basebandSampleRate = sampleRate; for (int i = 0; i < m_sinks.size(); i++) diff --git a/plugins/channelrx/demodvor/vordemodbaseband.h b/plugins/channelrx/demodvor/vordemodbaseband.h index 5dad65a95..13f1633b4 100644 --- a/plugins/channelrx/demodvor/vordemodbaseband.h +++ b/plugins/channelrx/demodvor/vordemodbaseband.h @@ -30,7 +30,7 @@ class DownChannelizer; -class VORDemodBaseband : public QObject +class VORDemodMCBaseband : public QObject { Q_OBJECT public: @@ -38,27 +38,27 @@ public: MESSAGE_CLASS_DECLARATION public: - const VORDemodSettings& getSettings() const { return m_settings; } + const VORDemodMCSettings& getSettings() const { return m_settings; } bool getForce() const { return m_force; } - static MsgConfigureVORDemodBaseband* create(const VORDemodSettings& settings, bool force) + static MsgConfigureVORDemodBaseband* create(const VORDemodMCSettings& settings, bool force) { return new MsgConfigureVORDemodBaseband(settings, force); } private: - VORDemodSettings m_settings; + VORDemodMCSettings m_settings; bool m_force; - MsgConfigureVORDemodBaseband(const VORDemodSettings& settings, bool force) : + MsgConfigureVORDemodBaseband(const VORDemodMCSettings& settings, bool force) : Message(), m_settings(settings), m_force(force) { } }; - VORDemodBaseband(); - ~VORDemodBaseband(); + VORDemodMCBaseband(); + ~VORDemodMCBaseband(); void reset(); void startWork(); void stopWork(); @@ -115,10 +115,10 @@ public: private: SampleSinkFifo m_sampleFifo; QList m_channelizers; - QList m_sinks; + QList m_sinks; AudioFifo m_audioFifoBug; // FIXME: Removing this results in audio stopping when demod is closed MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication - VORDemodSettings m_settings; + VORDemodMCSettings m_settings; bool m_running; QMutex m_mutex; MessageQueue *m_messageQueueToGUI; @@ -126,8 +126,8 @@ private: int m_centerFrequency; bool handleMessage(const Message& cmd); - void calculateOffset(VORDemodSink *sink); - void applySettings(const VORDemodSettings& settings, bool force = false); + void calculateOffset(VORDemodMCSink *sink); + void applySettings(const VORDemodMCSettings& settings, bool force = false); private slots: void handleInputMessages(); diff --git a/plugins/channelrx/demodvor/vordemodgui.cpp b/plugins/channelrx/demodvor/vordemodgui.cpp index 1a4820be2..30ffacafd 100644 --- a/plugins/channelrx/demodvor/vordemodgui.cpp +++ b/plugins/channelrx/demodvor/vordemodgui.cpp @@ -390,7 +390,7 @@ static bool calcIntersectionPoint(float lat1, float lon1, float bearing1, float return true; } -VORGUI::VORGUI(NavAid *navAid, VORDemodGUI *gui) : +VORGUI::VORGUI(NavAid *navAid, VORDemodMCGUI *gui) : m_navAid(navAid), m_gui(gui) { @@ -577,7 +577,7 @@ bool VORModel::findIntersection(float &lat, float &lon) return false; } -void VORDemodGUI::resizeTable() +void VORDemodMCGUI::resizeTable() { // Fill table with a row of dummy data that will size the columns nicely // Trailing spaces are for sort arrow @@ -600,7 +600,7 @@ void VORDemodGUI::resizeTable() } // Columns in table reordered -void VORDemodGUI::vorData_sectionMoved(int logicalIndex, int oldVisualIndex, int newVisualIndex) +void VORDemodMCGUI::vorData_sectionMoved(int logicalIndex, int oldVisualIndex, int newVisualIndex) { (void) oldVisualIndex; @@ -608,7 +608,7 @@ void VORDemodGUI::vorData_sectionMoved(int logicalIndex, int oldVisualIndex, int } // Column in table resized (when hidden size is 0) -void VORDemodGUI::vorData_sectionResized(int logicalIndex, int oldSize, int newSize) +void VORDemodMCGUI::vorData_sectionResized(int logicalIndex, int oldSize, int newSize) { (void) oldSize; @@ -616,13 +616,13 @@ void VORDemodGUI::vorData_sectionResized(int logicalIndex, int oldSize, int newS } // Right click in table header - show column select menu -void VORDemodGUI::columnSelectMenu(QPoint pos) +void VORDemodMCGUI::columnSelectMenu(QPoint pos) { menu->popup(ui->vorData->horizontalHeader()->viewport()->mapToGlobal(pos)); } // Hide/show column when menu selected -void VORDemodGUI::columnSelectMenuChecked(bool checked) +void VORDemodMCGUI::columnSelectMenuChecked(bool checked) { (void) checked; @@ -635,7 +635,7 @@ void VORDemodGUI::columnSelectMenuChecked(bool checked) } // Create column select menu item -QAction *VORDemodGUI::createCheckableItem(QString &text, int idx, bool checked) +QAction *VORDemodMCGUI::createCheckableItem(QString &text, int idx, bool checked) { QAction *action = new QAction(text, this); action->setCheckable(true); @@ -646,7 +646,7 @@ QAction *VORDemodGUI::createCheckableItem(QString &text, int idx, bool checked) } // Called when a VOR is selected on the map -void VORDemodGUI::selectVOR(VORGUI *vorGUI, bool selected) +void VORDemodMCGUI::selectVOR(VORGUI *vorGUI, bool selected) { if (selected) { @@ -691,7 +691,7 @@ void VORDemodGUI::selectVOR(VORGUI *vorGUI, bool selected) } } -void VORDemodGUI::updateVORs() +void VORDemodMCGUI::updateVORs() { m_vorModel.removeAllVORs(); QHash::iterator i = m_vors->begin(); @@ -714,30 +714,30 @@ void VORDemodGUI::updateVORs() } } -VORDemodGUI* VORDemodGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) +VORDemodMCGUI* VORDemodMCGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) { - VORDemodGUI* gui = new VORDemodGUI(pluginAPI, deviceUISet, rxChannel); + VORDemodMCGUI* gui = new VORDemodMCGUI(pluginAPI, deviceUISet, rxChannel); return gui; } -void VORDemodGUI::destroy() +void VORDemodMCGUI::destroy() { delete this; } -void VORDemodGUI::resetToDefaults() +void VORDemodMCGUI::resetToDefaults() { m_settings.resetToDefaults(); displaySettings(); applySettings(true); } -QByteArray VORDemodGUI::serialize() const +QByteArray VORDemodMCGUI::serialize() const { return m_settings.serialize(); } -bool VORDemodGUI::deserialize(const QByteArray& data) +bool VORDemodMCGUI::deserialize(const QByteArray& data) { if(m_settings.deserialize(data)) { displaySettings(); @@ -749,12 +749,12 @@ bool VORDemodGUI::deserialize(const QByteArray& data) } } -bool VORDemodGUI::handleMessage(const Message& message) +bool VORDemodMCGUI::handleMessage(const Message& message) { - if (VORDemod::MsgConfigureVORDemod::match(message)) + if (VORDemodMC::MsgConfigureVORDemod::match(message)) { - qDebug("VORDemodGUI::handleMessage: VORDemod::MsgConfigureVORDemod"); - const VORDemod::MsgConfigureVORDemod& cfg = (VORDemod::MsgConfigureVORDemod&) message; + qDebug("VORDemodMCGUI::handleMessage: VORDemodMC::MsgConfigureVORDemod"); + const VORDemodMC::MsgConfigureVORDemod& cfg = (VORDemodMC::MsgConfigureVORDemod&) message; m_settings = cfg.getSettings(); blockApplySettings(true); displaySettings(); @@ -769,9 +769,9 @@ bool VORDemodGUI::handleMessage(const Message& message) updateAbsoluteCenterFrequency(); return true; } - else if (VORDemodReport::MsgReportRadial::match(message)) + else if (VORDemodMCReport::MsgReportRadial::match(message)) { - VORDemodReport::MsgReportRadial& report = (VORDemodReport::MsgReportRadial&) message; + VORDemodMCReport::MsgReportRadial& report = (VORDemodMCReport::MsgReportRadial&) message; int subChannelId = report.getSubChannelId(); VORGUI *vorGUI = m_selectedVORs.value(subChannelId); @@ -806,9 +806,9 @@ bool VORDemodGUI::handleMessage(const Message& message) return true; } - else if (VORDemodReport::MsgReportFreqOffset::match(message)) + else if (VORDemodMCReport::MsgReportFreqOffset::match(message)) { - VORDemodReport::MsgReportFreqOffset& report = (VORDemodReport::MsgReportFreqOffset&) message; + VORDemodMCReport::MsgReportFreqOffset& report = (VORDemodMCReport::MsgReportFreqOffset&) message; int subChannelId = report.getSubChannelId(); VORGUI *vorGUI = m_selectedVORs.value(subChannelId); @@ -826,9 +826,9 @@ bool VORDemodGUI::handleMessage(const Message& message) else vorGUI->m_offsetItem->setForeground(QBrush(Qt::white)); } - else if (VORDemodReport::MsgReportIdent::match(message)) + else if (VORDemodMCReport::MsgReportIdent::match(message)) { - VORDemodReport::MsgReportIdent& report = (VORDemodReport::MsgReportIdent&) message; + VORDemodMCReport::MsgReportIdent& report = (VORDemodMCReport::MsgReportIdent&) message; int subChannelId = report.getSubChannelId(); VORGUI *vorGUI = m_selectedVORs.value(subChannelId); @@ -870,7 +870,7 @@ bool VORDemodGUI::handleMessage(const Message& message) return false; } -void VORDemodGUI::handleInputMessages() +void VORDemodMCGUI::handleInputMessages() { Message* message; @@ -883,43 +883,43 @@ void VORDemodGUI::handleInputMessages() } } -void VORDemodGUI::channelMarkerChangedByCursor() +void VORDemodMCGUI::channelMarkerChangedByCursor() { } -void VORDemodGUI::channelMarkerHighlightedByCursor() +void VORDemodMCGUI::channelMarkerHighlightedByCursor() { setHighlighted(m_channelMarker.getHighlighted()); } -void VORDemodGUI::on_thresh_valueChanged(int value) +void VORDemodMCGUI::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 VORDemodGUI::on_volume_valueChanged(int value) +void VORDemodMCGUI::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 VORDemodGUI::on_squelch_valueChanged(int value) +void VORDemodMCGUI::on_squelch_valueChanged(int value) { ui->squelchText->setText(QString("%1 dB").arg(value)); m_settings.m_squelch = value; applySettings(); } -void VORDemodGUI::on_audioMute_toggled(bool checked) +void VORDemodMCGUI::on_audioMute_toggled(bool checked) { m_settings.m_audioMute = checked; applySettings(); } -qint64 VORDemodGUI::fileAgeInDays(QString filename) +qint64 VORDemodMCGUI::fileAgeInDays(QString filename) { QFile file(filename); if (file.exists()) @@ -933,7 +933,7 @@ qint64 VORDemodGUI::fileAgeInDays(QString filename) return -1; } -bool VORDemodGUI::confirmDownload(QString filename) +bool VORDemodMCGUI::confirmDownload(QString filename) { qint64 age = fileAgeInDays(filename); if ((age == -1) || (age > 100)) @@ -951,7 +951,7 @@ bool VORDemodGUI::confirmDownload(QString filename) } } -QString VORDemodGUI::getDataDir() +QString VORDemodMCGUI::getDataDir() { // Get directory to store app data in QStringList locations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation); @@ -959,7 +959,7 @@ QString VORDemodGUI::getDataDir() return locations[0]; } -QString VORDemodGUI::getOpenAIPVORDBFilename(int i) +QString VORDemodMCGUI::getOpenAIPVORDBFilename(int i) { if (countryCodes[i] != nullptr) return getDataDir() + "/" + countryCodes[i] + "_nav.aip"; @@ -967,7 +967,7 @@ QString VORDemodGUI::getOpenAIPVORDBFilename(int i) return ""; } -QString VORDemodGUI::getOpenAIPVORDBURL(int i) +QString VORDemodMCGUI::getOpenAIPVORDBURL(int i) { if (countryCodes[i] != nullptr) return QString(OPENAIP_NAVAIDS_URL).arg(countryCodes[i]); @@ -975,12 +975,12 @@ QString VORDemodGUI::getOpenAIPVORDBURL(int i) return ""; } -QString VORDemodGUI::getVORDBFilename() +QString VORDemodMCGUI::getVORDBFilename() { return getDataDir() + "/vorDatabase.csv"; } -void VORDemodGUI::updateDownloadProgress(qint64 bytesRead, qint64 totalBytes) +void VORDemodMCGUI::updateDownloadProgress(qint64 bytesRead, qint64 totalBytes) { if (m_progressDialog) { @@ -989,7 +989,7 @@ void VORDemodGUI::updateDownloadProgress(qint64 bytesRead, qint64 totalBytes) } } -void VORDemodGUI::downloadFinished(const QString& filename, bool success) +void VORDemodMCGUI::downloadFinished(const QString& filename, bool success) { bool closeDialog = true; if (success) @@ -1022,12 +1022,12 @@ void VORDemodGUI::downloadFinished(const QString& filename, bool success) } else { - qDebug() << "VORDemodGUI::downloadFinished: Unexpected filename: " << filename; + qDebug() << "VORDemodMCGUI::downloadFinished: Unexpected filename: " << filename; } } else { - qDebug() << "VORDemodGUI::downloadFinished: Failed: " << filename; + qDebug() << "VORDemodMCGUI::downloadFinished: Failed: " << filename; QMessageBox::warning(this, "Download failed", QString("Failed to download %1").arg(filename)); } if (closeDialog && m_progressDialog) @@ -1038,7 +1038,7 @@ void VORDemodGUI::downloadFinished(const QString& filename, bool success) } } -void VORDemodGUI::on_getOurAirportsVORDB_clicked(bool checked) +void VORDemodMCGUI::on_getOurAirportsVORDB_clicked(bool checked) { (void) checked; @@ -1060,7 +1060,7 @@ void VORDemodGUI::on_getOurAirportsVORDB_clicked(bool checked) } } -void VORDemodGUI::on_getOpenAIPVORDB_clicked(bool checked) +void VORDemodMCGUI::on_getOpenAIPVORDB_clicked(bool checked) { (void) checked; @@ -1085,7 +1085,7 @@ void VORDemodGUI::on_getOpenAIPVORDB_clicked(bool checked) } } -void VORDemodGUI::readNavAids() +void VORDemodMCGUI::readNavAids() { m_vors = new QHash(); for (int countryIndex = 0; countryCodes[countryIndex] != nullptr; countryIndex++) @@ -1095,14 +1095,14 @@ void VORDemodGUI::readNavAids() } } -void VORDemodGUI::on_magDecAdjust_clicked(bool checked) +void VORDemodMCGUI::on_magDecAdjust_clicked(bool checked) { m_settings.m_magDecAdjust = checked; m_vorModel.allVORUpdated(); applySettings(); } -void VORDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown) +void VORDemodMCGUI::onWidgetRolled(QWidget* widget, bool rollDown) { (void) widget; (void) rollDown; @@ -1122,7 +1122,7 @@ void VORDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown) applySettings(); } -void VORDemodGUI::onMenuDialogCalled(const QPoint &p) +void VORDemodMCGUI::onMenuDialogCalled(const QPoint &p) { if (m_contextMenuType == ContextMenuChannelSettings) { @@ -1169,9 +1169,9 @@ void VORDemodGUI::onMenuDialogCalled(const QPoint &p) resetContextMenuType(); } -VORDemodGUI::VORDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) : +VORDemodMCGUI::VORDemodMCGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent) : ChannelGUI(parent), - ui(new Ui::VORDemodGUI), + ui(new Ui::VORDemodMCGUI), m_pluginAPI(pluginAPI), m_deviceUISet(deviceUISet), m_channelMarker(this), @@ -1198,9 +1198,9 @@ VORDemodGUI::VORDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_muteIcon.addPixmap(QPixmap("://sound_on.png"), QIcon::Normal, QIcon::Off); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); - connect(&m_dlm, &HttpDownloadManager::downloadComplete, this, &VORDemodGUI::downloadFinished); + connect(&m_dlm, &HttpDownloadManager::downloadComplete, this, &VORDemodMCGUI::downloadFinished); - m_vorDemod = reinterpret_cast(rxChannel); + m_vorDemod = reinterpret_cast(rxChannel); m_vorDemod->setMessageQueueToGUI(getInputMessageQueue()); connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms @@ -1295,26 +1295,26 @@ VORDemodGUI::VORDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban applySettings(true); } -VORDemodGUI::~VORDemodGUI() +VORDemodMCGUI::~VORDemodMCGUI() { delete ui; } -void VORDemodGUI::blockApplySettings(bool block) +void VORDemodMCGUI::blockApplySettings(bool block) { m_doApplySettings = !block; } -void VORDemodGUI::applySettings(bool force) +void VORDemodMCGUI::applySettings(bool force) { if (m_doApplySettings) { - VORDemod::MsgConfigureVORDemod* message = VORDemod::MsgConfigureVORDemod::create( m_settings, force); + VORDemodMC::MsgConfigureVORDemod* message = VORDemodMC::MsgConfigureVORDemod::create( m_settings, force); m_vorDemod->getInputMessageQueue()->push(message); } } -void VORDemodGUI::displaySettings() +void VORDemodMCGUI::displaySettings() { m_channelMarker.blockSignals(true); m_channelMarker.setCenterFrequency(0); @@ -1358,21 +1358,21 @@ void VORDemodGUI::displaySettings() blockApplySettings(false); } -void VORDemodGUI::leaveEvent(QEvent* event) +void VORDemodMCGUI::leaveEvent(QEvent* event) { m_channelMarker.setHighlighted(false); ChannelGUI::leaveEvent(event); } -void VORDemodGUI::enterEvent(QEvent* event) +void VORDemodMCGUI::enterEvent(QEvent* event) { m_channelMarker.setHighlighted(true); ChannelGUI::enterEvent(event); } -void VORDemodGUI::audioSelect() +void VORDemodMCGUI::audioSelect() { - qDebug("VORDemodGUI::audioSelect"); + qDebug("VORDemodMCGUI::audioSelect"); AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName); audioSelect.exec(); @@ -1383,7 +1383,7 @@ void VORDemodGUI::audioSelect() } } -void VORDemodGUI::tick() +void VORDemodMCGUI::tick() { double magsqAvg, magsqPeak; int nbMagsqSamples; @@ -1440,19 +1440,19 @@ void VORDemodGUI::tick() m_tickCount++; } -void VORDemodGUI::makeUIConnections() +void VORDemodMCGUI::makeUIConnections() { - QObject::connect(ui->audioMute, &QToolButton::toggled, this, &VORDemodGUI::on_audioMute_toggled); - 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); - QObject::connect(ui->getOurAirportsVORDB, &QPushButton::clicked, this, &VORDemodGUI::on_getOurAirportsVORDB_clicked); - QObject::connect(ui->getOpenAIPVORDB, &QPushButton::clicked, this, &VORDemodGUI::on_getOpenAIPVORDB_clicked); - QObject::connect(ui->magDecAdjust, &QPushButton::clicked, this, &VORDemodGUI::on_magDecAdjust_clicked); + QObject::connect(ui->audioMute, &QToolButton::toggled, this, &VORDemodMCGUI::on_audioMute_toggled); + QObject::connect(ui->thresh, &QDial::valueChanged, this, &VORDemodMCGUI::on_thresh_valueChanged); + QObject::connect(ui->volume, &QDial::valueChanged, this, &VORDemodMCGUI::on_volume_valueChanged); + QObject::connect(ui->squelch, &QDial::valueChanged, this, &VORDemodMCGUI::on_squelch_valueChanged); + QObject::connect(ui->audioMute, &QToolButton::toggled, this, &VORDemodMCGUI::on_audioMute_toggled); + QObject::connect(ui->getOurAirportsVORDB, &QPushButton::clicked, this, &VORDemodMCGUI::on_getOurAirportsVORDB_clicked); + QObject::connect(ui->getOpenAIPVORDB, &QPushButton::clicked, this, &VORDemodMCGUI::on_getOpenAIPVORDB_clicked); + QObject::connect(ui->magDecAdjust, &QPushButton::clicked, this, &VORDemodMCGUI::on_magDecAdjust_clicked); } -void VORDemodGUI::updateAbsoluteCenterFrequency() +void VORDemodMCGUI::updateAbsoluteCenterFrequency() { setStatusFrequency(m_deviceCenterFrequency); } diff --git a/plugins/channelrx/demodvor/vordemodgui.h b/plugins/channelrx/demodvor/vordemodgui.h index e1ee119da..9be477bf1 100644 --- a/plugins/channelrx/demodvor/vordemodgui.h +++ b/plugins/channelrx/demodvor/vordemodgui.h @@ -44,13 +44,13 @@ class PluginAPI; class DeviceUISet; class BasebandSampleSink; -class VORDemod; -class VORDemodGUI; +class VORDemodMC; +class VORDemodMCGUI; namespace Ui { - class VORDemodGUI; + class VORDemodMCGUI; } -class VORDemodGUI; +class VORDemodMCGUI; // Table items for each VOR class VORGUI : public QObject { @@ -58,7 +58,7 @@ class VORGUI : public QObject { public: NavAid *m_navAid; QVariantList m_coordinates; - VORDemodGUI *m_gui; + VORDemodMCGUI *m_gui; QTableWidgetItem *m_nameItem; QTableWidgetItem *m_frequencyItem; @@ -73,7 +73,7 @@ public: QWidget *m_muteItem; QToolButton *m_muteButton; - VORGUI(NavAid *navAid, VORDemodGUI *gui); + VORGUI(NavAid *navAid, VORDemodMCGUI *gui); private slots: void on_audioMute_toggled(bool checked); }; @@ -93,7 +93,7 @@ public: selectedRole = Qt::UserRole + 6 }; - VORModel(VORDemodGUI *gui) : + VORModel(VORDemodMCGUI *gui) : m_gui(gui), m_radialsVisible(true) { @@ -192,7 +192,7 @@ public: bool findIntersection(float &lat, float &lon); private: - VORDemodGUI *m_gui; + VORDemodMCGUI *m_gui; bool m_radialsVisible; QList m_vors; QList m_selected; @@ -200,11 +200,11 @@ private: QList m_vorGUIs; }; -class VORDemodGUI : public ChannelGUI { +class VORDemodMCGUI : public ChannelGUI { Q_OBJECT public: - static VORDemodGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); + static VORDemodMCGUI* create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel); virtual void destroy(); void resetToDefaults(); @@ -233,16 +233,16 @@ private: friend class VORGUI; friend class VORModel; - Ui::VORDemodGUI* ui; + Ui::VORDemodMCGUI* ui; PluginAPI* m_pluginAPI; DeviceUISet* m_deviceUISet; ChannelMarker m_channelMarker; RollupState m_rollupState; - VORDemodSettings m_settings; + VORDemodMCSettings m_settings; qint64 m_deviceCenterFrequency; bool m_doApplySettings; - VORDemod* m_vorDemod; + VORDemodMC* m_vorDemod; bool m_squelchOpen; int m_basebandSampleRate; uint32_t m_tickCount; @@ -258,8 +258,8 @@ private: AzEl m_azEl; // Position of station QIcon m_muteIcon; - explicit VORDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0); - virtual ~VORDemodGUI(); + explicit VORDemodMCGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0); + virtual ~VORDemodMCGUI(); void blockApplySettings(bool block); void applySettings(bool force = false); diff --git a/plugins/channelrx/demodvor/vordemodgui.ui b/plugins/channelrx/demodvor/vordemodgui.ui index ba95565bd..264377ed6 100644 --- a/plugins/channelrx/demodvor/vordemodgui.ui +++ b/plugins/channelrx/demodvor/vordemodgui.ui @@ -1,6 +1,6 @@ - VORDemodGUI + VORDemodMCGUI @@ -32,7 +32,7 @@ Qt::StrongFocus - VOR Demodulator + VOR MC Demodulator diff --git a/plugins/channelrx/demodvor/vordemodplugin.cpp b/plugins/channelrx/demodvor/vordemodplugin.cpp index cca086822..c41a6464d 100644 --- a/plugins/channelrx/demodvor/vordemodplugin.cpp +++ b/plugins/channelrx/demodvor/vordemodplugin.cpp @@ -26,8 +26,8 @@ #include "vordemodwebapiadapter.h" #include "vordemodplugin.h" -const PluginDescriptor VORDemodPlugin::m_pluginDescriptor = { - VORDemod::m_channelId, +const PluginDescriptor VORDemodMCPlugin::m_pluginDescriptor = { + VORDemodMC::m_channelId, QStringLiteral("VOR Demodulator"), QStringLiteral("6.20.2"), QStringLiteral("(c) Jon Beniston, M7RCE"), @@ -36,29 +36,29 @@ const PluginDescriptor VORDemodPlugin::m_pluginDescriptor = { QStringLiteral("https://github.com/f4exb/sdrangel") }; -VORDemodPlugin::VORDemodPlugin(QObject* parent) : +VORDemodMCPlugin::VORDemodMCPlugin(QObject* parent) : QObject(parent), m_pluginAPI(0) { } -const PluginDescriptor& VORDemodPlugin::getPluginDescriptor() const +const PluginDescriptor& VORDemodMCPlugin::getPluginDescriptor() const { return m_pluginDescriptor; } -void VORDemodPlugin::initPlugin(PluginAPI* pluginAPI) +void VORDemodMCPlugin::initPlugin(PluginAPI* pluginAPI) { m_pluginAPI = pluginAPI; - m_pluginAPI->registerRxChannel(VORDemod::m_channelIdURI, VORDemod::m_channelId, this); + m_pluginAPI->registerRxChannel(VORDemodMC::m_channelIdURI, VORDemodMC::m_channelId, this); } -void VORDemodPlugin::createRxChannel(DeviceAPI *deviceAPI, BasebandSampleSink **bs, ChannelAPI **cs) const +void VORDemodMCPlugin::createRxChannel(DeviceAPI *deviceAPI, BasebandSampleSink **bs, ChannelAPI **cs) const { if (bs || cs) { - VORDemod *instance = new VORDemod(deviceAPI); + VORDemodMC *instance = new VORDemodMC(deviceAPI); if (bs) { *bs = instance; @@ -71,7 +71,7 @@ void VORDemodPlugin::createRxChannel(DeviceAPI *deviceAPI, BasebandSampleSink ** } #ifdef SERVER_MODE -ChannelGUI* VORDemodPlugin::createRxChannelGUI( +ChannelGUI* VORDemodMCPlugin::createRxChannelGUI( DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const { @@ -80,13 +80,13 @@ ChannelGUI* VORDemodPlugin::createRxChannelGUI( return 0; } #else -ChannelGUI* VORDemodPlugin::createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const +ChannelGUI* VORDemodMCPlugin::createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const { - return VORDemodGUI::create(m_pluginAPI, deviceUISet, rxChannel); + return VORDemodMCGUI::create(m_pluginAPI, deviceUISet, rxChannel); } #endif -ChannelWebAPIAdapter* VORDemodPlugin::createChannelWebAPIAdapter() const +ChannelWebAPIAdapter* VORDemodMCPlugin::createChannelWebAPIAdapter() const { return new VORDemodWebAPIAdapter(); } diff --git a/plugins/channelrx/demodvor/vordemodplugin.h b/plugins/channelrx/demodvor/vordemodplugin.h index a43c13c99..b3757ca5f 100644 --- a/plugins/channelrx/demodvor/vordemodplugin.h +++ b/plugins/channelrx/demodvor/vordemodplugin.h @@ -25,13 +25,13 @@ class DeviceUISet; class BasebandSampleSink; -class VORDemodPlugin : public QObject, PluginInterface { +class VORDemodMCPlugin : public QObject, PluginInterface { Q_OBJECT Q_INTERFACES(PluginInterface) Q_PLUGIN_METADATA(IID "sdrangel.channel.vordemod") public: - explicit VORDemodPlugin(QObject* parent = NULL); + explicit VORDemodMCPlugin(QObject* parent = NULL); const PluginDescriptor& getPluginDescriptor() const; void initPlugin(PluginAPI* pluginAPI); diff --git a/plugins/channelrx/demodvor/vordemodreport.cpp b/plugins/channelrx/demodvor/vordemodreport.cpp index 6ac03f99a..61c4ddba6 100644 --- a/plugins/channelrx/demodvor/vordemodreport.cpp +++ b/plugins/channelrx/demodvor/vordemodreport.cpp @@ -17,6 +17,6 @@ #include "vordemodreport.h" -MESSAGE_CLASS_DEFINITION(VORDemodReport::MsgReportFreqOffset, Message) -MESSAGE_CLASS_DEFINITION(VORDemodReport::MsgReportRadial, Message) -MESSAGE_CLASS_DEFINITION(VORDemodReport::MsgReportIdent, Message) +MESSAGE_CLASS_DEFINITION(VORDemodMCReport::MsgReportFreqOffset, Message) +MESSAGE_CLASS_DEFINITION(VORDemodMCReport::MsgReportRadial, Message) +MESSAGE_CLASS_DEFINITION(VORDemodMCReport::MsgReportIdent, Message) diff --git a/plugins/channelrx/demodvor/vordemodreport.h b/plugins/channelrx/demodvor/vordemodreport.h index 88a067d4e..58849c63c 100644 --- a/plugins/channelrx/demodvor/vordemodreport.h +++ b/plugins/channelrx/demodvor/vordemodreport.h @@ -23,7 +23,7 @@ #include "util/message.h" -class VORDemodReport : public QObject +class VORDemodMCReport : public QObject { Q_OBJECT public: @@ -109,8 +109,8 @@ public: }; public: - VORDemodReport() {} - ~VORDemodReport() {} + VORDemodMCReport() {} + ~VORDemodMCReport() {} }; #endif // INCLUDE_VORDEMODREPORT_H diff --git a/plugins/channelrx/demodvor/vordemodsettings.cpp b/plugins/channelrx/demodvor/vordemodsettings.cpp index 97f28663e..5bd4f2d79 100644 --- a/plugins/channelrx/demodvor/vordemodsettings.cpp +++ b/plugins/channelrx/demodvor/vordemodsettings.cpp @@ -23,14 +23,14 @@ #include "settings/serializable.h" #include "vordemodsettings.h" -VORDemodSettings::VORDemodSettings() : +VORDemodMCSettings::VORDemodMCSettings() : m_channelMarker(nullptr), m_rollupState(nullptr) { resetToDefaults(); } -void VORDemodSettings::resetToDefaults() +void VORDemodMCSettings::resetToDefaults() { m_squelch = -60.0; m_volume = 2.0; @@ -59,7 +59,7 @@ void VORDemodSettings::resetToDefaults() } } -QByteArray VORDemodSettings::serialize() const +QByteArray VORDemodMCSettings::serialize() const { SimpleSerializer s(1); s.writeS32(3, m_streamIndex); @@ -102,7 +102,7 @@ QByteArray VORDemodSettings::serialize() const return s.final(); } -bool VORDemodSettings::deserialize(const QByteArray& data) +bool VORDemodMCSettings::deserialize(const QByteArray& data) { SimpleDeserializer d(data); diff --git a/plugins/channelrx/demodvor/vordemodsettings.h b/plugins/channelrx/demodvor/vordemodsettings.h index af755e360..907a1fa7d 100644 --- a/plugins/channelrx/demodvor/vordemodsettings.h +++ b/plugins/channelrx/demodvor/vordemodsettings.h @@ -33,7 +33,7 @@ struct VORDemodSubChannelSettings { bool m_audioMute; //!< Mute the audio from this VOR }; -struct VORDemodSettings +struct VORDemodMCSettings { Real m_squelch; Real m_volume; @@ -63,7 +63,7 @@ struct VORDemodSettings QHash m_subChannelSettings; - VORDemodSettings(); + VORDemodMCSettings(); void resetToDefaults(); void setChannelMarker(Serializable *channelMarker) { m_channelMarker = channelMarker; } void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; } diff --git a/plugins/channelrx/demodvor/vordemodsink.cpp b/plugins/channelrx/demodvor/vordemodsink.cpp index b7f046dad..8dfa47a03 100644 --- a/plugins/channelrx/demodvor/vordemodsink.cpp +++ b/plugins/channelrx/demodvor/vordemodsink.cpp @@ -30,7 +30,7 @@ #include "vordemodsink.h" #include "vordemodreport.h" -VORDemodSink::VORDemodSink(const VORDemodSettings& settings, int subChannel, +VORDemodMCSink::VORDemodMCSink(const VORDemodMCSettings& settings, int subChannel, MessageQueue *messageQueueToGUI) : m_channelFrequencyOffset(0), m_outOfBand(true), @@ -67,11 +67,11 @@ VORDemodSink::VORDemodSink(const VORDemodSettings& settings, int subChannel, } } -VORDemodSink::~VORDemodSink() +VORDemodMCSink::~VORDemodMCSink() { } -void VORDemodSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end) +void VORDemodMCSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end) { Complex ci; @@ -102,7 +102,7 @@ void VORDemodSink::feed(const SampleVector::const_iterator& begin, const SampleV } } -void VORDemodSink::processOneAudioSample(Complex &ci) +void VORDemodMCSink::processOneAudioSample(Complex &ci) { Real re = ci.real() / SDR_RX_SCALEF; Real im = ci.imag() / SDR_RX_SCALEF; @@ -167,7 +167,7 @@ void VORDemodSink::processOneAudioSample(Complex &ci) if (res != m_audioBufferFill) { - qDebug("VORDemodSink::processOneAudioSample: %u/%u audio samples written", res, m_audioBufferFill); + qDebug("VORDemodMCSink::processOneAudioSample: %u/%u audio samples written", res, m_audioBufferFill); m_audioFifo.clear(); } @@ -176,7 +176,7 @@ void VORDemodSink::processOneAudioSample(Complex &ci) } -void VORDemodSink::processOneSample(Complex &ci) +void VORDemodMCSink::processOneSample(Complex &ci) { Complex ca; @@ -251,7 +251,7 @@ void VORDemodSink::processOneSample(Complex &ci) if (getMessageQueueToGUI()) { - VORDemodReport::MsgReportRadial *msg = VORDemodReport::MsgReportRadial::create(m_subChannelId, phaseDifference, refMag, varMag); + VORDemodMCReport::MsgReportRadial *msg = VORDemodMCReport::MsgReportRadial::create(m_subChannelId, phaseDifference, refMag, varMag); getMessageQueueToGUI()->push(msg); } @@ -305,7 +305,7 @@ void VORDemodSink::processOneSample(Complex &ci) qDebug() << m_ident << " " << Morse::toString(m_ident); if (getMessageQueueToGUI()) { - VORDemodReport::MsgReportIdent *msg = VORDemodReport::MsgReportIdent::create(m_subChannelId, m_ident); + VORDemodMCReport::MsgReportIdent *msg = VORDemodMCReport::MsgReportIdent::create(m_subChannelId, m_ident); getMessageQueueToGUI()->push(msg); } m_ident = ""; @@ -344,7 +344,7 @@ void VORDemodSink::processOneSample(Complex &ci) qDebug() << m_ident << " " << Morse::toString(m_ident); if (getMessageQueueToGUI()) { - VORDemodReport::MsgReportIdent *msg = VORDemodReport::MsgReportIdent::create(m_subChannelId, m_ident); + VORDemodMCReport::MsgReportIdent *msg = VORDemodMCReport::MsgReportIdent::create(m_subChannelId, m_ident); getMessageQueueToGUI()->push(msg); } m_ident = ""; @@ -355,9 +355,9 @@ void VORDemodSink::processOneSample(Complex &ci) m_prevBit = bit; } -void VORDemodSink::applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, bool force) +void VORDemodMCSink::applyChannelSettings(int channelSampleRate, int channelFrequencyOffset, bool force) { - qDebug() << "VORDemodSink::applyChannelSettings:" + qDebug() << "VORDemodMCSink::applyChannelSettings:" << " channelSampleRate: " << channelSampleRate << " channelFrequencyOffset: " << channelFrequencyOffset; @@ -395,9 +395,9 @@ void VORDemodSink::applyChannelSettings(int channelSampleRate, int channelFreque m_channelFrequencyOffset = channelFrequencyOffset; } -void VORDemodSink::applySettings(const VORDemodSettings& settings, bool force) +void VORDemodMCSink::applySettings(const VORDemodMCSettings& settings, bool force) { - qDebug() << "VORDemodSink::applySettings:" + qDebug() << "VORDemodMCSink::applySettings:" << " m_volume: " << settings.m_volume << " m_squelch: " << settings.m_squelch << " m_audioMute: " << settings.m_audioMute @@ -411,15 +411,15 @@ void VORDemodSink::applySettings(const VORDemodSettings& settings, bool force) m_settings = settings; } -void VORDemodSink::applyAudioSampleRate(int sampleRate) +void VORDemodMCSink::applyAudioSampleRate(int sampleRate) { if (sampleRate < 0) { - qWarning("VORDemodSink::applyAudioSampleRate: invalid sample rate: %d", sampleRate); + qWarning("VORDemodMCSink::applyAudioSampleRate: invalid sample rate: %d", sampleRate); return; } - qDebug("VORDemodSink::applyAudioSampleRate: sampleRate: %d m_channelSampleRate: %d", sampleRate, m_channelSampleRate); + qDebug("VORDemodMCSink::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, VORDEMOD_CHANNEL_SAMPLE_RATE, 3000.0f); diff --git a/plugins/channelrx/demodvor/vordemodsink.h b/plugins/channelrx/demodvor/vordemodsink.h index d6243b4e7..d4bf9fda6 100644 --- a/plugins/channelrx/demodvor/vordemodsink.h +++ b/plugins/channelrx/demodvor/vordemodsink.h @@ -42,16 +42,16 @@ // May as well make it a common audio rate, to possibly avoid decimation #define VORDEMOD_CHANNEL_SAMPLE_RATE 48000 -class VORDemodSink : public ChannelSampleSink { +class VORDemodMCSink : public ChannelSampleSink { public: - VORDemodSink(const VORDemodSettings& settings, int subChannel, + VORDemodMCSink(const VORDemodMCSettings& settings, int subChannel, MessageQueue *messageQueueToGUI); - ~VORDemodSink(); + ~VORDemodMCSink(); 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 VORDemodSettings& settings, bool force = false); + void applySettings(const VORDemodMCSettings& settings, bool force = false); void setMessageQueueToGUI(MessageQueue *messageQueue) { m_messageQueueToGUI = messageQueue; } void applyAudioSampleRate(int sampleRate); @@ -95,7 +95,7 @@ private: double m_magsqPeak; }; - VORDemodSettings m_settings; + VORDemodMCSettings m_settings; int m_channelSampleRate; int m_audioSampleRate; diff --git a/plugins/channelrx/demodvor/vordemodwebapiadapter.cpp b/plugins/channelrx/demodvor/vordemodwebapiadapter.cpp index 79be603db..abe64e3de 100644 --- a/plugins/channelrx/demodvor/vordemodwebapiadapter.cpp +++ b/plugins/channelrx/demodvor/vordemodwebapiadapter.cpp @@ -33,7 +33,7 @@ int VORDemodWebAPIAdapter::webapiSettingsGet( (void) errorMessage; response.setVorDemodSettings(new SWGSDRangel::SWGVORDemodSettings()); response.getVorDemodSettings()->init(); - VORDemod::webapiFormatChannelSettings(response, m_settings); + VORDemodMC::webapiFormatChannelSettings(response, m_settings); return 200; } @@ -46,7 +46,7 @@ int VORDemodWebAPIAdapter::webapiSettingsPutPatch( { (void) force; (void) errorMessage; - VORDemod::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response); + VORDemodMC::webapiUpdateChannelSettings(m_settings, channelSettingsKeys, response); return 200; } diff --git a/plugins/channelrx/demodvor/vordemodwebapiadapter.h b/plugins/channelrx/demodvor/vordemodwebapiadapter.h index 94a1513d6..08b76113a 100644 --- a/plugins/channelrx/demodvor/vordemodwebapiadapter.h +++ b/plugins/channelrx/demodvor/vordemodwebapiadapter.h @@ -44,7 +44,7 @@ public: QString& errorMessage); private: - VORDemodSettings m_settings; + VORDemodMCSettings m_settings; }; #endif // INCLUDE_VORDEMOD_WEBAPIADAPTER_H