mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-02 14:04:46 -04:00
Fixed threading model for DSPDeviceSourceEngine. Part of #2159
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
#include "samplesinkfifo.h"
|
||||
|
||||
DSPDeviceSourceEngine::DSPDeviceSourceEngine(uint uid, QObject* parent) :
|
||||
QThread(parent),
|
||||
QObject(parent),
|
||||
m_uid(uid),
|
||||
m_state(StNotStarted),
|
||||
m_deviceSampleSource(nullptr),
|
||||
@@ -46,15 +46,12 @@ DSPDeviceSourceEngine::DSPDeviceSourceEngine(uint uid, QObject* parent) :
|
||||
m_qRange(1 << 16),
|
||||
m_imbalance(65536)
|
||||
{
|
||||
setState(StIdle);
|
||||
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
|
||||
|
||||
moveToThread(this);
|
||||
}
|
||||
|
||||
DSPDeviceSourceEngine::~DSPDeviceSourceEngine()
|
||||
{
|
||||
stop();
|
||||
wait();
|
||||
}
|
||||
|
||||
void DSPDeviceSourceEngine::setState(State state)
|
||||
@@ -66,27 +63,6 @@ void DSPDeviceSourceEngine::setState(State state)
|
||||
}
|
||||
}
|
||||
|
||||
void DSPDeviceSourceEngine::run()
|
||||
{
|
||||
qDebug("DSPDeviceSourceEngine::run");
|
||||
setState(StIdle);
|
||||
exec();
|
||||
}
|
||||
|
||||
void DSPDeviceSourceEngine::start()
|
||||
{
|
||||
qDebug("DSPDeviceSourceEngine::start");
|
||||
QThread::start();
|
||||
}
|
||||
|
||||
void DSPDeviceSourceEngine::stop()
|
||||
{
|
||||
qDebug("DSPDeviceSourceEngine::stop");
|
||||
gotoIdle();
|
||||
setState(StNotStarted);
|
||||
QThread::exit();
|
||||
}
|
||||
|
||||
bool DSPDeviceSourceEngine::initAcquisition()
|
||||
{
|
||||
qDebug("DSPDeviceSourceEngine::initAcquisition (dummy)");
|
||||
|
||||
Reference in New Issue
Block a user