Set label in AudioFifo to identify the controlling component in error messages. Use a signal to retrieve the channel index in device set appropriately

pull/1180/head
f4exb 2022-03-18 17:08:04 +01:00
rodzic 053e4a31cd
commit 60d4b2f126
85 zmienionych plików z 644 dodań i 146 usunięć

Wyświetl plik

@ -48,11 +48,6 @@ ChannelAnalyzer::ChannelAnalyzer(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
getChannelSampleRate();
m_basebandSink = new ChannelAnalyzerBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->moveToThread(&m_thread);
applySettings(m_settings, true);
@ -62,6 +57,12 @@ ChannelAnalyzer::ChannelAnalyzer(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&ChannelAnalyzer::handleIndexInDeviceSetChanged
);
}
ChannelAnalyzer::~ChannelAnalyzer()
@ -720,3 +721,16 @@ void ChannelAnalyzer::networkManagerFinished(QNetworkReply *reply)
reply->deleteLater();
}
void ChannelAnalyzer::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -154,6 +154,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_CHANALYZER_H

Wyświetl plik

@ -27,7 +27,6 @@
#include "dsp/phaselockcomplex.h"
#include "dsp/freqlockcomplex.h"
#include "dsp/costasloop.h"
#include "audio/audiofifo.h"
#include "util/movingaverage.h"

Wyświetl plik

@ -65,11 +65,6 @@ ADSBDemod::ADSBDemod(DeviceAPI *devieAPI) :
m_thread = new QThread(this);
m_basebandSink = new ADSBDemodBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->moveToThread(m_thread);
m_worker = new ADSBDemodWorker();
@ -82,6 +77,12 @@ ADSBDemod::ADSBDemod(DeviceAPI *devieAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&ADSBDemod::handleIndexInDeviceSetChanged
);
}
ADSBDemod::~ADSBDemod()
@ -778,3 +779,16 @@ void ADSBDemod::setTarget(const QString& name, float targetAzimuth, float target
}
}
}
void ADSBDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -152,6 +152,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_ADSBDEMOD_H

Wyświetl plik

@ -53,11 +53,6 @@ AISDemod::AISDemod(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new AISDemodBaseband(this);
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setMessageQueueToChannel(getInputMessageQueue());
m_basebandSink->setChannel(this);
m_basebandSink->moveToThread(&m_thread);
@ -70,6 +65,12 @@ AISDemod::AISDemod(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages()));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&AISDemod::handleIndexInDeviceSetChanged
);
}
AISDemod::~AISDemod()
@ -701,3 +702,16 @@ void AISDemod::handleChannelMessages()
}
}
}
void AISDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -183,6 +183,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleChannelMessages();
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_AISDEMOD_H

Wyświetl plik

@ -56,11 +56,6 @@ AMDemod::AMDemod(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new AMDemodBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setChannel(this);
m_basebandSink->moveToThread(&m_thread);
@ -79,6 +74,12 @@ AMDemod::AMDemod(DeviceAPI *deviceAPI) :
// this,
// &AMDemod::handleWrittenToFifo
// );
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&AMDemod::handleIndexInDeviceSetChanged
);
}
AMDemod::~AMDemod()
@ -678,3 +679,17 @@ void AMDemod::handleWrittenToFifo(int nsamples, qint64 timestamp)
);
m_lastTs = timestamp;
}
void AMDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
m_basebandSink->setAudioFifoLabel(fifoLabel);
}

Wyświetl plik

@ -164,6 +164,7 @@ private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleChannelMessages();
void handleWrittenToFifo(int nsamples, qint64 timestamp);
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_AMDEMOD_H

Wyświetl plik

@ -75,6 +75,7 @@ public:
void setChannel(ChannelAPI *channel);
bool isRunning() const { return m_running; }
void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); }
void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); }
private:
SampleSinkFifo m_sampleFifo;

Wyświetl plik

@ -52,6 +52,7 @@ public:
bool getPllLocked() const { return m_settings.m_pll && m_pll.locked(); }
Real getPllFrequency() const { return m_pll.getFreq(); }
AudioFifo *getAudioFifo() { return &m_audioFifo; }
void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); }
void setChannel(ChannelAPI *channel) { m_channel = channel; }
void getMagSqLevels(double& avg, double& peak, int& nbSamples)

