1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-10 10:33:29 -05:00

Remote Sink: GUI and REST API fixes

This commit is contained in:
f4exb 2019-12-12 23:49:19 +01:00
parent 30ddab77e3
commit 1e1cfba178
3 changed files with 26 additions and 0 deletions

View File

@ -122,6 +122,7 @@ bool RemoteSink::handleMessage(const Message& cmd)
DSPSignalNotification& notif = (DSPSignalNotification&) cmd; DSPSignalNotification& notif = (DSPSignalNotification&) cmd;
m_basebandSampleRate = notif.getSampleRate(); m_basebandSampleRate = notif.getSampleRate();
qDebug() << "RemoteSink::handleMessage: DSPSignalNotification: m_basebandSampleRate:" << m_basebandSampleRate; qDebug() << "RemoteSink::handleMessage: DSPSignalNotification: m_basebandSampleRate:" << m_basebandSampleRate;
calculateFrequencyOffset();
// Forward to the sink // Forward to the sink
DSPSignalNotification* msgToBaseband = new DSPSignalNotification(notif); // make a copy DSPSignalNotification* msgToBaseband = new DSPSignalNotification(notif); // make a copy
@ -176,6 +177,7 @@ void RemoteSink::applySettings(const RemoteSinkSettings& settings, bool force)
<< " force: " << force; << " force: " << force;
QList<QString> reverseAPIKeys; QList<QString> reverseAPIKeys;
bool frequencyOffsetChange = false;
if ((m_settings.m_nbFECBlocks != settings.m_nbFECBlocks) || force) { if ((m_settings.m_nbFECBlocks != settings.m_nbFECBlocks) || force) {
reverseAPIKeys.append("nbFECBlocks"); reverseAPIKeys.append("nbFECBlocks");
@ -189,6 +191,24 @@ void RemoteSink::applySettings(const RemoteSinkSettings& settings, bool force)
if ((m_settings.m_dataPort != settings.m_dataPort) || force) { if ((m_settings.m_dataPort != settings.m_dataPort) || force) {
reverseAPIKeys.append("dataPort"); 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) if (m_settings.m_streamIndex != settings.m_streamIndex)
{ {
@ -217,6 +237,10 @@ void RemoteSink::applySettings(const RemoteSinkSettings& settings, bool force)
} }
m_settings = settings; m_settings = settings;
if (frequencyOffsetChange) {
calculateFrequencyOffset();
}
} }
void RemoteSink::validateFilterChainHash(RemoteSinkSettings& settings) void RemoteSink::validateFilterChainHash(RemoteSinkSettings& settings)

View File

@ -107,6 +107,7 @@ public:
SWGSDRangel::SWGChannelSettings& response); SWGSDRangel::SWGChannelSettings& response);
uint32_t getNumberOfDeviceStreams() const; uint32_t getNumberOfDeviceStreams() const;
int getBasebandSampleRate() const { return m_basebandSampleRate; }
static const QString m_channelIdURI; static const QString m_channelIdURI;
static const QString m_channelId; static const QString m_channelId;

View File

@ -125,6 +125,7 @@ RemoteSinkGUI::RemoteSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
m_remoteSink = (RemoteSink*) channelrx; m_remoteSink = (RemoteSink*) channelrx;
m_remoteSink->setMessageQueueToGUI(getInputMessageQueue()); m_remoteSink->setMessageQueueToGUI(getInputMessageQueue());
m_basebandSampleRate = m_remoteSink->getBasebandSampleRate();
m_channelMarker.blockSignals(true); m_channelMarker.blockSignals(true);
m_channelMarker.setColor(m_settings.m_rgbColor); m_channelMarker.setColor(m_settings.m_rgbColor);