1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-28 15:56:33 -04: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_currentOutputSampleRate(0),
m_currentCenterFrequency(0) m_currentCenterFrequency(0)
{ {
QString name = "Channelizer(" + m_sampleSink->objectName() + ")"; QString name = "DownChannelizer(" + m_sampleSink->objectName() + ")";
setObjectName(name); setObjectName(name);
} }
@ -75,7 +75,7 @@ void DownChannelizer::start()
{ {
if (m_sampleSink != 0) if (m_sampleSink != 0)
{ {
qDebug() << "Channelizer::start: thread: " << thread() qDebug() << "DownChannelizer::start: thread: " << thread()
<< " m_inputSampleRate: " << m_inputSampleRate << " m_inputSampleRate: " << m_inputSampleRate
<< " m_requestedOutputSampleRate: " << m_requestedOutputSampleRate << " m_requestedOutputSampleRate: " << m_requestedOutputSampleRate
<< " m_requestedCenterFrequency: " << m_requestedCenterFrequency; << " m_requestedCenterFrequency: " << m_requestedCenterFrequency;
@ -91,7 +91,7 @@ void DownChannelizer::stop()
bool DownChannelizer::handleMessage(const Message& cmd) 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. // 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; DSPSignalNotification& notif = (DSPSignalNotification&) cmd;
m_inputSampleRate = notif.getSampleRate(); m_inputSampleRate = notif.getSampleRate();
qDebug() << "Channelizer::handleMessage: DSPSignalNotification: m_inputSampleRate: " << m_inputSampleRate; qDebug() << "DownChannelizer::handleMessage: DSPSignalNotification: m_inputSampleRate: " << m_inputSampleRate;
applyConfiguration(); applyConfiguration();
if (m_sampleSink != 0) if (m_sampleSink != 0)
@ -116,7 +116,7 @@ bool DownChannelizer::handleMessage(const Message& cmd)
m_requestedOutputSampleRate = chan.getSampleRate(); m_requestedOutputSampleRate = chan.getSampleRate();
m_requestedCenterFrequency = chan.getCenterFrequency(); m_requestedCenterFrequency = chan.getCenterFrequency();
qDebug() << "Channelizer::handleMessage: DSPConfigureChannelizer:" qDebug() << "DownChannelizer::handleMessage: DSPConfigureChannelizer:"
<< " m_requestedOutputSampleRate: " << m_requestedOutputSampleRate << " m_requestedOutputSampleRate: " << m_requestedOutputSampleRate
<< " m_requestedCenterFrequency: " << m_requestedCenterFrequency; << " m_requestedCenterFrequency: " << m_requestedCenterFrequency;
@ -141,7 +141,7 @@ void DownChannelizer::applyConfiguration()
{ {
if (m_inputSampleRate == 0) if (m_inputSampleRate == 0)
{ {
qDebug() << "Channelizer::applyConfiguration: m_inputSampleRate=0 aborting"; qDebug() << "DownChannelizer::applyConfiguration: m_inputSampleRate=0 aborting";
return; return;
} }
@ -157,7 +157,7 @@ void DownChannelizer::applyConfiguration()
m_currentOutputSampleRate = m_inputSampleRate / (1 << m_filterStages.size()); m_currentOutputSampleRate = m_inputSampleRate / (1 << m_filterStages.size());
qDebug() << "Channelizer::applyConfiguration in=" << m_inputSampleRate qDebug() << "DownChannelizer::applyConfiguration in=" << m_inputSampleRate
<< ", req=" << m_requestedOutputSampleRate << ", req=" << m_requestedOutputSampleRate
<< ", out=" << m_currentOutputSampleRate << ", out=" << m_currentOutputSampleRate
<< ", fc=" << m_currentCenterFrequency; << ", fc=" << m_currentCenterFrequency;

View File

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

View File

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

View File

@ -30,7 +30,7 @@ void SampleSinkFifo::create(uint s)
m_size = m_data.size(); m_size = m_data.size();
if(m_size != s) if(m_size != s)
qCritical("SampleFifo: out of memory"); qCritical("SampleSinkFifo: out of memory");
} }
SampleSinkFifo::SampleSinkFifo(QObject* parent) : SampleSinkFifo::SampleSinkFifo(QObject* parent) :
@ -81,11 +81,11 @@ uint SampleSinkFifo::write(const quint8* data, uint count)
if(m_suppressed < 0) { if(m_suppressed < 0) {
m_suppressed = 0; m_suppressed = 0;
m_msgRateTimer.start(); m_msgRateTimer.start();
qCritical("SampleFifo: overflow - dropping %u samples", count - total); qCritical("SampleSinkFifo: overflow - dropping %u samples", count - total);
} else { } else {
if(m_msgRateTimer.elapsed() > 2500) { if(m_msgRateTimer.elapsed() > 2500) {
qCritical("SampleFifo: %u messages dropped", m_suppressed); qCritical("SampleSinkFifo: %u messages dropped", m_suppressed);
qCritical("SampleFifo: overflow - dropping %u samples", count - total); qCritical("SampleSinkFifo: overflow - dropping %u samples", count - total);
m_suppressed = -1; m_suppressed = -1;
} else { } else {
m_suppressed++; m_suppressed++;
@ -123,11 +123,11 @@ uint SampleSinkFifo::write(SampleVector::const_iterator begin, SampleVector::con
if(m_suppressed < 0) { if(m_suppressed < 0) {
m_suppressed = 0; m_suppressed = 0;
m_msgRateTimer.start(); m_msgRateTimer.start();
qCritical("SampleFifo: overflow - dropping %u samples", count - total); qCritical("SampleSinkFifo: overflow - dropping %u samples", count - total);
} else { } else {
if(m_msgRateTimer.elapsed() > 2500) { if(m_msgRateTimer.elapsed() > 2500) {
qCritical("SampleFifo: %u messages dropped", m_suppressed); qCritical("SampleSinkFifo: %u messages dropped", m_suppressed);
qCritical("SampleFifo: overflow - dropping %u samples", count - total); qCritical("SampleSinkFifo: overflow - dropping %u samples", count - total);
m_suppressed = -1; m_suppressed = -1;
} else { } else {
m_suppressed++; m_suppressed++;
@ -162,7 +162,7 @@ uint SampleSinkFifo::read(SampleVector::iterator begin, SampleVector::iterator e
total = MIN(count, m_fill); total = MIN(count, m_fill);
if(total < count) if(total < count)
qCritical("SampleFifo: underflow - missing %u samples", count - total); qCritical("SampleSinkFifo: underflow - missing %u samples", count - total);
remaining = total; remaining = total;
while(remaining > 0) { while(remaining > 0) {
@ -190,7 +190,7 @@ uint SampleSinkFifo::readBegin(uint count,
total = MIN(count, m_fill); total = MIN(count, m_fill);
if(total < count) if(total < count)
qCritical("SampleFifo: underflow - missing %u samples", count - total); qCritical("SampleSinkFifo: underflow - missing %u samples", count - total);
remaining = total; remaining = total;
if(remaining > 0) { if(remaining > 0) {
@ -221,7 +221,7 @@ uint SampleSinkFifo::readCommit(uint count)
QMutexLocker mutexLocker(&m_mutex); QMutexLocker mutexLocker(&m_mutex);
if(count > m_fill) { if(count > m_fill) {
qCritical("SampleFifo: cannot commit more than available samples"); qCritical("SampleSinkFifo: cannot commit more than available samples");
count = m_fill; count = m_fill;
} }
m_head = (m_head + count) % m_size; 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) : ThreadedBasebandSampleSink::ThreadedBasebandSampleSink(BasebandSampleSink* sampleSink, QObject *parent) :
m_basebandSampleSink(sampleSink) m_basebandSampleSink(sampleSink)
{ {
QString name = "ThreadedSampleSink(" + m_basebandSampleSink->objectName() + ")"; QString name = "ThreadedBasebandSampleSink(" + m_basebandSampleSink->objectName() + ")";
setObjectName(name); setObjectName(name);
qDebug() << "ThreadedSampleSink::ThreadedSampleSink: " << name; qDebug() << "ThreadedBasebandSampleSink::ThreadedBasebandSampleSink: " << name;
m_thread = new QThread(parent); m_thread = new QThread(parent);
m_threadedBasebandSampleFifo = new ThreadedBasebandSampleFifo(m_basebandSampleSink); m_threadedBasebandSampleFifo = new ThreadedBasebandSampleFifo(m_basebandSampleSink);
@ -80,7 +80,7 @@ ThreadedBasebandSampleSink::ThreadedBasebandSampleSink(BasebandSampleSink* sampl
//connect(&m_sampleFifo, SIGNAL(dataReady()), this, SLOT(handleData())); //connect(&m_sampleFifo, SIGNAL(dataReady()), this, SLOT(handleData()));
//m_sampleFifo.setSize(262144); //m_sampleFifo.setSize(262144);
qDebug() << "ThreadedSampleSink::ThreadedSampleSink: thread: " << thread() << " m_thread: " << m_thread; qDebug() << "ThreadedBasebandSampleSink::ThreadedBasebandSampleSink: thread: " << thread() << " m_thread: " << m_thread;
} }
ThreadedBasebandSampleSink::~ThreadedBasebandSampleSink() ThreadedBasebandSampleSink::~ThreadedBasebandSampleSink()
@ -91,14 +91,14 @@ ThreadedBasebandSampleSink::~ThreadedBasebandSampleSink()
void ThreadedBasebandSampleSink::start() void ThreadedBasebandSampleSink::start()
{ {
qDebug() << "ThreadedSampleSink::start"; qDebug() << "ThreadedBasebandSampleSink::start";
m_thread->start(); m_thread->start();
m_basebandSampleSink->start(); m_basebandSampleSink->start();
} }
void ThreadedBasebandSampleSink::stop() void ThreadedBasebandSampleSink::stop()
{ {
qDebug() << "ThreadedSampleSink::stop"; qDebug() << "ThreadedBasebandSampleSink::stop";
m_basebandSampleSink->stop(); m_basebandSampleSink->stop();
m_thread->exit(); m_thread->exit();
m_thread->wait(); m_thread->wait();