Wyświetl plik

@ -61,11 +61,6 @@ APTDemod::APTDemod(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new APTDemodBaseband(this);
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->moveToThread(&m_thread);
m_imageWorker = new APTDemodImageWorker(this);
@ -79,6 +74,12 @@ APTDemod::APTDemod(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&APTDemod::handleIndexInDeviceSetChanged
);
startImageWorker();
}
@ -876,3 +877,16 @@ void APTDemod::networkManagerFinished(QNetworkReply *reply)
reply->deleteLater();
}
void APTDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -287,7 +287,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_APTDEMOD_H

Wyświetl plik

@ -53,6 +53,13 @@ ATVDemod::ATVDemod(DeviceAPI *deviceAPI) :
m_deviceAPI->addChannelSink(this);
m_deviceAPI->addChannelSinkAPI(this);
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&ATVDemod::handleIndexInDeviceSetChanged
);
}
ATVDemod::~ATVDemod()
@ -177,3 +184,16 @@ void ATVDemod::applySettings(const ATVDemodSettings& settings, bool force)
m_settings = settings;
}
void ATVDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -108,6 +108,9 @@ private:
virtual bool handleMessage(const Message& cmd);
void applySettings(const ATVDemodSettings& settings, bool force = false);
private slots:
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_ATVDEMOD_H

Wyświetl plik

@ -30,7 +30,6 @@
#include "dsp/phaselock.h"
#include "dsp/recursivefilters.h"
#include "dsp/phasediscri.h"
#include "audio/audiofifo.h"
#include "util/movingaverage.h"
#include "gui/tvscreenanalog.h"

Wyświetl plik

@ -57,11 +57,6 @@ BFMDemod::BFMDemod(DeviceAPI *deviceAPI) :
m_thread = new QThread(this);
m_basebandSink = new BFMDemodBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setSpectrumSink(&m_spectrumVis);
m_basebandSink->moveToThread(m_thread);
@ -72,6 +67,12 @@ BFMDemod::BFMDemod(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&BFMDemod::handleIndexInDeviceSetChanged
);
}
BFMDemod::~BFMDemod()
@ -667,3 +668,17 @@ void BFMDemod::networkManagerFinished(QNetworkReply *reply)
reply->deleteLater();
}
void BFMDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
m_basebandSink->setAudioFifoLabel(fifoLabel);
}

Wyświetl plik

@ -176,6 +176,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_BFMDEMOD_H

Wyświetl plik

@ -80,6 +80,7 @@ public:
void getMagSqLevels(double& avg, double& peak, int& nbSamples) { m_sink.getMagSqLevels(avg, peak, nbSamples); }
RDSParser& getRDSParser() { return m_sink.getRDSParser(); }
void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); }
void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); }
private:
SampleSinkFifo m_sampleFifo;

Wyświetl plik

@ -83,6 +83,7 @@ public:
void applySettings(const BFMDemodSettings& settings, bool force = false);
AudioFifo *getAudioFifo() { return &m_audioFifo; }
void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); }
void applyAudioSampleRate(int sampleRate);
int getAudioSampleRate() const { return m_audioSampleRate; }

Wyświetl plik

@ -72,11 +72,6 @@ ChirpChatDemod::ChirpChatDemod(DeviceAPI* deviceAPI) :
m_thread = new QThread(this);
m_basebandSink = new ChirpChatDemodBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setSpectrumSink(&m_spectrumVis);
m_basebandSink->setDecoderMessageQueue(getInputMessageQueue()); // Decoder held on the main thread
m_basebandSink->moveToThread(m_thread);
@ -85,6 +80,13 @@ ChirpChatDemod::ChirpChatDemod(DeviceAPI* deviceAPI) :
m_deviceAPI->addChannelSink(this);
m_deviceAPI->addChannelSinkAPI(this);
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&ChirpChatDemod::handleIndexInDeviceSetChanged
);
}
ChirpChatDemod::~ChirpChatDemod()
@ -930,3 +932,16 @@ double ChirpChatDemod::getTotalPower() const
{
return m_basebandSink->getTotalPower();
}
void ChirpChatDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -309,6 +309,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_CHIRPCHATDEMOD_H

Wyświetl plik

