mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-04 23:14:47 -04:00
MainWindow: Add FSMs to avoid blocking on the GUI thread.
DSPDevice*Engine: Add signals to indicate when commands have been processed. DSPDeviceSourceEngine: Fix small memory leak. DSPEngine::removeDeviceEngineAt: Remove wait to avoid blocking thread. Return QThread to get finished signal. DSPEngine::addDevice*Engine: Don't call deleteLater for device*Engine, as these objects are deleted manually in MainWindow, which will crash if deleteLater called first.
This commit is contained in:
@@ -52,7 +52,7 @@ DSPDeviceSourceEngine::DSPDeviceSourceEngine(uint uid, QObject* parent) :
|
||||
|
||||
DSPDeviceSourceEngine::~DSPDeviceSourceEngine()
|
||||
{
|
||||
qDebug("DSPDeviceSourceEngine::~DSPDeviceSourceEngine");
|
||||
qDebug("DSPDeviceSourceEngine::~DSPDeviceSourceEngine");
|
||||
}
|
||||
|
||||
void DSPDeviceSourceEngine::setState(State state)
|
||||
@@ -601,12 +601,15 @@ bool DSPDeviceSourceEngine::handleMessage(const Message& message)
|
||||
else if (DSPAcquisitionStop::match(message))
|
||||
{
|
||||
setState(gotoIdle());
|
||||
emit acquistionStopped();
|
||||
return true;
|
||||
}
|
||||
else if (DSPSetSource::match(message))
|
||||
{
|
||||
auto cmd = (const DSPSetSource&) message;
|
||||
handleSetSource(cmd.getSampleSource());
|
||||
emit sampleSet();
|
||||
return true;
|
||||
}
|
||||
else if (DSPAddBasebandSampleSink::match(message))
|
||||
{
|
||||
@@ -620,6 +623,7 @@ bool DSPDeviceSourceEngine::handleMessage(const Message& message)
|
||||
if(m_state == State::StRunning) {
|
||||
sink->start();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (DSPRemoveBasebandSampleSink::match(message))
|
||||
{
|
||||
@@ -631,6 +635,8 @@ bool DSPDeviceSourceEngine::handleMessage(const Message& message)
|
||||
}
|
||||
|
||||
m_basebandSampleSinks.remove(sink);
|
||||
emit sinkRemoved();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user