1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-14 15:33:34 -04:00

Message pipes rework: settings pipes change in AFC, SSB demod, Frequency tracker

This commit is contained in:
f4exb
2022-03-02 06:58:54 +01:00
parent 1c5a777709
commit 283ab64c59
6 changed files with 88 additions and 44 deletions
+20 -16
View File
@@ -274,10 +274,11 @@ void FreqTracker::applySettings(const FreqTrackerSettings& settings, bool force)
webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
}
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings");
QList<ObjectPipe*> pipes;
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes);
if (messageQueues) {
sendChannelSettings(messageQueues, reverseAPIKeys, settings, force);
if (pipes.size() > 0) {
sendChannelSettings(pipes, reverseAPIKeys, settings, force);
}
m_settings = settings;
@@ -551,24 +552,27 @@ void FreqTracker::webapiReverseSendSettings(QList<QString>& channelSettingsKeys,
}
void FreqTracker::sendChannelSettings(
QList<MessageQueue*> *messageQueues,
const QList<ObjectPipe*>& pipes,
QList<QString>& channelSettingsKeys,
const FreqTrackerSettings& settings,
bool force)
{
QList<MessageQueue*>::iterator it = messageQueues->begin();
for (; it != messageQueues->end(); ++it)
for (const auto& pipe : pipes)
{
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create(
this,
channelSettingsKeys,
swgChannelSettings,
force
);
(*it)->push(msg);
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
if (messageQueue)
{
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create(
this,
channelSettingsKeys,
swgChannelSettings,
force
);
messageQueue->push(msg);
}
}
}