@ -64,11 +64,6 @@ DABDemod::DABDemod(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new DABDemodBaseband(this);
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setMessageQueueToChannel(getInputMessageQueue());
m_basebandSink->setChannel(this);
m_basebandSink->moveToThread(&m_thread);
@ -81,6 +76,12 @@ DABDemod::DABDemod(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages()));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&DABDemod::handleIndexInDeviceSetChanged
);
}
DABDemod::~DABDemod()
@ -656,3 +657,17 @@ void DABDemod::handleChannelMessages()
}
}
}
void DABDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
m_basebandSink->setAudioFifoLabel(fifoLabel);
}

Wyświetl plik

@ -400,6 +400,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleChannelMessages();
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_DABDEMOD_H

Wyświetl plik

@ -76,6 +76,7 @@ public:
bool isRunning() const { return m_running; }
int getAudioSampleRate() const { return m_sink.getAudioSampleRate(); }
void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); }
void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); }
private:
SampleSinkFifo m_sampleFifo;

Wyświetl plik

@ -53,6 +53,7 @@ public:
void applyDABAudioSampleRate(int sampleRate);
int getAudioSampleRate() const { return m_audioSampleRate; }
AudioFifo *getAudioFifo() { return &m_audioFifo; }
void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); }
void setMessageQueueToChannel(MessageQueue *messageQueue) { m_messageQueueToChannel = messageQueue; }
void setChannel(ChannelAPI *channel) { m_channel = channel; }

Wyświetl plik

@ -46,11 +46,6 @@ DATVDemod::DATVDemod(DeviceAPI *deviceAPI) :
qDebug("DATVDemod::DATVDemod");
setObjectName(m_channelId);
m_basebandSink = new DATVDemodBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->moveToThread(&m_thread);
applySettings(m_settings, true);
@ -60,6 +55,12 @@ DATVDemod::DATVDemod(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&DATVDemod::handleIndexInDeviceSetChanged
);
}
DATVDemod::~DATVDemod()
@ -732,3 +733,17 @@ void DATVDemod::networkManagerFinished(QNetworkReply *reply)
reply->deleteLater();
}
void DATVDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
m_basebandSink->setAudioFifoLabel(fifoLabel);
}

Wyświetl plik

@ -180,6 +180,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_DATVDEMOD_H

Wyświetl plik

@ -91,6 +91,7 @@ public:
bool isCstlnSetByModcod() const { return m_sink.isCstlnSetByModcod(); }
bool isRunning() const { return m_running; }
void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); }
void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); }
private:
SampleSinkFifo m_sampleFifo;

Wyświetl plik

@ -79,6 +79,7 @@ public:
bool isCstlnSetByModcod() const { return m_cstlnSetByModcod; }
void setMessageQueueToGUI(MessageQueue *messageQueue) { m_messageQueueToGUI = messageQueue; }
AudioFifo *getAudioFifo() { return &m_audioFifo; }
void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); }
float getMERAvg() const {
return r_merMeter ? r_merMeter->m_avg : 0;

Wyświetl plik

@ -60,11 +60,6 @@ DSDDemod::DSDDemod(DeviceAPI *deviceAPI) :
m_thread = new QThread(this);
m_basebandSink = new DSDDemodBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setChannel(this);
m_basebandSink->moveToThread(m_thread);
@ -76,6 +71,12 @@ DSDDemod::DSDDemod(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages()));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&DSDDemod::handleIndexInDeviceSetChanged
);
}
DSDDemod::~DSDDemod()
@ -756,3 +757,17 @@ void DSDDemod::handleChannelMessages()
}
}
}
void DSDDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
m_basebandSink->setAudioFifoLabel(fifoLabel);
}

Wyświetl plik

@ -160,6 +160,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleChannelMessages();
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_DSDDEMOD_H

Wyświetl plik

@ -74,6 +74,7 @@ public:
const char *updateAndGetStatusText() { return m_sink.updateAndGetStatusText(); }
void setChannel(ChannelAPI *channel);
void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); }
void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); }
private:
SampleSinkFifo m_sampleFifo;

Wyświetl plik

