From 1e1cfba17870a0bf3834af1724a127bfa6562f59 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 12 Dec 2019 23:49:19 +0100 Subject: [PATCH] Remote Sink: GUI and REST API fixes --- plugins/channelrx/remotesink/remotesink.cpp | 24 +++++++++++++++++++ plugins/channelrx/remotesink/remotesink.h | 1 + .../channelrx/remotesink/remotesinkgui.cpp | 1 + 3 files changed, 26 insertions(+) diff --git a/plugins/channelrx/remotesink/remotesink.cpp b/plugins/channelrx/remotesink/remotesink.cpp index 30b35860f..4891ea318 100644 --- a/plugins/channelrx/remotesink/remotesink.cpp +++ b/plugins/channelrx/remotesink/remotesink.cpp @@ -122,6 +122,7 @@ bool RemoteSink::handleMessage(const Message& cmd) DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); qDebug() << "RemoteSink::handleMessage: DSPSignalNotification: m_basebandSampleRate:" << m_basebandSampleRate; + calculateFrequencyOffset(); // Forward to the sink DSPSignalNotification* msgToBaseband = new DSPSignalNotification(notif); // make a copy @@ -176,6 +177,7 @@ void RemoteSink::applySettings(const RemoteSinkSettings& settings, bool force) << " force: " << force; QList reverseAPIKeys; + bool frequencyOffsetChange = false; if ((m_settings.m_nbFECBlocks != settings.m_nbFECBlocks) || force) { reverseAPIKeys.append("nbFECBlocks"); @@ -189,6 +191,24 @@ void RemoteSink::applySettings(const RemoteSinkSettings& settings, bool force) if ((m_settings.m_dataPort != settings.m_dataPort) || force) { reverseAPIKeys.append("dataPort"); } + if ((m_settings.m_rgbColor != settings.m_rgbColor) || force) { + reverseAPIKeys.append("rgbColor"); + } + if ((m_settings.m_title != settings.m_title) || force) { + reverseAPIKeys.append("title"); + } + + if ((m_settings.m_log2Decim != settings.m_log2Decim) || force) + { + reverseAPIKeys.append("log2Decim"); + frequencyOffsetChange = true; + } + + if ((m_settings.m_filterChainHash != settings.m_filterChainHash) || force) + { + reverseAPIKeys.append("filterChainHash"); + frequencyOffsetChange = true; + } if (m_settings.m_streamIndex != settings.m_streamIndex) { @@ -217,6 +237,10 @@ void RemoteSink::applySettings(const RemoteSinkSettings& settings, bool force) } m_settings = settings; + + if (frequencyOffsetChange) { + calculateFrequencyOffset(); + } } void RemoteSink::validateFilterChainHash(RemoteSinkSettings& settings) diff --git a/plugins/channelrx/remotesink/remotesink.h b/plugins/channelrx/remotesink/remotesink.h index b2c41b758..cf56dd346 100644 --- a/plugins/channelrx/remotesink/remotesink.h +++ b/plugins/channelrx/remotesink/remotesink.h @@ -107,6 +107,7 @@ public: SWGSDRangel::SWGChannelSettings& response); uint32_t getNumberOfDeviceStreams() const; + int getBasebandSampleRate() const { return m_basebandSampleRate; } static const QString m_channelIdURI; static const QString m_channelId; diff --git a/plugins/channelrx/remotesink/remotesinkgui.cpp b/plugins/channelrx/remotesink/remotesinkgui.cpp index 123e75b00..2447a1a19 100644 --- a/plugins/channelrx/remotesink/remotesinkgui.cpp +++ b/plugins/channelrx/remotesink/remotesinkgui.cpp @@ -125,6 +125,7 @@ RemoteSinkGUI::RemoteSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas m_remoteSink = (RemoteSink*) channelrx; m_remoteSink->setMessageQueueToGUI(getInputMessageQueue()); + m_basebandSampleRate = m_remoteSink->getBasebandSampleRate(); m_channelMarker.blockSignals(true); m_channelMarker.setColor(m_settings.m_rgbColor);