From e9c8dad6633a6d0d0b7bab307e79a6b914ba9e91 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 14 Feb 2018 17:33:08 +0100 Subject: [PATCH] Fixed DSP device source/sink run command --- sdrbase/dsp/dspcommands.cpp | 1 - sdrbase/dsp/dspcommands.h | 4 ---- sdrbase/dsp/dspdevicesinkengine.cpp | 11 +---------- sdrbase/dsp/dspdevicesourceengine.cpp | 13 ++----------- 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/sdrbase/dsp/dspcommands.cpp b/sdrbase/dsp/dspcommands.cpp index e69838fe3..1c15142d1 100644 --- a/sdrbase/dsp/dspcommands.cpp +++ b/sdrbase/dsp/dspcommands.cpp @@ -17,7 +17,6 @@ #include "dsp/dspcommands.h" -MESSAGE_CLASS_DEFINITION(DSPExit, Message) MESSAGE_CLASS_DEFINITION(DSPAcquisitionInit, Message) MESSAGE_CLASS_DEFINITION(DSPAcquisitionStart, Message) MESSAGE_CLASS_DEFINITION(DSPAcquisitionStop, Message) diff --git a/sdrbase/dsp/dspcommands.h b/sdrbase/dsp/dspcommands.h index ae522bea9..7ba24a242 100644 --- a/sdrbase/dsp/dspcommands.h +++ b/sdrbase/dsp/dspcommands.h @@ -31,10 +31,6 @@ class BasebandSampleSource; class ThreadedBasebandSampleSource; class AudioFifo; -class SDRANGEL_API DSPExit : public Message { - MESSAGE_CLASS_DECLARATION -}; - class SDRANGEL_API DSPAcquisitionInit : public Message { MESSAGE_CLASS_DECLARATION }; diff --git a/sdrbase/dsp/dspdevicesinkengine.cpp b/sdrbase/dsp/dspdevicesinkengine.cpp index 89d58fb89..1098770c5 100644 --- a/sdrbase/dsp/dspdevicesinkengine.cpp +++ b/sdrbase/dsp/dspdevicesinkengine.cpp @@ -55,10 +55,7 @@ DSPDeviceSinkEngine::~DSPDeviceSinkEngine() void DSPDeviceSinkEngine::run() { qDebug() << "DSPDeviceSinkEngine::run"; - m_state = StIdle; - - m_syncMessenger.done(); // Release start() that is waiting in main thread exec(); } @@ -430,13 +427,7 @@ void DSPDeviceSinkEngine::handleSynchronousMessages() Message *message = m_syncMessenger.getMessage(); qDebug() << "DSPDeviceSinkEngine::handleSynchronousMessages: " << message->getIdentifier(); - if (DSPExit::match(*message)) - { - gotoIdle(); - m_state = StNotStarted; - exit(); - } - else if (DSPGenerationInit::match(*message)) + if (DSPGenerationInit::match(*message)) { m_state = gotoIdle(); diff --git a/sdrbase/dsp/dspdevicesourceengine.cpp b/sdrbase/dsp/dspdevicesourceengine.cpp index 6a64e5202..f07ae80a7 100644 --- a/sdrbase/dsp/dspdevicesourceengine.cpp +++ b/sdrbase/dsp/dspdevicesourceengine.cpp @@ -59,11 +59,8 @@ DSPDeviceSourceEngine::~DSPDeviceSourceEngine() void DSPDeviceSourceEngine::run() { qDebug() << "DSPDeviceSourceEngine::run"; - m_state = StIdle; - - m_syncMessenger.done(); // Release start() that is waiting in main thread - exec(); + exec(); } void DSPDeviceSourceEngine::start() @@ -612,13 +609,7 @@ void DSPDeviceSourceEngine::handleSynchronousMessages() Message *message = m_syncMessenger.getMessage(); qDebug() << "DSPDeviceSourceEngine::handleSynchronousMessages: " << message->getIdentifier(); - if (DSPExit::match(*message)) - { - gotoIdle(); - m_state = StNotStarted; - exit(); - } - else if (DSPAcquisitionInit::match(*message)) + if (DSPAcquisitionInit::match(*message)) { m_state = gotoIdle();