@ -49,6 +49,10 @@ public:
void applySettings(const DSDDemodSettings& settings, bool force = false);
AudioFifo *getAudioFifo1() { return &m_audioFifo1; }
AudioFifo *getAudioFifo2() { return &m_audioFifo2; }
void setAudioFifoLabel(const QString& label) {
m_audioFifo1.setLabel("1:" + label);
m_audioFifo2.setLabel("2:" + label);
}
int getAudioSampleRate() const { return m_audioSampleRate; }
void setChannel(ChannelAPI *channel) { m_channel = channel; }

Wyświetl plik

@ -51,11 +51,6 @@ FreeDVDemod::FreeDVDemod(DeviceAPI *deviceAPI) :
m_thread = new QThread(this);
m_basebandSink = new FreeDVDemodBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setSpectrumSink(&m_spectrumVis);
m_basebandSink->moveToThread(m_thread);
@ -66,6 +61,12 @@ FreeDVDemod::FreeDVDemod(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&FreeDVDemod::handleIndexInDeviceSetChanged
);
}
FreeDVDemod::~FreeDVDemod()
@ -621,3 +622,17 @@ void FreeDVDemod::setLevelMeter(QObject *levelMeter)
{
connect(m_basebandSink, SIGNAL(levelChanged(qreal, qreal, int)), levelMeter, SLOT(levelChanged(qreal, qreal, int)));
}
void FreeDVDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
m_basebandSink->setAudioFifoLabel(fifoLabel);
}

Wyświetl plik

@ -177,6 +177,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_FREEDVDEMOD_H

Wyświetl plik

