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

LimeSDR: set buddy configuration from the source or sink and not from the GUI

This commit is contained in:
f4exb
2017-09-18 01:05:08 +02:00
parent d59d2a2372
commit b5a7a65d85
6 changed files with 74 additions and 90 deletions
@@ -33,7 +33,6 @@
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgConfigureLimeSDR, Message)
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgGetStreamInfo, Message)
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgGetDeviceInfo, Message)
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgSetReferenceConfig, Message)
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgReportLimeSDRToBuddy, Message)
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgReportStreamInfo, Message)
MESSAGE_CLASS_DEFINITION(LimeSDRInput::MsgFileRecord, Message)
@@ -410,13 +409,20 @@ bool LimeSDRInput::handleMessage(const Message& message)
return true;
}
else if (MsgSetReferenceConfig::match(message))
else if (MsgReportLimeSDRToBuddy::match(message))
{
MsgSetReferenceConfig& conf = (MsgSetReferenceConfig&) message;
qDebug() << "LimeSDRInput::handleMessage: MsgSetReferenceConfig";
m_settings = conf.getSettings();
m_deviceShared.m_ncoFrequency = m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0; // for buddies
m_deviceShared.m_centerFrequency = m_settings.m_centerFrequency; // for buddies
MsgReportLimeSDRToBuddy& conf = (MsgReportLimeSDRToBuddy&) message;
m_settings.m_centerFrequency = conf.getCenterFrequency();
m_settings.m_devSampleRate = conf.getSampleRate();
m_settings.m_log2HardDecim = conf.getLog2HardDecim();
return true;
}
else if (DeviceLimeSDRShared::MsgCrossReportToBuddy::match(message))
{
DeviceLimeSDRShared::MsgCrossReportToBuddy& conf = (DeviceLimeSDRShared::MsgCrossReportToBuddy&) message;
m_settings.m_devSampleRate = conf.getSampleRate();
return true;
}
else if (MsgGetStreamInfo::match(message))
@@ -1080,14 +1086,18 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
m_settings.m_centerFrequency + buddyNCOFreq);
(*itSource)->getDeviceEngineInputMessageQueue()->push(notif);
MsgReportLimeSDRToBuddy *report = MsgReportLimeSDRToBuddy::create(
m_settings.m_centerFrequency,
m_settings.m_devSampleRate,
m_settings.m_log2HardDecim);
if ((*itSource)->getSampleSourceGUIMessageQueue())
{
MsgReportLimeSDRToBuddy *report = MsgReportLimeSDRToBuddy::create(
m_settings.m_centerFrequency,
m_settings.m_devSampleRate,
m_settings.m_log2HardDecim);
(*itSource)->getSampleSourceGUIMessageQueue()->push(report);
MsgReportLimeSDRToBuddy *reportToGUI = new MsgReportLimeSDRToBuddy(*report);
(*itSource)->getSampleSourceGUIMessageQueue()->push(reportToGUI);
}
(*itSource)->getSampleSourceInputMessageQueue()->push(report);
}
// send to sink buddies
@@ -1105,11 +1115,15 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
buddyCenterFreq + buddyNCOFreq); // do not change center frequency
(*itSink)->getDeviceEngineInputMessageQueue()->push(notif);
DeviceLimeSDRShared::MsgCrossReportToBuddy *report = DeviceLimeSDRShared::MsgCrossReportToBuddy::create(m_settings.m_devSampleRate);
if ((*itSink)->getSampleSinkGUIMessageQueue())
{
DeviceLimeSDRShared::MsgCrossReportToBuddy *report = DeviceLimeSDRShared::MsgCrossReportToBuddy::create(m_settings.m_devSampleRate);
(*itSink)->getSampleSinkGUIMessageQueue()->push(report);
DeviceLimeSDRShared::MsgCrossReportToBuddy *reportToGUI = new DeviceLimeSDRShared::MsgCrossReportToBuddy(*report);
(*itSink)->getSampleSinkGUIMessageQueue()->push(reportToGUI);
}
(*itSink)->getSampleSinkInputMessageQueue()->push(report);
}
}
else if (forwardChangeRxDSP)
@@ -1134,14 +1148,18 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency + buddyNCOFreq);
(*itSource)->getDeviceEngineInputMessageQueue()->push(notif);
MsgReportLimeSDRToBuddy *report = MsgReportLimeSDRToBuddy::create(
m_settings.m_centerFrequency,
m_settings.m_devSampleRate,
m_settings.m_log2HardDecim);
if ((*itSource)->getSampleSourceGUIMessageQueue())
{
MsgReportLimeSDRToBuddy *report = MsgReportLimeSDRToBuddy::create(
m_settings.m_centerFrequency,
m_settings.m_devSampleRate,
m_settings.m_log2HardDecim);
(*itSource)->getSampleSourceGUIMessageQueue()->push(report);
MsgReportLimeSDRToBuddy *reportToGUI = new MsgReportLimeSDRToBuddy(*report);
(*itSource)->getSampleSourceGUIMessageQueue()->push(reportToGUI);
}
(*itSource)->getSampleSourceInputMessageQueue()->push(report);
}
}
else if (forwardChangeOwnDSP)
@@ -52,26 +52,6 @@ public:
{ }
};
class MsgSetReferenceConfig : public Message {
MESSAGE_CLASS_DECLARATION
public:
const LimeSDRInputSettings& getSettings() const { return m_settings; }
static MsgSetReferenceConfig* create(const LimeSDRInputSettings& settings)
{
return new MsgSetReferenceConfig(settings);
}
private:
LimeSDRInputSettings m_settings;
MsgSetReferenceConfig(const LimeSDRInputSettings& settings) :
Message(),
m_settings(settings)
{ }
};
class MsgGetStreamInfo : public Message {
MESSAGE_CLASS_DECLARATION
@@ -151,9 +151,6 @@ bool LimeSDRInputGUI::handleMessage(const Message& message)
displaySettings();
blockApplySettings(false);
LimeSDRInput::MsgSetReferenceConfig* conf = LimeSDRInput::MsgSetReferenceConfig::create(m_settings);
m_sampleSource->getInputMessageQueue()->push(conf); // TODO: remove from here should be done device to device
return true;
}
else if (DeviceLimeSDRShared::MsgCrossReportToBuddy::match(message))
@@ -165,9 +162,6 @@ bool LimeSDRInputGUI::handleMessage(const Message& message)
displaySettings();
blockApplySettings(false);
LimeSDRInput::MsgSetReferenceConfig* conf = LimeSDRInput::MsgSetReferenceConfig::create(m_settings);
m_sampleSource->getInputMessageQueue()->push(conf);
return true;
}
else if (LimeSDRInput::MsgReportStreamInfo::match(message))