Fix loss of constellation when device restarted in M17 demod.

pull/1894/head
srcejon 2023-11-17 14:17:52 +00:00
rodzic 4178abe24b
commit 66351cff30
2 zmienionych plików z 13 dodań i 3 usunięć

Wyświetl plik

@ -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);
}
}

Wyświetl plik

@ -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;