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