mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 01:55:48 -05:00
LimeSDR: Rx/Tx interaction
This commit is contained in:
parent
73d9cfec6e
commit
d1061a3c2f
@ -16,5 +16,7 @@
|
||||
|
||||
#include "deviceplutosdrshared.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(DevicePlutoSDRShared::MsgCrossReportToBuddy, Message)
|
||||
|
||||
const float DevicePlutoSDRShared::m_sampleFifoLengthInSeconds = 0.25;
|
||||
const int DevicePlutoSDRShared::m_sampleFifoMinSize = 48000; // 192kS/s knee
|
||||
|
@ -48,34 +48,40 @@ public:
|
||||
uint32_t getLpfFirbw() const { return m_lpfFIRBW; }
|
||||
bool isLpfFirEnable() const { return m_lpfFIREnable; }
|
||||
uint32_t getLpfFiRlog2IntDec() const { return m_lpfFIRlogIntDec; }
|
||||
int32_t getLoPPMTenths() const { return m_loPPMTenths; }
|
||||
|
||||
static MsgCrossReportToBuddy *create(uint64_t devSampleRate,
|
||||
bool lpfFIREnable,
|
||||
uint32_t lpfFIRlog2Interp,
|
||||
uint32_t lpfFIRBW)
|
||||
uint32_t lpfFIRBW,
|
||||
int32_t loPPMTenths)
|
||||
{
|
||||
return new MsgCrossReportToBuddy(devSampleRate,
|
||||
lpfFIREnable,
|
||||
lpfFIRlog2Interp,
|
||||
lpfFIRBW);
|
||||
lpfFIRBW,
|
||||
loPPMTenths);
|
||||
}
|
||||
|
||||
private:
|
||||
MsgCrossReportToBuddy(uint64_t devSampleRate,
|
||||
bool lpfFIREnable,
|
||||
uint32_t lpfFIRlog2IntDec,
|
||||
uint32_t lpfFIRBW) :
|
||||
uint32_t lpfFIRBW,
|
||||
int32_t loPPMTenths) :
|
||||
Message(),
|
||||
m_devSampleRate(devSampleRate),
|
||||
m_lpfFIREnable(lpfFIREnable),
|
||||
m_lpfFIRlogIntDec(lpfFIRlog2IntDec),
|
||||
m_lpfFIRBW(lpfFIRBW)
|
||||
m_lpfFIRBW(lpfFIRBW),
|
||||
m_loPPMTenths(loPPMTenths)
|
||||
{ }
|
||||
|
||||
uint64_t m_devSampleRate;
|
||||
bool m_lpfFIREnable;
|
||||
uint32_t m_lpfFIRlogIntDec;
|
||||
uint32_t m_lpfFIRBW;
|
||||
int32_t m_loPPMTenths;
|
||||
};
|
||||
|
||||
DevicePlutoSDRParams *m_deviceParams; //!< unique hardware device parameters
|
||||
|
@ -128,6 +128,17 @@ bool PlutoSDROutput::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (DevicePlutoSDRShared::MsgCrossReportToBuddy::match(message)) // message from buddy
|
||||
{
|
||||
DevicePlutoSDRShared::MsgCrossReportToBuddy& conf = (DevicePlutoSDRShared::MsgCrossReportToBuddy&) message;
|
||||
m_settings.m_devSampleRate = conf.getDevSampleRate();
|
||||
m_settings.m_lpfFIRlog2Interp = conf.getLpfFiRlog2IntDec();
|
||||
m_settings.m_lpfFIRBW = conf.getLpfFirbw();
|
||||
m_settings.m_LOppmTenths = conf.getLoPPMTenths();
|
||||
PlutoSDROutputSettings newSettings = m_settings;
|
||||
newSettings.m_lpfFIREnable = conf.isLpfFirEnable();
|
||||
applySettings(newSettings);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
@ -391,6 +402,27 @@ bool PlutoSDROutput::applySettings(const PlutoSDROutputSettings& settings, bool
|
||||
if (forwardChangeOtherDSP)
|
||||
{
|
||||
qDebug("PlutoSDROutput::applySettings: forwardChangeOtherDSP");
|
||||
|
||||
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
|
||||
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
|
||||
|
||||
for (; itSource != sourceBuddies.end(); ++itSource)
|
||||
{
|
||||
DevicePlutoSDRShared::MsgCrossReportToBuddy *msg = DevicePlutoSDRShared::MsgCrossReportToBuddy::create(
|
||||
settings.m_devSampleRate,
|
||||
settings.m_lpfFIREnable,
|
||||
settings.m_lpfFIRlog2Interp,
|
||||
settings.m_lpfFIRBW,
|
||||
settings.m_LOppmTenths);
|
||||
|
||||
if ((*itSource)->getSampleSourceGUIMessageQueue())
|
||||
{
|
||||
DevicePlutoSDRShared::MsgCrossReportToBuddy *msgToGUI = new DevicePlutoSDRShared::MsgCrossReportToBuddy(*msg);
|
||||
(*itSource)->getSampleSourceGUIMessageQueue()->push(msgToGUI);
|
||||
}
|
||||
|
||||
(*itSource)->getSampleSourceInputMessageQueue()->push(msg);
|
||||
}
|
||||
}
|
||||
|
||||
if (forwardChangeOwnDSP)
|
||||
|
@ -130,7 +130,24 @@ bool PlutoSDROutputGUI::deserialize(const QByteArray& data)
|
||||
|
||||
bool PlutoSDROutputGUI::handleMessage(const Message& message __attribute__((unused)))
|
||||
{
|
||||
return false;
|
||||
if (DevicePlutoSDRShared::MsgCrossReportToBuddy::match(message)) // message from buddy
|
||||
{
|
||||
DevicePlutoSDRShared::MsgCrossReportToBuddy& conf = (DevicePlutoSDRShared::MsgCrossReportToBuddy&) message;
|
||||
m_settings.m_devSampleRate = conf.getDevSampleRate();
|
||||
m_settings.m_lpfFIRlog2Interp = conf.getLpfFiRlog2IntDec();
|
||||
m_settings.m_lpfFIRBW = conf.getLpfFirbw();
|
||||
m_settings.m_LOppmTenths = conf.getLoPPMTenths();
|
||||
m_settings.m_lpfFIREnable = conf.isLpfFirEnable();
|
||||
blockApplySettings(true);
|
||||
displaySettings();
|
||||
blockApplySettings(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void PlutoSDROutputGUI::on_startStop_toggled(bool checked)
|
||||
|
@ -150,6 +150,17 @@ bool PlutoSDRInput::handleMessage(const Message& message)
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (DevicePlutoSDRShared::MsgCrossReportToBuddy::match(message)) // message from buddy
|
||||
{
|
||||
DevicePlutoSDRShared::MsgCrossReportToBuddy& conf = (DevicePlutoSDRShared::MsgCrossReportToBuddy&) message;
|
||||
m_settings.m_devSampleRate = conf.getDevSampleRate();
|
||||
m_settings.m_lpfFIRlog2Decim = conf.getLpfFiRlog2IntDec();
|
||||
m_settings.m_lpfFIRBW = conf.getLpfFirbw();
|
||||
m_settings.m_LOppmTenths = conf.getLoPPMTenths();
|
||||
PlutoSDRInputSettings newSettings = m_settings;
|
||||
newSettings.m_lpfFIREnable = conf.isLpfFirEnable();
|
||||
applySettings(newSettings);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
@ -438,7 +449,29 @@ bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool fo
|
||||
// TODO: forward changes to other (Tx) DSP
|
||||
if (forwardChangeOtherDSP)
|
||||
{
|
||||
|
||||
qDebug("PlutoSDRInput::applySettings: forwardChangeOtherDSP");
|
||||
|
||||
const std::vector<DeviceSinkAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
|
||||
std::vector<DeviceSinkAPI*>::const_iterator itSink = sinkBuddies.begin();
|
||||
|
||||
for (; itSink != sinkBuddies.end(); ++itSink)
|
||||
{
|
||||
DevicePlutoSDRShared::MsgCrossReportToBuddy *msg = DevicePlutoSDRShared::MsgCrossReportToBuddy::create(
|
||||
settings.m_devSampleRate,
|
||||
settings.m_lpfFIREnable,
|
||||
settings.m_lpfFIRlog2Decim,
|
||||
settings.m_lpfFIRBW,
|
||||
settings.m_LOppmTenths);
|
||||
|
||||
if ((*itSink)->getSampleSinkGUIMessageQueue())
|
||||
{
|
||||
DevicePlutoSDRShared::MsgCrossReportToBuddy *msgToGUI = new DevicePlutoSDRShared::MsgCrossReportToBuddy(*msg);
|
||||
(*itSink)->getSampleSinkGUIMessageQueue()->push(msgToGUI);
|
||||
}
|
||||
|
||||
(*itSink)->getSampleSinkInputMessageQueue()->push(msg);
|
||||
}
|
||||
}
|
||||
|
||||
if (forwardChangeOwnDSP)
|
||||
|
@ -130,7 +130,24 @@ bool PlutoSDRInputGui::deserialize(const QByteArray& data)
|
||||
|
||||
bool PlutoSDRInputGui::handleMessage(const Message& message __attribute__((unused)))
|
||||
{
|
||||
return false;
|
||||
if (DevicePlutoSDRShared::MsgCrossReportToBuddy::match(message)) // message from buddy
|
||||
{
|
||||
DevicePlutoSDRShared::MsgCrossReportToBuddy& conf = (DevicePlutoSDRShared::MsgCrossReportToBuddy&) message;
|
||||
m_settings.m_devSampleRate = conf.getDevSampleRate();
|
||||
m_settings.m_lpfFIRlog2Decim = conf.getLpfFiRlog2IntDec();
|
||||
m_settings.m_lpfFIRBW = conf.getLpfFirbw();
|
||||
m_settings.m_LOppmTenths = conf.getLoPPMTenths();
|
||||
m_settings.m_lpfFIREnable = conf.isLpfFirEnable();
|
||||
blockApplySettings(true);
|
||||
displaySettings();
|
||||
blockApplySettings(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void PlutoSDRInputGui::on_startStop_toggled(bool checked)
|
||||
|
Loading…
Reference in New Issue
Block a user