1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 22:14:45 -04:00

Message pipes rework: settings pipes change in other plugins

This commit is contained in:
f4exb
2022-03-02 23:07:15 +01:00
parent 283ab64c59
commit cbe643c0b1
66 changed files with 731 additions and 557 deletions
@@ -155,10 +155,11 @@ void Interferometer::applySettings(const InterferometerSettings& settings, bool
m_basebandSink->setPhase(settings.m_phase);
}
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;
@@ -463,24 +464,27 @@ void Interferometer::webapiReverseSendSettings(QList<QString>& channelSettingsKe
}
void Interferometer::sendChannelSettings(
QList<MessageQueue*> *messageQueues,
const QList<ObjectPipe*>& pipes,
QList<QString>& channelSettingsKeys,
const InterferometerSettings& 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);
}
}
}