mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-05 07:24:44 -04:00
AFC: implemented message pipes for sending back channel settings. Implemented in all relevant channel plugins. Removed obsolete methods
This commit is contained in:
@@ -162,8 +162,10 @@ void Interferometer::applySettings(const InterferometerSettings& settings, bool
|
||||
m_basebandSink->setPhase(settings.m_phase);
|
||||
}
|
||||
|
||||
if (m_featuresSettingsFeedback.size() > 0) {
|
||||
featuresSendSettings(reverseAPIKeys, settings, force);
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings");
|
||||
|
||||
if (messageQueues) {
|
||||
sendChannelSettings(messageQueues, reverseAPIKeys, settings, force);
|
||||
}
|
||||
|
||||
m_settings = settings;
|
||||
@@ -399,31 +401,25 @@ void Interferometer::webapiReverseSendSettings(QList<QString>& channelSettingsKe
|
||||
delete swgChannelSettings;
|
||||
}
|
||||
|
||||
void Interferometer::featuresSendSettings(QList<QString>& channelSettingsKeys, const InterferometerSettings& settings, bool force)
|
||||
void Interferometer::sendChannelSettings(
|
||||
QList<MessageQueue*> *messageQueues,
|
||||
QList<QString>& channelSettingsKeys,
|
||||
const InterferometerSettings& settings,
|
||||
bool force)
|
||||
{
|
||||
QList<Feature*>::iterator it = m_featuresSettingsFeedback.begin();
|
||||
MainCore *mainCore = MainCore::instance();
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != m_featuresSettingsFeedback.end(); ++it)
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
{
|
||||
if (mainCore->existsFeature(*it))
|
||||
{
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
|
||||
|
||||
Feature::MsgChannelSettings *msg = Feature::MsgChannelSettings::create(
|
||||
this,
|
||||
channelSettingsKeys,
|
||||
swgChannelSettings,
|
||||
force
|
||||
);
|
||||
|
||||
(*it)->getInputMessageQueue()->push(msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_featuresSettingsFeedback.removeOne(*it);
|
||||
}
|
||||
SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings();
|
||||
webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force);
|
||||
MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create(
|
||||
this,
|
||||
channelSettingsKeys,
|
||||
swgChannelSettings,
|
||||
force
|
||||
);
|
||||
(*it)->push(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user