1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-03 06:24:48 -04:00

Fixed threading model for DSPDeviceMIMOEngine plus other fixes. Part of #2159

This commit is contained in:
f4exb
2024-08-17 11:24:19 +02:00
committed by Edouard Griffiths
parent beaf2932ba
commit 290023183c
7 changed files with 109 additions and 116 deletions
+4 -29
View File
@@ -41,7 +41,7 @@ MESSAGE_CLASS_DEFINITION(DSPDeviceMIMOEngine::ConfigureCorrection, Message)
MESSAGE_CLASS_DEFINITION(DSPDeviceMIMOEngine::SetSpectrumSinkInput, Message)
DSPDeviceMIMOEngine::DSPDeviceMIMOEngine(uint32_t uid, QObject* parent) :
QThread(parent),
QObject(parent),
m_uid(uid),
m_stateRx(StNotStarted),
m_stateTx(StNotStarted),
@@ -49,15 +49,14 @@ DSPDeviceMIMOEngine::DSPDeviceMIMOEngine(uint32_t uid, QObject* parent) :
m_spectrumInputSourceElseSink(true),
m_spectrumInputIndex(0)
{
setStateRx(StIdle);
setStateTx(StIdle);
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
moveToThread(this);
}
DSPDeviceMIMOEngine::~DSPDeviceMIMOEngine()
{
stop();
wait();
qDebug("DSPDeviceMIMOEngine::~DSPDeviceMIMOEngine");
}
void DSPDeviceMIMOEngine::setStateRx(State state)
@@ -78,30 +77,6 @@ void DSPDeviceMIMOEngine::setStateTx(State state)
}
}
void DSPDeviceMIMOEngine::run()
{
qDebug() << "DSPDeviceMIMOEngine::run";
setStateRx(StIdle);
setStateTx(StIdle);
exec();
}
void DSPDeviceMIMOEngine::start()
{
qDebug() << "DSPDeviceMIMOEngine::start";
QThread::start();
}
void DSPDeviceMIMOEngine::stop()
{
qDebug() << "DSPDeviceMIMOEngine::stop";
gotoIdle(0); // Rx
gotoIdle(1); // Tx
setStateRx(StNotStarted);
setStateTx(StNotStarted);
QThread::exit();
}
bool DSPDeviceMIMOEngine::initProcess(int subsystemIndex)
{
qDebug() << "DSPDeviceMIMOEngine::initProcess: subsystemIndex: " << subsystemIndex;