@ -90,6 +90,7 @@ public:
float getFrequencyOffset() const { return m_sink.getFrequencyOffset(); }
bool isSync() const { return m_sink.isSync(); }
void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); }
void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); }
signals:
/**

Wyświetl plik

@ -49,6 +49,7 @@ public:
void applyAudioSampleRate(int sampleRate);
void applyFreeDVMode(FreeDVDemodSettings::FreeDVMode mode);
AudioFifo *getAudioFifo() { return &m_audioFifo; }
void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); }
void resyncFreeDV();
void setSpectrumSink(BasebandSampleSink* spectrumSink) { m_spectrumSink = spectrumSink; }

Wyświetl plik

@ -75,6 +75,12 @@ NFMDemod::NFMDemod(DeviceAPI *devieAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages()));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&NFMDemod::handleIndexInDeviceSetChanged
);
}
NFMDemod::~NFMDemod()
@ -693,3 +699,17 @@ void NFMDemod::handleChannelMessages()
}
}
}
void NFMDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
m_basebandSink->setAudioFifoLabel(fifoLabel);
}

Wyświetl plik

@ -160,6 +160,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleChannelMessages();
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_NFMDEMOD_H

Wyświetl plik

@ -71,6 +71,7 @@ public:
void setBasebandSampleRate(int sampleRate);
void setChannel(ChannelAPI *channel);
void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); }
void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); }
private:
SampleSinkFifo m_sampleFifo;

Wyświetl plik

@ -75,6 +75,7 @@ public:
void setMessageQueueToGUI(MessageQueue *messageQueue) { m_messageQueueToGUI = messageQueue; }
AudioFifo *getAudioFifo() { return &m_audioFifo; }
void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); }
void applyAudioSampleRate(unsigned int sampleRate);
int getAudioSampleRate() const { return m_audioSampleRate; }
void setChannel(ChannelAPI *channel) { m_channel = channel; }

Wyświetl plik

@ -55,11 +55,6 @@ PacketDemod::PacketDemod(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new PacketDemodBaseband(this);
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setMessageQueueToChannel(getInputMessageQueue());
m_basebandSink->setChannel(this);
m_basebandSink->moveToThread(&m_thread);
@ -72,6 +67,12 @@ PacketDemod::PacketDemod(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages()));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&PacketDemod::handleIndexInDeviceSetChanged
);
}
PacketDemod::~PacketDemod()
@ -686,3 +687,16 @@ void PacketDemod::handleChannelMessages()
}
}
}
void PacketDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -161,6 +161,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleChannelMessages();
void handleIndexInDeviceSetChanged(int index);
};

Wyświetl plik

@ -48,11 +48,6 @@ PagerDemod::PagerDemod(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new PagerDemodBaseband(this);
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setMessageQueueToChannel(getInputMessageQueue());
m_basebandSink->setChannel(this);
m_basebandSink->moveToThread(&m_thread);
@ -65,6 +60,12 @@ PagerDemod::PagerDemod(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages()));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&PagerDemod::handleIndexInDeviceSetChanged
);
}
PagerDemod::~PagerDemod()
@ -700,3 +701,16 @@ void PagerDemod::handleChannelMessages()
}
}
}
void PagerDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -217,6 +217,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleChannelMessages();
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_PAGERDEMOD_H

Wyświetl plik

@ -52,11 +52,6 @@ RadiosondeDemod::RadiosondeDemod(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new RadiosondeDemodBaseband(this);
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setMessageQueueToChannel(getInputMessageQueue());
m_basebandSink->setChannel(this);
m_basebandSink->moveToThread(&m_thread);
@ -69,6 +64,12 @@ RadiosondeDemod::RadiosondeDemod(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages()));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&RadiosondeDemod::handleIndexInDeviceSetChanged
);
}
RadiosondeDemod::~RadiosondeDemod()
@ -718,3 +719,16 @@ void RadiosondeDemod::handleChannelMessages()
}
}
}
void RadiosondeDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -190,6 +190,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleChannelMessages();
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_RADIOSONDEDEMOD_H

Wyświetl plik

@ -57,11 +57,6 @@ SSBDemod::SSBDemod(DeviceAPI *deviceAPI) :
m_thread = new QThread(this);
m_basebandSink = new SSBDemodBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setSpectrumSink(&m_spectrumVis);
m_basebandSink->setChannel(this);
m_basebandSink->moveToThread(m_thread);
@ -74,6 +69,12 @@ SSBDemod::SSBDemod(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages()));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&SSBDemod::handleIndexInDeviceSetChanged
);
}
SSBDemod::~SSBDemod()
@ -738,3 +739,17 @@ void SSBDemod::handleChannelMessages()
}
}
}
void SSBDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
m_basebandSink->setAudioFifoLabel(fifoLabel);
}

Wyświetl plik

@ -164,6 +164,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleChannelMessages();
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_SSBDEMOD_H

Wyświetl plik

@ -73,6 +73,7 @@ public:
void setMessageQueueToGUI(MessageQueue *messageQueue) { m_messageQueueToGUI = messageQueue; }
void setChannel(ChannelAPI *channel);
void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); }
void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); }
private:
SampleSinkFifo m_sampleFifo;

Wyświetl plik

@ -49,6 +49,7 @@ public:
double getMagSq() const { return m_magsq; }
bool getAudioActive() const { return m_audioActive; }
void setChannel(ChannelAPI *channel) { m_channel = channel; }
void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); }
void getMagSqLevels(double& avg, double& peak, int& nbSamples)
{

Wyświetl plik

@ -54,11 +54,6 @@ VORDemod::VORDemod(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new VORDemodBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->moveToThread(&m_thread);
applySettings(m_settings, true);
@ -68,6 +63,12 @@ VORDemod::VORDemod(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&VORDemod::handleIndexInDeviceSetChanged
);
}
VORDemod::~VORDemod()
@ -558,3 +559,16 @@ void VORDemod::networkManagerFinished(QNetworkReply *reply)
reply->deleteLater();
}
void VORDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -162,7 +162,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_VORDEMOD_H

Wyświetl plik

@ -55,11 +55,6 @@ VORDemodSC::VORDemodSC(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new VORDemodSCBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setMessageQueueToChannel(getInputMessageQueue());
m_basebandSink->moveToThread(&m_thread);
@ -70,6 +65,12 @@ VORDemodSC::VORDemodSC(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&VORDemodSC::handleIndexInDeviceSetChanged
);
}
VORDemodSC::~VORDemodSC()
@ -662,3 +663,17 @@ void VORDemodSC::networkManagerFinished(QNetworkReply *reply)
reply->deleteLater();
}
void VORDemodSC::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
m_basebandSink->setAudioFifoLabel(fifoLabel);
}

Wyświetl plik

@ -164,7 +164,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_VORDEMODSC_H

Wyświetl plik

@ -71,6 +71,7 @@ public:
double getMagSq() const { return m_sink.getMagSq(); }
bool isRunning() const { return m_running; }
void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); }
void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); }
private:
SampleSinkFifo m_sampleFifo;

Wyświetl plik

@ -50,6 +50,7 @@ public:
double getMagSq() const { return m_magsq; }
bool getSquelchOpen() const { return m_squelchOpen; }
AudioFifo *getAudioFifo() { return &m_audioFifo; }
void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); }
void getMagSqLevels(double& avg, double& peak, int& nbSamples)
{

Wyświetl plik

@ -60,11 +60,6 @@ WFMDemod::WFMDemod(DeviceAPI* deviceAPI) :
m_thread = new QThread(this);
m_basebandSink = new WFMDemodBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setChannel(this);
m_basebandSink->moveToThread(m_thread);
@ -76,6 +71,12 @@ WFMDemod::WFMDemod(DeviceAPI* deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages()));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&WFMDemod::handleIndexInDeviceSetChanged
);
}
WFMDemod::~WFMDemod()
@ -618,3 +619,17 @@ void WFMDemod::handleChannelMessages()
}
}
}
void WFMDemod::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
m_basebandSink->setAudioFifoLabel(fifoLabel);
}

Wyświetl plik

@ -156,6 +156,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleChannelMessages();
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_WFMDEMOD_H

Wyświetl plik

@ -72,6 +72,7 @@ public:
void getMagSqLevels(double& avg, double& peak, int& nbSamples) { m_sink.getMagSqLevels(avg, peak, nbSamples); }
void setChannel(ChannelAPI *channel);
void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); }
void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); }
private:
SampleSinkFifo m_sampleFifo;

Wyświetl plik

@ -67,6 +67,7 @@ public:
void applySettings(const WFMDemodSettings& settings, bool force = false);
AudioFifo *getAudioFifo() { return &m_audioFifo; }
void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); }
void applyAudioSampleRate(int sampleRate);
int getAudioSampleRate() const { return m_audioSampleRate; }
void setChannel(ChannelAPI *channel) { m_channel = channel; }

Wyświetl plik

@ -59,11 +59,6 @@ FileSink::FileSink(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new FileSinkBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setSpectrumSink(&m_spectrumVis);
m_basebandSink->moveToThread(&m_thread);
@ -74,6 +69,12 @@ FileSink::FileSink(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&FileSink::handleIndexInDeviceSetChanged
);
}
FileSink::~FileSink()
@ -745,3 +746,16 @@ void FileSink::networkManagerFinished(QNetworkReply *reply)
reply->deleteLater();
}
void FileSink::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -186,6 +186,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif /* INCLUDE_FILESINK_H_ */

