1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-17 05:41:56 -05:00

RxTx semantic move: updated debug message and displayed class names

This commit is contained in:
f4exb 2016-10-08 10:35:07 +02:00
parent 008ee56252
commit 5168fbf416
5 changed files with 62 additions and 62 deletions

View File

@ -15,7 +15,7 @@ DownChannelizer::DownChannelizer(BasebandSampleSink* sampleSink) :
m_currentOutputSampleRate(0),
m_currentCenterFrequency(0)
{
QString name = "Channelizer(" + m_sampleSink->objectName() + ")";
QString name = "DownChannelizer(" + m_sampleSink->objectName() + ")";
setObjectName(name);
}
@ -75,7 +75,7 @@ void DownChannelizer::start()
{
if (m_sampleSink != 0)
{
qDebug() << "Channelizer::start: thread: " << thread()
qDebug() << "DownChannelizer::start: thread: " << thread()
<< " m_inputSampleRate: " << m_inputSampleRate
<< " m_requestedOutputSampleRate: " << m_requestedOutputSampleRate
<< " m_requestedCenterFrequency: " << m_requestedCenterFrequency;
@ -91,7 +91,7 @@ void DownChannelizer::stop()
bool DownChannelizer::handleMessage(const Message& cmd)
{
qDebug() << "Channelizer::handleMessage: " << cmd.getIdentifier();
qDebug() << "DownChannelizer::handleMessage: " << cmd.getIdentifier();
// TODO: apply changes only if input sample rate or requested output sample rate change. Change of center frequency has no impact.
@ -99,7 +99,7 @@ bool DownChannelizer::handleMessage(const Message& cmd)
{
DSPSignalNotification& notif = (DSPSignalNotification&) cmd;
m_inputSampleRate = notif.getSampleRate();
qDebug() << "Channelizer::handleMessage: DSPSignalNotification: m_inputSampleRate: " << m_inputSampleRate;
qDebug() << "DownChannelizer::handleMessage: DSPSignalNotification: m_inputSampleRate: " << m_inputSampleRate;
applyConfiguration();
if (m_sampleSink != 0)
@ -116,7 +116,7 @@ bool DownChannelizer::handleMessage(const Message& cmd)
m_requestedOutputSampleRate = chan.getSampleRate();
m_requestedCenterFrequency = chan.getCenterFrequency();
qDebug() << "Channelizer::handleMessage: DSPConfigureChannelizer:"
qDebug() << "DownChannelizer::handleMessage: DSPConfigureChannelizer:"
<< " m_requestedOutputSampleRate: " << m_requestedOutputSampleRate
<< " m_requestedCenterFrequency: " << m_requestedCenterFrequency;
@ -141,7 +141,7 @@ void DownChannelizer::applyConfiguration()
{
if (m_inputSampleRate == 0)
{
qDebug() << "Channelizer::applyConfiguration: m_inputSampleRate=0 aborting";
qDebug() << "DownChannelizer::applyConfiguration: m_inputSampleRate=0 aborting";
return;
}
@ -157,7 +157,7 @@ void DownChannelizer::applyConfiguration()
m_currentOutputSampleRate = m_inputSampleRate / (1 << m_filterStages.size());
qDebug() << "Channelizer::applyConfiguration in=" << m_inputSampleRate
qDebug() << "DownChannelizer::applyConfiguration in=" << m_inputSampleRate
<< ", req=" << m_requestedOutputSampleRate
<< ", out=" << m_currentOutputSampleRate
<< ", fc=" << m_currentCenterFrequency;

View File

@ -56,7 +56,7 @@ DSPDeviceSourceEngine::~DSPDeviceSourceEngine()
void DSPDeviceSourceEngine::run()
{
qDebug() << "DSPDeviceEngine::run";
qDebug() << "DSPDeviceSourceEngine::run";
m_state = StIdle;
@ -66,20 +66,20 @@ void DSPDeviceSourceEngine::run()
void DSPDeviceSourceEngine::start()
{
qDebug() << "DSPDeviceEngine::start";
qDebug() << "DSPDeviceSourceEngine::start";
QThread::start();
}
void DSPDeviceSourceEngine::stop()
{
qDebug() << "DSPDeviceEngine::stop";
qDebug() << "DSPDeviceSourceEngine::stop";
DSPExit cmd;
m_syncMessenger.sendWait(cmd);
}
bool DSPDeviceSourceEngine::initAcquisition()
{
qDebug() << "DSPDeviceEngine::initAcquisition";
qDebug() << "DSPDeviceSourceEngine::initAcquisition";
DSPAcquisitionInit cmd;
return m_syncMessenger.sendWait(cmd) == StReady;
@ -87,7 +87,7 @@ bool DSPDeviceSourceEngine::initAcquisition()
bool DSPDeviceSourceEngine::startAcquisition()
{
qDebug() << "DSPDeviceEngine::startAcquisition";
qDebug() << "DSPDeviceSourceEngine::startAcquisition";
DSPAcquisitionStart cmd;
return m_syncMessenger.sendWait(cmd) == StRunning;
@ -95,7 +95,7 @@ bool DSPDeviceSourceEngine::startAcquisition()
void DSPDeviceSourceEngine::stopAcquistion()
{
qDebug() << "DSPDeviceEngine::stopAcquistion";
qDebug() << "DSPDeviceSourceEngine::stopAcquistion";
DSPAcquisitionStop cmd;
m_syncMessenger.storeMessage(cmd);
handleSynchronousMessages();
@ -108,55 +108,55 @@ void DSPDeviceSourceEngine::stopAcquistion()
void DSPDeviceSourceEngine::setSource(DeviceSampleSource* source)
{
qDebug() << "DSPDeviceEngine::setSource";
qDebug() << "DSPDeviceSourceEngine::setSource";
DSPSetSource cmd(source);
m_syncMessenger.sendWait(cmd);
}
void DSPDeviceSourceEngine::setSourceSequence(int sequence)
{
qDebug("DSPDeviceEngine::setSourceSequence: seq: %d", sequence);
qDebug("DSPDeviceSourceEngine::setSourceSequence: seq: %d", sequence);
m_sampleSourceSequence = sequence;
}
void DSPDeviceSourceEngine::addSink(BasebandSampleSink* sink)
{
qDebug() << "DSPDeviceEngine::addSink: " << sink->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSourceEngine::addSink: " << sink->objectName().toStdString().c_str();
DSPAddSink cmd(sink);
m_syncMessenger.sendWait(cmd);
}
void DSPDeviceSourceEngine::removeSink(BasebandSampleSink* sink)
{
qDebug() << "DSPDeviceEngine::removeSink: " << sink->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSourceEngine::removeSink: " << sink->objectName().toStdString().c_str();
DSPRemoveSink cmd(sink);
m_syncMessenger.sendWait(cmd);
}
void DSPDeviceSourceEngine::addThreadedSink(ThreadedBasebandSampleSink* sink)
{
qDebug() << "DSPDeviceEngine::addThreadedSink: " << sink->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSourceEngine::addThreadedSink: " << sink->objectName().toStdString().c_str();
DSPAddThreadedSampleSink cmd(sink);
m_syncMessenger.sendWait(cmd);
}
void DSPDeviceSourceEngine::removeThreadedSink(ThreadedBasebandSampleSink* sink)
{
qDebug() << "DSPDeviceEngine::removeThreadedSink: " << sink->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSourceEngine::removeThreadedSink: " << sink->objectName().toStdString().c_str();
DSPRemoveThreadedSampleSink cmd(sink);
m_syncMessenger.sendWait(cmd);
}
void DSPDeviceSourceEngine::configureCorrections(bool dcOffsetCorrection, bool iqImbalanceCorrection)
{
qDebug() << "DSPDeviceEngine::configureCorrections";
qDebug() << "DSPDeviceSourceEngine::configureCorrections";
DSPConfigureCorrection* cmd = new DSPConfigureCorrection(dcOffsetCorrection, iqImbalanceCorrection);
m_inputMessageQueue.push(cmd);
}
QString DSPDeviceSourceEngine::errorMessage()
{
qDebug() << "DSPDeviceEngine::errorMessage";
qDebug() << "DSPDeviceSourceEngine::errorMessage";
DSPGetErrorMessage cmd;
m_syncMessenger.sendWait(cmd);
return cmd.getErrorMessage();
@ -164,7 +164,7 @@ QString DSPDeviceSourceEngine::errorMessage()
QString DSPDeviceSourceEngine::sourceDeviceDescription()
{
qDebug() << "DSPDeviceEngine::sourceDeviceDescription";
qDebug() << "DSPDeviceSourceEngine::sourceDeviceDescription";
DSPGetSourceDeviceDescription cmd;
m_syncMessenger.sendWait(cmd);
return cmd.getDeviceDescription();
@ -321,7 +321,7 @@ void DSPDeviceSourceEngine::work()
DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoIdle()
{
qDebug() << "DSPDeviceEngine::gotoIdle";
qDebug() << "DSPDeviceSourceEngine::gotoIdle";
switch(m_state) {
case StNotStarted:
@ -357,7 +357,7 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoIdle()
DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoInit()
{
qDebug() << "DSPDeviceEngine::gotoInit";
qDebug() << "DSPDeviceSourceEngine::gotoInit";
switch(m_state) {
case StNotStarted:
@ -390,7 +390,7 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoInit()
m_centerFrequency = m_deviceSampleSource->getCenterFrequency();
m_sampleRate = m_deviceSampleSource->getSampleRate();
qDebug() << "DSPDeviceEngine::gotoInit: " << m_deviceDescription.toStdString().c_str() << ": "
qDebug() << "DSPDeviceSourceEngine::gotoInit: " << m_deviceDescription.toStdString().c_str() << ": "
<< " sampleRate: " << m_sampleRate
<< " centerFrequency: " << m_centerFrequency;
@ -398,13 +398,13 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoInit()
for (BasebandSampleSinks::const_iterator it = m_basebandSampleSinks.begin(); it != m_basebandSampleSinks.end(); ++it)
{
qDebug() << "DSPDeviceEngine::gotoInit: initializing " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSourceEngine::gotoInit: initializing " << (*it)->objectName().toStdString().c_str();
(*it)->handleMessage(notif);
}
for (ThreadedBasebandSampleSinks::const_iterator it = m_threadedBasebandSampleSinks.begin(); it != m_threadedBasebandSampleSinks.end(); ++it)
{
qDebug() << "DSPDeviceEngine::gotoInit: initializing ThreadedSampleSink(" << (*it)->getSampleSinkObjectName().toStdString().c_str() << ")";
qDebug() << "DSPDeviceSourceEngine::gotoInit: initializing ThreadedSampleSink(" << (*it)->getSampleSinkObjectName().toStdString().c_str() << ")";
(*it)->handleSinkMessage(notif);
}
@ -418,7 +418,7 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoInit()
DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoRunning()
{
qDebug() << "DSPDeviceEngine::gotoRunning";
qDebug() << "DSPDeviceSourceEngine::gotoRunning";
switch(m_state)
{
@ -437,10 +437,10 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoRunning()
}
if(m_deviceSampleSource == NULL) {
return gotoError("DSPDeviceEngine::gotoRunning: No sample source configured");
return gotoError("DSPDeviceSourceEngine::gotoRunning: No sample source configured");
}
qDebug() << "DSPDeviceEngine::gotoRunning: " << m_deviceDescription.toStdString().c_str() << " started";
qDebug() << "DSPDeviceSourceEngine::gotoRunning: " << m_deviceDescription.toStdString().c_str() << " started";
// Start everything
@ -451,24 +451,24 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoRunning()
for(BasebandSampleSinks::const_iterator it = m_basebandSampleSinks.begin(); it != m_basebandSampleSinks.end(); it++)
{
qDebug() << "DSPDeviceEngine::gotoRunning: starting " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSourceEngine::gotoRunning: starting " << (*it)->objectName().toStdString().c_str();
(*it)->start();
}
for (ThreadedBasebandSampleSinks::const_iterator it = m_threadedBasebandSampleSinks.begin(); it != m_threadedBasebandSampleSinks.end(); ++it)
{
qDebug() << "DSPDeviceEngine::gotoRunning: starting ThreadedSampleSink(" << (*it)->getSampleSinkObjectName().toStdString().c_str() << ")";
qDebug() << "DSPDeviceSourceEngine::gotoRunning: starting ThreadedSampleSink(" << (*it)->getSampleSinkObjectName().toStdString().c_str() << ")";
(*it)->start();
}
qDebug() << "DSPDeviceEngine::gotoRunning:input message queue pending: " << m_inputMessageQueue.size();
qDebug() << "DSPDeviceSourceEngine::gotoRunning:input message queue pending: " << m_inputMessageQueue.size();
return StRunning;
}
DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoError(const QString& errorMessage)
{
qDebug() << "DSPDeviceEngine::gotoError";
qDebug() << "DSPDeviceSourceEngine::gotoError";
m_errorMessage = errorMessage;
m_deviceDescription.clear();
@ -489,12 +489,12 @@ void DSPDeviceSourceEngine::handleSetSource(DeviceSampleSource* source)
if(m_deviceSampleSource != 0)
{
qDebug("DSPDeviceEngine::handleSetSource: set %s", qPrintable(source->getDeviceDescription()));
qDebug("DSPDeviceSourceEngine::handleSetSource: set %s", qPrintable(source->getDeviceDescription()));
connect(m_deviceSampleSource->getSampleFifo(), SIGNAL(dataReady()), this, SLOT(handleData()), Qt::QueuedConnection);
}
else
{
qDebug("DSPDeviceEngine::handleSetSource: set none");
qDebug("DSPDeviceSourceEngine::handleSetSource: set none");
}
}
@ -509,7 +509,7 @@ void DSPDeviceSourceEngine::handleData()
void DSPDeviceSourceEngine::handleSynchronousMessages()
{
Message *message = m_syncMessenger.getMessage();
qDebug() << "DSPDeviceEngine::handleSynchronousMessages: " << message->getIdentifier();
qDebug() << "DSPDeviceSourceEngine::handleSynchronousMessages: " << message->getIdentifier();
if (DSPExit::match(*message))
{
@ -579,13 +579,13 @@ void DSPDeviceSourceEngine::handleSynchronousMessages()
void DSPDeviceSourceEngine::handleInputMessages()
{
qDebug() << "DSPDeviceEngine::handleInputMessages";
qDebug() << "DSPDeviceSourceEngine::handleInputMessages";
Message* message;
while ((message = m_inputMessageQueue.pop()) != 0)
{
qDebug("DSPDeviceEngine::handleInputMessages: message: %s", message->getIdentifier());
qDebug("DSPDeviceSourceEngine::handleInputMessages: message: %s", message->getIdentifier());
if (DSPConfigureCorrection::match(*message))
{
@ -618,19 +618,19 @@ void DSPDeviceSourceEngine::handleInputMessages()
m_sampleRate = notif->getSampleRate();
m_centerFrequency = notif->getCenterFrequency();
qDebug() << "DSPDeviceEngine::handleInputMessages: DSPSignalNotification(" << m_sampleRate << "," << m_centerFrequency << ")";
qDebug() << "DSPDeviceSourceEngine::handleInputMessages: DSPSignalNotification(" << m_sampleRate << "," << m_centerFrequency << ")";
// forward source changes to sinks with immediate execution
for(BasebandSampleSinks::const_iterator it = m_basebandSampleSinks.begin(); it != m_basebandSampleSinks.end(); it++)
{
qDebug() << "DSPDeviceEngine::handleInputMessages: forward message to " << (*it)->objectName().toStdString().c_str();
qDebug() << "DSPDeviceSourceEngine::handleInputMessages: forward message to " << (*it)->objectName().toStdString().c_str();
(*it)->handleMessage(*message);
}
for (ThreadedBasebandSampleSinks::const_iterator it = m_threadedBasebandSampleSinks.begin(); it != m_threadedBasebandSampleSinks.end(); ++it)
{
qDebug() << "DSPDeviceEngine::handleSourceMessages: forward message to ThreadedSampleSink(" << (*it)->getSampleSinkObjectName().toStdString().c_str() << ")";
qDebug() << "DSPDeviceSourceEngine::handleSourceMessages: forward message to ThreadedSampleSink(" << (*it)->getSampleSinkObjectName().toStdString().c_str() << ")";
(*it)->handleSinkMessage(*message);
}

View File

@ -26,7 +26,7 @@ FileRecord::FileRecord(const std::string& filename) :
m_recordStart(false),
m_byteCount(0)
{
setObjectName("FileSink");
setObjectName("FileRecord");
}
FileRecord::~FileRecord()
@ -74,7 +74,7 @@ void FileRecord::startRecording()
{
if (!m_sampleFile.is_open())
{
qDebug() << "FileSink::startRecording";
qDebug() << "FileRecord::startRecording";
m_sampleFile.open(m_fileName.c_str(), std::ios::binary);
m_recordOn = true;
m_recordStart = true;
@ -86,7 +86,7 @@ void FileRecord::stopRecording()
{
if (m_sampleFile.is_open())
{
qDebug() << "FileSink::stopRecording";
qDebug() << "FileRecord::stopRecording";
m_sampleFile.close();
m_recordOn = false;
m_recordStart = false;
@ -95,14 +95,14 @@ void FileRecord::stopRecording()
bool FileRecord::handleMessage(const Message& message)
{
qDebug() << "FileSink::handleMessage";
qDebug() << "FileRecord::handleMessage";
if (DSPSignalNotification::match(message))
{
DSPSignalNotification& notif = (DSPSignalNotification&) message;
m_sampleRate = notif.getSampleRate();
m_centerFrequency = notif.getCenterFrequency();
qDebug() << "FileSink::handleMessage: DSPSignalNotification: m_inputSampleRate: " << m_sampleRate
qDebug() << "FileRecord::handleMessage: DSPSignalNotification: m_inputSampleRate: " << m_sampleRate
<< " m_centerFrequency: " << m_centerFrequency;
return true;
}

View File

@ -30,7 +30,7 @@ void SampleSinkFifo::create(uint s)
m_size = m_data.size();
if(m_size != s)
qCritical("SampleFifo: out of memory");
qCritical("SampleSinkFifo: out of memory");
}
SampleSinkFifo::SampleSinkFifo(QObject* parent) :
@ -81,11 +81,11 @@ uint SampleSinkFifo::write(const quint8* data, uint count)
if(m_suppressed < 0) {
m_suppressed = 0;
m_msgRateTimer.start();
qCritical("SampleFifo: overflow - dropping %u samples", count - total);
qCritical("SampleSinkFifo: overflow - dropping %u samples", count - total);
} else {
if(m_msgRateTimer.elapsed() > 2500) {
qCritical("SampleFifo: %u messages dropped", m_suppressed);
qCritical("SampleFifo: overflow - dropping %u samples", count - total);
qCritical("SampleSinkFifo: %u messages dropped", m_suppressed);
qCritical("SampleSinkFifo: overflow - dropping %u samples", count - total);
m_suppressed = -1;
} else {
m_suppressed++;
@ -123,11 +123,11 @@ uint SampleSinkFifo::write(SampleVector::const_iterator begin, SampleVector::con
if(m_suppressed < 0) {
m_suppressed = 0;
m_msgRateTimer.start();
qCritical("SampleFifo: overflow - dropping %u samples", count - total);
qCritical("SampleSinkFifo: overflow - dropping %u samples", count - total);
} else {
if(m_msgRateTimer.elapsed() > 2500) {
qCritical("SampleFifo: %u messages dropped", m_suppressed);
qCritical("SampleFifo: overflow - dropping %u samples", count - total);
qCritical("SampleSinkFifo: %u messages dropped", m_suppressed);
qCritical("SampleSinkFifo: overflow - dropping %u samples", count - total);
m_suppressed = -1;
} else {
m_suppressed++;
@ -162,7 +162,7 @@ uint SampleSinkFifo::read(SampleVector::iterator begin, SampleVector::iterator e
total = MIN(count, m_fill);
if(total < count)
qCritical("SampleFifo: underflow - missing %u samples", count - total);
qCritical("SampleSinkFifo: underflow - missing %u samples", count - total);
remaining = total;
while(remaining > 0) {
@ -190,7 +190,7 @@ uint SampleSinkFifo::readBegin(uint count,
total = MIN(count, m_fill);
if(total < count)
qCritical("SampleFifo: underflow - missing %u samples", count - total);
qCritical("SampleSinkFifo: underflow - missing %u samples", count - total);
remaining = total;
if(remaining > 0) {
@ -221,7 +221,7 @@ uint SampleSinkFifo::readCommit(uint count)
QMutexLocker mutexLocker(&m_mutex);
if(count > m_fill) {
qCritical("SampleFifo: cannot commit more than available samples");
qCritical("SampleSinkFifo: cannot commit more than available samples");
count = m_fill;
}
m_head = (m_head + count) % m_size;

View File

@ -66,10 +66,10 @@ void ThreadedBasebandSampleFifo::handleFifoData() // FIXME: Fixed? Move it to th
ThreadedBasebandSampleSink::ThreadedBasebandSampleSink(BasebandSampleSink* sampleSink, QObject *parent) :
m_basebandSampleSink(sampleSink)
{
QString name = "ThreadedSampleSink(" + m_basebandSampleSink->objectName() + ")";
QString name = "ThreadedBasebandSampleSink(" + m_basebandSampleSink->objectName() + ")";
setObjectName(name);
qDebug() << "ThreadedSampleSink::ThreadedSampleSink: " << name;
qDebug() << "ThreadedBasebandSampleSink::ThreadedBasebandSampleSink: " << name;
m_thread = new QThread(parent);
m_threadedBasebandSampleFifo = new ThreadedBasebandSampleFifo(m_basebandSampleSink);
@ -80,7 +80,7 @@ ThreadedBasebandSampleSink::ThreadedBasebandSampleSink(BasebandSampleSink* sampl
//connect(&m_sampleFifo, SIGNAL(dataReady()), this, SLOT(handleData()));
//m_sampleFifo.setSize(262144);
qDebug() << "ThreadedSampleSink::ThreadedSampleSink: thread: " << thread() << " m_thread: " << m_thread;
qDebug() << "ThreadedBasebandSampleSink::ThreadedBasebandSampleSink: thread: " << thread() << " m_thread: " << m_thread;
}
ThreadedBasebandSampleSink::~ThreadedBasebandSampleSink()
@ -91,14 +91,14 @@ ThreadedBasebandSampleSink::~ThreadedBasebandSampleSink()
void ThreadedBasebandSampleSink::start()
{
qDebug() << "ThreadedSampleSink::start";
qDebug() << "ThreadedBasebandSampleSink::start";
m_thread->start();
m_basebandSampleSink->start();
}
void ThreadedBasebandSampleSink::stop()
{
qDebug() << "ThreadedSampleSink::stop";
qDebug() << "ThreadedBasebandSampleSink::stop";
m_basebandSampleSink->stop();
m_thread->exit();
m_thread->wait();