From 66351cff306cace0ef8b8f999af4933a47b2d20a Mon Sep 17 00:00:00 2001 From: srcejon Date: Fri, 17 Nov 2023 14:17:52 +0000 Subject: [PATCH] Fix loss of constellation when device restarted in M17 demod. --- plugins/channelrx/demodm17/m17demod.cpp | 12 +++++++++++- plugins/channelrx/demodm17/m17demod.h | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/plugins/channelrx/demodm17/m17demod.cpp b/plugins/channelrx/demodm17/m17demod.cpp index 28bc1397e..2b893b9ba 100644 --- a/plugins/channelrx/demodm17/m17demod.cpp +++ b/plugins/channelrx/demodm17/m17demod.cpp @@ -57,7 +57,8 @@ M17Demod::M17Demod(DeviceAPI *deviceAPI) : m_thread(nullptr), m_basebandSink(nullptr), m_running(false), - m_basebandSampleRate(0) + m_basebandSampleRate(0), + m_scopeXYSink(nullptr) { qDebug("M17Demod::M17Demod"); setObjectName(m_channelId); @@ -141,6 +142,7 @@ void M17Demod::start() if (m_basebandSampleRate != 0) { m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); } + m_basebandSink->setScopeXYSink(m_scopeXYSink); m_basebandSink->reset(); m_thread->start(); @@ -751,3 +753,11 @@ void M17Demod::handleIndexInDeviceSetChanged(int index) m_basebandSink->setFifoLabel(fifoLabel); m_basebandSink->setAudioFifoLabel(fifoLabel); } + +void M17Demod::setScopeXYSink(BasebandSampleSink* sampleSink) +{ + m_scopeXYSink = sampleSink; + if (m_running) { + m_basebandSink->setScopeXYSink(sampleSink); + } +} diff --git a/plugins/channelrx/demodm17/m17demod.h b/plugins/channelrx/demodm17/m17demod.h index 80fe33f79..553e67046 100644 --- a/plugins/channelrx/demodm17/m17demod.h +++ b/plugins/channelrx/demodm17/m17demod.h @@ -209,7 +209,7 @@ public: SWGSDRangel::SWGChannelSettings& response); uint32_t getNumberOfDeviceStreams() const; - void setScopeXYSink(BasebandSampleSink* sampleSink) { if (m_running) { m_basebandSink->setScopeXYSink(sampleSink); } } + void setScopeXYSink(BasebandSampleSink* sampleSink); void configureMyPosition(float myLatitude, float myLongitude) { if (m_running) { m_basebandSink->configureMyPosition(myLatitude, myLongitude); } } double getMagSq() { return m_running ? m_basebandSink->getMagSq() : 0.0; } bool getSquelchOpen() const { return m_running && m_basebandSink->getSquelchOpen(); } @@ -281,7 +281,7 @@ private: bool m_running; M17DemodSettings m_settings; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink - + BasebandSampleSink *m_scopeXYSink; QNetworkAccessManager *m_networkManager; QNetworkRequest m_networkRequest;