Wyświetl plik

@ -61,11 +61,6 @@ FreqTracker::FreqTracker(DeviceAPI *deviceAPI) :
m_thread = new QThread(this);
m_basebandSink = new FreqTrackerBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setSpectrumSink(&m_spectrumVis);
propagateMessageQueue(getInputMessageQueue());
m_basebandSink->moveToThread(m_thread);
@ -77,6 +72,12 @@ FreqTracker::FreqTracker(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&FreqTracker::handleIndexInDeviceSetChanged
);
}
FreqTracker::~FreqTracker()
@ -684,3 +685,16 @@ void FreqTracker::networkManagerFinished(QNetworkReply *reply)
reply->deleteLater();
}
void FreqTracker::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -160,6 +160,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_FREQTRACKER_H

Wyświetl plik

@ -57,11 +57,6 @@ LocalSink::LocalSink(DeviceAPI *deviceAPI) :
m_thread = new QThread(this);
m_basebandSink = new LocalSinkBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->moveToThread(m_thread);
applySettings(m_settings, true);
@ -71,6 +66,12 @@ LocalSink::LocalSink(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&LocalSink::handleIndexInDeviceSetChanged
);
}
LocalSink::~LocalSink()
@ -605,3 +606,16 @@ void LocalSink::networkManagerFinished(QNetworkReply *reply)
reply->deleteLater();
}
void LocalSink::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -171,6 +171,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif /* INCLUDE_LOCALSINK_H_ */

Wyświetl plik

