mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-03-22 04:08:29 -04:00
RxTx semantic move: renaming attributes (1). Corrected Star UML model
This commit is contained in:
parent
e204efe2b8
commit
9a24a1a99f
12320
doc/model/SDRAngel.mdj
12320
doc/model/SDRAngel.mdj
File diff suppressed because it is too large
Load Diff
@ -30,9 +30,9 @@ DSPDeviceSourceEngine::DSPDeviceSourceEngine(uint uid, QObject* parent) :
|
||||
m_uid(uid),
|
||||
QThread(parent),
|
||||
m_state(StNotStarted),
|
||||
m_sampleSource(0),
|
||||
m_deviceSampleSource(0),
|
||||
m_sampleSourceSequence(0),
|
||||
m_sampleSinks(),
|
||||
m_basebandSampleSinks(),
|
||||
m_sampleRate(0),
|
||||
m_centerFrequency(0),
|
||||
m_dcOffsetCorrection(false),
|
||||
@ -242,7 +242,7 @@ void DSPDeviceSourceEngine::imbalance(SampleVector::iterator begin, SampleVector
|
||||
|
||||
void DSPDeviceSourceEngine::work()
|
||||
{
|
||||
SampleFifo* sampleFifo = m_sampleSource->getSampleFifo();
|
||||
SampleFifo* sampleFifo = m_deviceSampleSource->getSampleFifo();
|
||||
std::size_t samplesDone = 0;
|
||||
bool positiveOnly = false;
|
||||
|
||||
@ -270,13 +270,13 @@ void DSPDeviceSourceEngine::work()
|
||||
}
|
||||
|
||||
// feed data to direct sinks
|
||||
for (SampleSinks::const_iterator it = m_sampleSinks.begin(); it != m_sampleSinks.end(); ++it)
|
||||
for (BasebandSampleSinks::const_iterator it = m_basebandSampleSinks.begin(); it != m_basebandSampleSinks.end(); ++it)
|
||||
{
|
||||
(*it)->feed(part1begin, part1end, positiveOnly);
|
||||
}
|
||||
|
||||
// feed data to threaded sinks
|
||||
for (ThreadedSampleSinks::const_iterator it = m_threadedSampleSinks.begin(); it != m_threadedSampleSinks.end(); ++it)
|
||||
for (ThreadedBasebandSampleSinks::const_iterator it = m_threadedBasebandSampleSinks.begin(); it != m_threadedBasebandSampleSinks.end(); ++it)
|
||||
{
|
||||
(*it)->feed(part1begin, part1end, positiveOnly);
|
||||
}
|
||||
@ -297,13 +297,13 @@ void DSPDeviceSourceEngine::work()
|
||||
}
|
||||
|
||||
// feed data to direct sinks
|
||||
for (SampleSinks::const_iterator it = m_sampleSinks.begin(); it != m_sampleSinks.end(); it++)
|
||||
for (BasebandSampleSinks::const_iterator it = m_basebandSampleSinks.begin(); it != m_basebandSampleSinks.end(); it++)
|
||||
{
|
||||
(*it)->feed(part2begin, part2end, positiveOnly);
|
||||
}
|
||||
|
||||
// feed data to threaded sinks
|
||||
for (ThreadedSampleSinks::const_iterator it = m_threadedSampleSinks.begin(); it != m_threadedSampleSinks.end(); ++it)
|
||||
for (ThreadedBasebandSampleSinks::const_iterator it = m_threadedBasebandSampleSinks.begin(); it != m_threadedBasebandSampleSinks.end(); ++it)
|
||||
{
|
||||
(*it)->feed(part2begin, part2end, positiveOnly);
|
||||
}
|
||||
@ -336,19 +336,19 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoIdle()
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_sampleSource == 0)
|
||||
if(m_deviceSampleSource == 0)
|
||||
{
|
||||
return StIdle;
|
||||
}
|
||||
|
||||
// stop everything
|
||||
|
||||
for(SampleSinks::const_iterator it = m_sampleSinks.begin(); it != m_sampleSinks.end(); it++)
|
||||
for(BasebandSampleSinks::const_iterator it = m_basebandSampleSinks.begin(); it != m_basebandSampleSinks.end(); it++)
|
||||
{
|
||||
(*it)->stop();
|
||||
}
|
||||
|
||||
m_sampleSource->stop();
|
||||
m_deviceSampleSource->stop();
|
||||
m_deviceDescription.clear();
|
||||
m_sampleRate = 0;
|
||||
|
||||
@ -374,7 +374,7 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoInit()
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_sampleSource == 0)
|
||||
if (m_deviceSampleSource == 0)
|
||||
{
|
||||
return gotoError("No sample source configured");
|
||||
}
|
||||
@ -386,9 +386,9 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoInit()
|
||||
m_iRange = 1 << 16;
|
||||
m_qRange = 1 << 16;
|
||||
|
||||
m_deviceDescription = m_sampleSource->getDeviceDescription();
|
||||
m_centerFrequency = m_sampleSource->getCenterFrequency();
|
||||
m_sampleRate = m_sampleSource->getSampleRate();
|
||||
m_deviceDescription = m_deviceSampleSource->getDeviceDescription();
|
||||
m_centerFrequency = m_deviceSampleSource->getCenterFrequency();
|
||||
m_sampleRate = m_deviceSampleSource->getSampleRate();
|
||||
|
||||
qDebug() << "DSPDeviceEngine::gotoInit: " << m_deviceDescription.toStdString().c_str() << ": "
|
||||
<< " sampleRate: " << m_sampleRate
|
||||
@ -396,13 +396,13 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoInit()
|
||||
|
||||
DSPSignalNotification notif(m_sampleRate, m_centerFrequency);
|
||||
|
||||
for (SampleSinks::const_iterator it = m_sampleSinks.begin(); it != m_sampleSinks.end(); ++it)
|
||||
for (BasebandSampleSinks::const_iterator it = m_basebandSampleSinks.begin(); it != m_basebandSampleSinks.end(); ++it)
|
||||
{
|
||||
qDebug() << "DSPDeviceEngine::gotoInit: initializing " << (*it)->objectName().toStdString().c_str();
|
||||
(*it)->handleMessage(notif);
|
||||
}
|
||||
|
||||
for (ThreadedSampleSinks::const_iterator it = m_threadedSampleSinks.begin(); it != m_threadedSampleSinks.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() << ")";
|
||||
(*it)->handleSinkMessage(notif);
|
||||
@ -436,7 +436,7 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoRunning()
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_sampleSource == NULL) {
|
||||
if(m_deviceSampleSource == NULL) {
|
||||
return gotoError("DSPDeviceEngine::gotoRunning: No sample source configured");
|
||||
}
|
||||
|
||||
@ -444,18 +444,18 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoRunning()
|
||||
|
||||
// Start everything
|
||||
|
||||
if(!m_sampleSource->start(m_sampleSourceSequence))
|
||||
if(!m_deviceSampleSource->start(m_sampleSourceSequence))
|
||||
{
|
||||
return gotoError("Could not start sample source");
|
||||
}
|
||||
|
||||
for(SampleSinks::const_iterator it = m_sampleSinks.begin(); it != m_sampleSinks.end(); it++)
|
||||
for(BasebandSampleSinks::const_iterator it = m_basebandSampleSinks.begin(); it != m_basebandSampleSinks.end(); it++)
|
||||
{
|
||||
qDebug() << "DSPDeviceEngine::gotoRunning: starting " << (*it)->objectName().toStdString().c_str();
|
||||
(*it)->start();
|
||||
}
|
||||
|
||||
for (ThreadedSampleSinks::const_iterator it = m_threadedSampleSinks.begin(); it != m_threadedSampleSinks.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() << ")";
|
||||
(*it)->start();
|
||||
@ -485,12 +485,12 @@ void DSPDeviceSourceEngine::handleSetSource(DeviceSampleSource* source)
|
||||
// disconnect(m_sampleSource->getSampleFifo(), SIGNAL(dataReady()), this, SLOT(handleData()));
|
||||
// }
|
||||
|
||||
m_sampleSource = source;
|
||||
m_deviceSampleSource = source;
|
||||
|
||||
if(m_sampleSource != 0)
|
||||
if(m_deviceSampleSource != 0)
|
||||
{
|
||||
qDebug("DSPDeviceEngine::handleSetSource: set %s", qPrintable(source->getDeviceDescription()));
|
||||
connect(m_sampleSource->getSampleFifo(), SIGNAL(dataReady()), this, SLOT(handleData()), Qt::QueuedConnection);
|
||||
connect(m_deviceSampleSource->getSampleFifo(), SIGNAL(dataReady()), this, SLOT(handleData()), Qt::QueuedConnection);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -549,7 +549,7 @@ void DSPDeviceSourceEngine::handleSynchronousMessages()
|
||||
else if (DSPAddSink::match(*message))
|
||||
{
|
||||
BasebandSampleSink* sink = ((DSPAddSink*) message)->getSampleSink();
|
||||
m_sampleSinks.push_back(sink);
|
||||
m_basebandSampleSinks.push_back(sink);
|
||||
}
|
||||
else if (DSPRemoveSink::match(*message))
|
||||
{
|
||||
@ -559,19 +559,19 @@ void DSPDeviceSourceEngine::handleSynchronousMessages()
|
||||
sink->stop();
|
||||
}
|
||||
|
||||
m_sampleSinks.remove(sink);
|
||||
m_basebandSampleSinks.remove(sink);
|
||||
}
|
||||
else if (DSPAddThreadedSampleSink::match(*message))
|
||||
{
|
||||
ThreadedBasebandSampleSink *threadedSink = ((DSPAddThreadedSampleSink*) message)->getThreadedSampleSink();
|
||||
m_threadedSampleSinks.push_back(threadedSink);
|
||||
m_threadedBasebandSampleSinks.push_back(threadedSink);
|
||||
threadedSink->start();
|
||||
}
|
||||
else if (DSPRemoveThreadedSampleSink::match(*message))
|
||||
{
|
||||
ThreadedBasebandSampleSink* threadedSink = ((DSPRemoveThreadedSampleSink*) message)->getThreadedSampleSink();
|
||||
threadedSink->stop();
|
||||
m_threadedSampleSinks.remove(threadedSink);
|
||||
m_threadedBasebandSampleSinks.remove(threadedSink);
|
||||
}
|
||||
|
||||
m_syncMessenger.done(m_state);
|
||||
@ -622,13 +622,13 @@ void DSPDeviceSourceEngine::handleInputMessages()
|
||||
|
||||
// forward source changes to sinks with immediate execution
|
||||
|
||||
for(SampleSinks::const_iterator it = m_sampleSinks.begin(); it != m_sampleSinks.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();
|
||||
(*it)->handleMessage(*message);
|
||||
}
|
||||
|
||||
for (ThreadedSampleSinks::const_iterator it = m_threadedSampleSinks.begin(); it != m_threadedSampleSinks.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() << ")";
|
||||
(*it)->handleSinkMessage(*message);
|
||||
|
@ -88,14 +88,14 @@ private:
|
||||
QString m_errorMessage;
|
||||
QString m_deviceDescription;
|
||||
|
||||
DeviceSampleSource* m_sampleSource;
|
||||
DeviceSampleSource* m_deviceSampleSource;
|
||||
int m_sampleSourceSequence;
|
||||
|
||||
typedef std::list<BasebandSampleSink*> SampleSinks;
|
||||
SampleSinks m_sampleSinks; //!< sample sinks within main thread (usually spectrum, file output)
|
||||
typedef std::list<BasebandSampleSink*> BasebandSampleSinks;
|
||||
BasebandSampleSinks m_basebandSampleSinks; //!< sample sinks within main thread (usually spectrum, file output)
|
||||
|
||||
typedef std::list<ThreadedBasebandSampleSink*> ThreadedSampleSinks;
|
||||
ThreadedSampleSinks m_threadedSampleSinks; //!< sample sinks on their own threads (usually channels)
|
||||
typedef std::list<ThreadedBasebandSampleSink*> ThreadedBasebandSampleSinks;
|
||||
ThreadedBasebandSampleSinks m_threadedBasebandSampleSinks; //!< sample sinks on their own threads (usually channels)
|
||||
|
||||
uint m_sampleRate;
|
||||
quint64 m_centerFrequency;
|
||||
|
@ -64,18 +64,18 @@ void ThreadedBasebandSampleFifo::handleFifoData() // FIXME: Fixed? Move it to th
|
||||
}
|
||||
|
||||
ThreadedBasebandSampleSink::ThreadedBasebandSampleSink(BasebandSampleSink* sampleSink, QObject *parent) :
|
||||
m_sampleSink(sampleSink)
|
||||
m_basebandSampleSink(sampleSink)
|
||||
{
|
||||
QString name = "ThreadedSampleSink(" + m_sampleSink->objectName() + ")";
|
||||
QString name = "ThreadedSampleSink(" + m_basebandSampleSink->objectName() + ")";
|
||||
setObjectName(name);
|
||||
|
||||
qDebug() << "ThreadedSampleSink::ThreadedSampleSink: " << name;
|
||||
|
||||
m_thread = new QThread(parent);
|
||||
m_threadedSampleFifo = new ThreadedBasebandSampleFifo(m_sampleSink);
|
||||
m_threadedBasebandSampleFifo = new ThreadedBasebandSampleFifo(m_basebandSampleSink);
|
||||
//moveToThread(m_thread); // FIXME: Fixed? the intermediate FIFO should be handled within the sink. Define a new type of sink that is compatible with threading
|
||||
m_sampleSink->moveToThread(m_thread);
|
||||
m_threadedSampleFifo->moveToThread(m_thread);
|
||||
m_basebandSampleSink->moveToThread(m_thread);
|
||||
m_threadedBasebandSampleFifo->moveToThread(m_thread);
|
||||
//m_sampleFifo.moveToThread(m_thread);
|
||||
//connect(&m_sampleFifo, SIGNAL(dataReady()), this, SLOT(handleData()));
|
||||
//m_sampleFifo.setSize(262144);
|
||||
@ -85,7 +85,7 @@ ThreadedBasebandSampleSink::ThreadedBasebandSampleSink(BasebandSampleSink* sampl
|
||||
|
||||
ThreadedBasebandSampleSink::~ThreadedBasebandSampleSink()
|
||||
{
|
||||
delete m_threadedSampleFifo; // Valgrind memcheck
|
||||
delete m_threadedBasebandSampleFifo; // Valgrind memcheck
|
||||
delete m_thread;
|
||||
}
|
||||
|
||||
@ -93,13 +93,13 @@ void ThreadedBasebandSampleSink::start()
|
||||
{
|
||||
qDebug() << "ThreadedSampleSink::start";
|
||||
m_thread->start();
|
||||
m_sampleSink->start();
|
||||
m_basebandSampleSink->start();
|
||||
}
|
||||
|
||||
void ThreadedBasebandSampleSink::stop()
|
||||
{
|
||||
qDebug() << "ThreadedSampleSink::stop";
|
||||
m_sampleSink->stop();
|
||||
m_basebandSampleSink->stop();
|
||||
m_thread->exit();
|
||||
m_thread->wait();
|
||||
}
|
||||
@ -108,15 +108,15 @@ void ThreadedBasebandSampleSink::feed(SampleVector::const_iterator begin, Sample
|
||||
{
|
||||
//m_sampleSink->feed(begin, end, positiveOnly);
|
||||
//m_sampleFifo.write(begin, end);
|
||||
m_threadedSampleFifo->writeToFifo(begin, end);
|
||||
m_threadedBasebandSampleFifo->writeToFifo(begin, end);
|
||||
}
|
||||
|
||||
bool ThreadedBasebandSampleSink::handleSinkMessage(const Message& cmd)
|
||||
{
|
||||
return m_sampleSink->handleMessage(cmd);
|
||||
return m_basebandSampleSink->handleMessage(cmd);
|
||||
}
|
||||
|
||||
QString ThreadedBasebandSampleSink::getSampleSinkObjectName() const
|
||||
{
|
||||
return m_sampleSink->objectName();
|
||||
return m_basebandSampleSink->objectName();
|
||||
}
|
||||
|
@ -56,9 +56,9 @@ public:
|
||||
ThreadedBasebandSampleSink(BasebandSampleSink* sampleSink, QObject *parent = 0);
|
||||
~ThreadedBasebandSampleSink();
|
||||
|
||||
const BasebandSampleSink *getSink() const { return m_sampleSink; }
|
||||
MessageQueue* getInputMessageQueue() { return m_sampleSink->getInputMessageQueue(); } //!< Return pointer to sample sink's input message queue
|
||||
MessageQueue* getOutputMessageQueue() { return m_sampleSink->getOutputMessageQueue(); } //!< Return pointer to sample sink's output message queue
|
||||
const BasebandSampleSink *getSink() const { return m_basebandSampleSink; }
|
||||
MessageQueue* getInputMessageQueue() { return m_basebandSampleSink->getInputMessageQueue(); } //!< Return pointer to sample sink's input message queue
|
||||
MessageQueue* getOutputMessageQueue() { return m_basebandSampleSink->getOutputMessageQueue(); } //!< Return pointer to sample sink's output message queue
|
||||
|
||||
void start(); //!< this thread start()
|
||||
void stop(); //!< this thread exit() and wait()
|
||||
@ -71,8 +71,8 @@ public:
|
||||
protected:
|
||||
|
||||
QThread *m_thread; //!< The thead object
|
||||
ThreadedBasebandSampleFifo *m_threadedSampleFifo;
|
||||
BasebandSampleSink* m_sampleSink;
|
||||
ThreadedBasebandSampleFifo *m_threadedBasebandSampleFifo;
|
||||
BasebandSampleSink* m_basebandSampleSink;
|
||||
};
|
||||
|
||||
#endif // INCLUDE_THREADEDSAMPLESINK_H
|
||||
|
@ -13,7 +13,6 @@ class Preset;
|
||||
class MainWindow;
|
||||
class Message;
|
||||
class MessageQueue;
|
||||
class DSPDeviceSourceEngine;
|
||||
class DeviceAPI;
|
||||
|
||||
class SDRANGEL_API PluginManager : public QObject {
|
||||
|
Loading…
Reference in New Issue
Block a user