Skip to content

Commit

Permalink
Save scope sink pointer for when baseband is recreated.
Browse files Browse the repository at this point in the history
  • Loading branch information
srcejon committed Nov 9, 2023
1 parent 8337e2c commit 27f35fe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion plugins/channelrx/demoddsd/dsddemod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ DSDDemod::DSDDemod(DeviceAPI *deviceAPI) :
ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink),
m_deviceAPI(deviceAPI),
m_running(false),
m_basebandSampleRate(0)
m_basebandSampleRate(0),
m_scopeXYSink(nullptr)
{
qDebug("DSDDemod::DSDDemod");
setObjectName(m_channelId);
Expand Down Expand Up @@ -175,6 +176,7 @@ void DSDDemod::start()
if (m_basebandSampleRate != 0) {
m_basebandSink->setBasebandSampleRate(m_basebandSampleRate);
}
m_basebandSink->setScopeXYSink(m_scopeXYSink);

m_thread->start();

Expand All @@ -198,6 +200,14 @@ void DSDDemod::stop()
m_thread->wait();
}

void DSDDemod::setScopeXYSink(BasebandSampleSink* sampleSink)
{
m_scopeXYSink = sampleSink;
if (m_running) {
m_basebandSink->setScopeXYSink(sampleSink);
}
}

bool DSDDemod::handleMessage(const Message& cmd)
{
qDebug() << "DSDDemod::handleMessage";
Expand Down
4 changes: 2 additions & 2 deletions plugins/channelrx/demoddsd/dsddemod.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class DSDDemod : 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 @@ -186,7 +186,7 @@ class DSDDemod : public BasebandSampleSink, public ChannelAPI {
DSDDemodSettings m_settings;
int m_basebandSampleRate; //!< stored from device message used when starting baseband sink
QHash<Feature*, DSDDemodSettings::AvailableAMBEFeature> m_availableAMBEFeatures;

BasebandSampleSink *m_scopeXYSink;
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;

Expand Down

0 comments on commit 27f35fe

Please sign in to comment.