@ -66,11 +66,6 @@ NoiseFigure::NoiseFigure(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new NoiseFigureBaseband(this);
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setMessageQueueToChannel(getInputMessageQueue());
m_basebandSink->setChannel(this);
m_basebandSink->moveToThread(&m_thread);
@ -82,6 +77,12 @@ NoiseFigure::NoiseFigure(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&NoiseFigure::handleIndexInDeviceSetChanged
);
}
NoiseFigure::~NoiseFigure()
@ -881,3 +882,16 @@ void NoiseFigure::networkManagerFinished(QNetworkReply *reply)
reply->deleteLater();
}
void NoiseFigure::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -278,7 +278,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void nextState();
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_NOISEFIGURE_H

Wyświetl plik

@ -71,11 +71,6 @@ RadioAstronomy::RadioAstronomy(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new RadioAstronomyBaseband(this);
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setMessageQueueToChannel(getInputMessageQueue());
m_basebandSink->setChannel(this);
m_basebandSink->moveToThread(&m_thread);
@ -96,6 +91,12 @@ RadioAstronomy::RadioAstronomy(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages()));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&RadioAstronomy::handleIndexInDeviceSetChanged
);
m_sweepTimer.setSingleShot(true);
}
@ -1189,3 +1190,16 @@ void RadioAstronomy::handleChannelMessages()
}
}
}
void RadioAstronomy::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -433,7 +433,7 @@ private slots:
void waitUntilOnTarget();
void sweepNext();
void sweepComplete();
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_RADIOASTRONOMY_H

Wyświetl plik

@ -55,11 +55,6 @@ RadioClock::RadioClock(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new RadioClockBaseband(this);
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setMessageQueueToChannel(getInputMessageQueue());
m_basebandSink->setChannel(this);
m_basebandSink->moveToThread(&m_thread);
@ -71,6 +66,12 @@ RadioClock::RadioClock(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&RadioClock::handleIndexInDeviceSetChanged
);
}
RadioClock::~RadioClock()
@ -564,3 +565,16 @@ void RadioClock::networkManagerFinished(QNetworkReply *reply)
reply->deleteLater();
}
void RadioClock::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -199,7 +199,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif // INCLUDE_RADIOCLOCK_H

Wyświetl plik

@ -58,11 +58,6 @@ RemoteSink::RemoteSink(DeviceAPI *deviceAPI) :
updateWithDeviceData();
m_basebandSink = new RemoteSinkBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->moveToThread(&m_thread);
applySettings(m_settings, true);
@ -72,6 +67,12 @@ RemoteSink::RemoteSink(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&RemoteSink::handleIndexInDeviceSetChanged
);
}
RemoteSink::~RemoteSink()
@ -622,3 +623,16 @@ void RemoteSink::networkManagerFinished(QNetworkReply *reply)
reply->deleteLater();
}
void RemoteSink::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -150,6 +150,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif /* INCLUDE_REMOTESINK_H_ */

Wyświetl plik

@ -59,11 +59,6 @@ SigMFFileSink::SigMFFileSink(DeviceAPI *deviceAPI) :
setObjectName(m_channelId);
m_basebandSink = new SigMFFileSinkBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setSpectrumSink(&m_spectrumVis);
m_basebandSink->moveToThread(&m_thread);
@ -74,6 +69,12 @@ SigMFFileSink::SigMFFileSink(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&SigMFFileSink::handleIndexInDeviceSetChanged
);
}
SigMFFileSink::~SigMFFileSink()
@ -745,3 +746,16 @@ void SigMFFileSink::networkManagerFinished(QNetworkReply *reply)
reply->deleteLater();
}
void SigMFFileSink::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
}

Wyświetl plik

@ -186,6 +186,7 @@ private:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
};
#endif /* INCLUDE_SIGMFFILESINK_H_ */

Wyświetl plik

