Skip to content

Commit

Permalink
Fix loss of constellation when device restarted in M17 demod.
Browse files Browse the repository at this point in the history
  • Loading branch information
srcejon committed Nov 17, 2023
1 parent 4178abe commit 66351cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion plugins/channelrx/demodm17/m17demod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}
}
4 changes: 2 additions & 2 deletions plugins/channelrx/demodm17/m17demod.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class M17Demod : public BasebandSampleSink, public ChannelAPI {
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(); }
Expand Down Expand Up @@ -281,7 +281,7 @@ class M17Demod : public BasebandSampleSink, public ChannelAPI {
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;

Expand Down

0 comments on commit 66351cf

Please sign in to comment.