@ -54,11 +54,6 @@ UDPSink::UDPSink(DeviceAPI *deviceAPI) :
m_thread = new QThread(this);
m_basebandSink = new UDPSinkBaseband();
m_basebandSink->setFifoLabel(QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(getIndexInDeviceSet())
);
m_basebandSink->setSpectrum(&m_spectrumVis);
m_basebandSink->moveToThread(m_thread);
@ -69,6 +64,12 @@ UDPSink::UDPSink(DeviceAPI *deviceAPI) :
m_networkManager = new QNetworkAccessManager();
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
QObject::connect(
this,
&ChannelAPI::indexInDeviceSetChanged,
this,
&UDPSink::handleIndexInDeviceSetChanged
);
}
UDPSink::~UDPSink()
@ -698,3 +699,17 @@ void UDPSink::enableSpectrum(bool enable)
UDPSinkBaseband::MsgEnableSpectrum *msg = UDPSinkBaseband::MsgEnableSpectrum::create(enable);
m_basebandSink->getInputMessageQueue()->push(msg);
}
void UDPSink::handleIndexInDeviceSetChanged(int index)
{
if (index < 0) {
return;
}
QString fifoLabel = QString("%1 [%2:%3]")
.arg(m_channelId)
.arg(m_deviceAPI->getDeviceSetIndex())
.arg(index);
m_basebandSink->setFifoLabel(fifoLabel);
m_basebandSink->setAudioFifoLabel(fifoLabel);
}

Wyświetl plik

@ -127,6 +127,7 @@ public:
private slots:
void networkManagerFinished(QNetworkReply *reply);
void handleIndexInDeviceSetChanged(int index);
protected:
DeviceAPI* m_deviceAPI;

Wyświetl plik

@ -89,6 +89,7 @@ public:
double getInMagSq() const { return m_sink.getInMagSq(); }
bool getSquelchOpen() const { return m_sink.getSquelchOpen(); }
void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); }
void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); }
private:
SampleSinkFifo m_sampleFifo;

Wyświetl plik

@ -48,6 +48,7 @@ public:
void applySettings(const UDPSinkSettings& settings, bool force = false);
AudioFifo *getAudioFifo() { return &m_audioFifo; }
void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); }
void setSpectrum(BasebandSampleSink* spectrum) { m_spectrum = spectrum; }
void enableSpectrum(bool enable) { m_spectrumEnabled = enable; }
void setSpectrumPositiveOnly(bool positiveOnly) { m_spectrumPositiveOnly = positiveOnly; }

Wyświetl plik

@ -63,7 +63,7 @@ bool AudioFifo::setSize(uint32_t numSamples)
return create(numSamples);
}
uint AudioFifo::write(const quint8* data, uint32_t numSamples)
uint32_t AudioFifo::write(const quint8* data, uint32_t numSamples)
{
uint32_t total;
uint32_t remaining;
@ -102,11 +102,20 @@ uint AudioFifo::write(const quint8* data, uint32_t numSamples)
}
m_mutex.unlock();
emit dataReady();
if (total < numSamples)
{
qCritical("AudioFifo::write: (%s) overflow %u samples",
qPrintable(m_label), numSamples - total);
emit overflow(numSamples - total);
}
return total;
}
uint AudioFifo::read(quint8* data, uint32_t numSamples)
uint32_t AudioFifo::read(quint8* data, uint32_t numSamples)
{
uint32_t total;
uint32_t remaining;

Wyświetl plik

@ -46,6 +46,7 @@ public:
inline bool isEmpty() const { return m_fill == 0; }
inline bool isFull() const { return m_fill == m_size; }
inline uint32_t size() const { return m_size; }
void setLabel(const QString& label) { m_label = label; }
private:
QMutex m_mutex;
@ -58,11 +59,13 @@ private:
uint32_t m_fill;
uint32_t m_head;
uint32_t m_tail;
QString m_label;
bool create(uint32_t numSamples);
signals:
void dataReady();
void overflow(int nsamples);
};
#endif // INCLUDE_AUDIOFIFO_H

Wyświetl plik

@ -120,7 +120,13 @@ public:
}
int getIndexInDeviceSet() const { return m_indexInDeviceSet; }
void setIndexInDeviceSet(int indexInDeviceSet) { m_indexInDeviceSet = indexInDeviceSet; }
void setIndexInDeviceSet(int indexInDeviceSet)
{
m_indexInDeviceSet = indexInDeviceSet;
emit indexInDeviceSetChanged(indexInDeviceSet);
}
int getDeviceSetIndex() const { return m_deviceSetIndex; }
void setDeviceSetIndex(int deviceSetIndex) { m_deviceSetIndex = deviceSetIndex; }
DeviceAPI *getDeviceAPI() { return m_deviceAPI; }
@ -164,6 +170,9 @@ private:
int m_deviceSetIndex;
DeviceAPI *m_deviceAPI;
uint64_t m_uid;
signals:
void indexInDeviceSetChanged(int index);
};