mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-04 18:48:34 -04:00
XTRX MIMO: Make settings assignments atomic. Part of #1329
This commit is contained in:
parent
da8f987ee9
commit
ba3918f2d2
@ -122,7 +122,7 @@ void XTRXMIMO::destroy()
|
||||
|
||||
void XTRXMIMO::init()
|
||||
{
|
||||
applySettings(m_settings, true);
|
||||
applySettings(m_settings, QList<QString>(), true);
|
||||
}
|
||||
|
||||
bool XTRXMIMO::startRx()
|
||||
@ -227,12 +227,12 @@ bool XTRXMIMO::deserialize(const QByteArray& data)
|
||||
success = false;
|
||||
}
|
||||
|
||||
MsgConfigureXTRXMIMO* message = MsgConfigureXTRXMIMO::create(m_settings, true);
|
||||
MsgConfigureXTRXMIMO* message = MsgConfigureXTRXMIMO::create(m_settings, QList<QString>(), true);
|
||||
m_inputMessageQueue.push(message);
|
||||
|
||||
if (m_guiMessageQueue)
|
||||
{
|
||||
MsgConfigureXTRXMIMO* messageToGUI = MsgConfigureXTRXMIMO::create(m_settings, true);
|
||||
MsgConfigureXTRXMIMO* messageToGUI = MsgConfigureXTRXMIMO::create(m_settings, QList<QString>(), true);
|
||||
m_guiMessageQueue->push(messageToGUI);
|
||||
}
|
||||
|
||||
@ -270,12 +270,12 @@ void XTRXMIMO::setSourceCenterFrequency(qint64 centerFrequency, int index)
|
||||
XTRXMIMOSettings settings = m_settings;
|
||||
settings.m_rxCenterFrequency = centerFrequency;
|
||||
|
||||
MsgConfigureXTRXMIMO* message = MsgConfigureXTRXMIMO::create(settings, false);
|
||||
MsgConfigureXTRXMIMO* message = MsgConfigureXTRXMIMO::create(settings, QList<QString>{"rxCenterFrequency"}, false);
|
||||
m_inputMessageQueue.push(message);
|
||||
|
||||
if (m_guiMessageQueue)
|
||||
{
|
||||
MsgConfigureXTRXMIMO* messageToGUI = MsgConfigureXTRXMIMO::create(settings, false);
|
||||
MsgConfigureXTRXMIMO* messageToGUI = MsgConfigureXTRXMIMO::create(settings, QList<QString>{"rxCenterFrequency"}, false);
|
||||
m_guiMessageQueue->push(messageToGUI);
|
||||
}
|
||||
}
|
||||
@ -292,12 +292,12 @@ void XTRXMIMO::setSinkCenterFrequency(qint64 centerFrequency, int index)
|
||||
XTRXMIMOSettings settings = m_settings;
|
||||
settings.m_txCenterFrequency = centerFrequency;
|
||||
|
||||
MsgConfigureXTRXMIMO* message = MsgConfigureXTRXMIMO::create(settings, false);
|
||||
MsgConfigureXTRXMIMO* message = MsgConfigureXTRXMIMO::create(settings, QList<QString>{"txCenterFrequency"}, false);
|
||||
m_inputMessageQueue.push(message);
|
||||
|
||||
if (m_guiMessageQueue)
|
||||
{
|
||||
MsgConfigureXTRXMIMO* messageToGUI = MsgConfigureXTRXMIMO::create(settings, false);
|
||||
MsgConfigureXTRXMIMO* messageToGUI = MsgConfigureXTRXMIMO::create(settings, QList<QString>{"txCenterFrequency"}, false);
|
||||
m_guiMessageQueue->push(messageToGUI);
|
||||
}
|
||||
}
|
||||
@ -354,7 +354,7 @@ bool XTRXMIMO::handleMessage(const Message& message)
|
||||
MsgConfigureXTRXMIMO& conf = (MsgConfigureXTRXMIMO&) message;
|
||||
qDebug() << "XTRXMIMO::handleMessage: MsgConfigureXTRXMIMO";
|
||||
|
||||
bool success = applySettings(conf.getSettings(), conf.getForce());
|
||||
bool success = applySettings(conf.getSettings(), conf.getSettingsKeys(), conf.getForce());
|
||||
|
||||
if (!success) {
|
||||
qDebug("XTRXMIMO::handleMessage: config error");
|
||||
@ -440,9 +440,9 @@ bool XTRXMIMO::handleMessage(const Message& message)
|
||||
}
|
||||
}
|
||||
|
||||
bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, const QList<QString>& settingsKeys, bool force)
|
||||
{
|
||||
QList<QString> reverseAPIKeys;
|
||||
qDebug() << "XTRXMIMO::applySettings: force:" << force << settings.getDebugString(settingsKeys, force);
|
||||
bool doRxLPCalibration = false;
|
||||
bool doRxChangeSampleRate = false;
|
||||
bool doRxChangeFreq = false;
|
||||
@ -457,56 +457,10 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
qint64 rxXlatedDeviceCenterFrequency = settings.m_rxCenterFrequency;
|
||||
qint64 txXlatedDeviceCenterFrequency = settings.m_txCenterFrequency;
|
||||
|
||||
qDebug() << "XTRXMIMO::applySettings: common:"
|
||||
<< " m_extClock: " << settings.m_extClock
|
||||
<< " m_extClockFreq: " << settings.m_extClockFreq
|
||||
<< " force: " << force;
|
||||
qDebug() << "XTRXMIMO::applySettings: Rx:"
|
||||
<< " m_rxDevSampleRate: " << settings.m_rxDevSampleRate
|
||||
<< " m_rxCenterFrequency: " << settings.m_rxCenterFrequency
|
||||
<< " m_log2HardDecim: " << settings.m_log2HardDecim
|
||||
<< " m_log2SoftDecim: " << settings.m_log2SoftDecim
|
||||
<< " m_dcBlock: " << settings.m_dcBlock
|
||||
<< " m_iqCorrection: " << settings.m_iqCorrection
|
||||
<< " m_ncoEnableRx: " << settings.m_ncoEnableRx
|
||||
<< " m_ncoFrequencyRx: " << settings.m_ncoFrequencyRx
|
||||
<< " m_antennaPathRx: " << settings.m_antennaPathRx;
|
||||
qDebug() << "XTRXMIMO::applySettings: Rx0:"
|
||||
<< " m_gainRx0: " << settings.m_gainRx0
|
||||
<< " m_lpfBWRx0: " << settings.m_lpfBWRx0
|
||||
<< " m_pwrmodeRx0: " << settings.m_pwrmodeRx0;
|
||||
qDebug() << "XTRXMIMO::applySettings: Rx1:"
|
||||
<< " m_gainRx1: " << settings.m_gainRx1
|
||||
<< " m_lpfBWRx1: " << settings.m_lpfBWRx1
|
||||
<< " m_pwrmodeRx1: " << settings.m_pwrmodeRx1;
|
||||
qDebug() << "XTRXMIMO::applySettings: Tx:"
|
||||
<< " m_txDevSampleRate: " << settings.m_txDevSampleRate
|
||||
<< " m_txCenterFrequency: " << settings.m_txCenterFrequency
|
||||
<< " m_log2HardInterp: " << settings.m_log2HardInterp
|
||||
<< " m_log2SoftInterp: " << settings.m_log2SoftInterp
|
||||
<< " m_ncoEnableTx0: " << settings.m_ncoEnableTx
|
||||
<< " m_ncoFrequencyTx: " << settings.m_ncoFrequencyTx
|
||||
<< " m_antennaPathTx: " << settings.m_antennaPathTx;
|
||||
qDebug() << "XTRXMIMO::applySettings: Tx0:"
|
||||
<< " m_gainTx0: " << settings.m_gainTx0
|
||||
<< " m_lpfBWTx0: " << settings.m_lpfBWTx0
|
||||
<< " m_pwrmodeTx0: " << settings.m_pwrmodeTx0;
|
||||
qDebug() << "XTRXMIMO::applySettings: Tx0:"
|
||||
<< " m_gainTx1: " << settings.m_gainTx1
|
||||
<< " m_lpfBWTx1: " << settings.m_lpfBWTx1
|
||||
<< " m_pwrmodeTx1: " << settings.m_pwrmodeTx1;
|
||||
|
||||
// common
|
||||
|
||||
if ((m_settings.m_extClock != settings.m_extClock) || force) {
|
||||
reverseAPIKeys.append("extClock");
|
||||
}
|
||||
if ((m_settings.m_extClockFreq != settings.m_extClockFreq) || force) {
|
||||
reverseAPIKeys.append("extClockFreq");
|
||||
}
|
||||
|
||||
if ((m_settings.m_extClock != settings.m_extClock)
|
||||
|| (settings.m_extClock && (m_settings.m_extClockFreq != settings.m_extClockFreq)) || force)
|
||||
if (settingsKeys.contains("extClock")
|
||||
|| (settings.m_extClock && settingsKeys.contains("extClockFreq")) || force)
|
||||
{
|
||||
if (m_deviceShared.m_dev->getDevice() != 0)
|
||||
{
|
||||
@ -527,27 +481,16 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
|
||||
// Rx
|
||||
|
||||
if ((m_settings.m_dcBlock != settings.m_dcBlock) || force)
|
||||
{
|
||||
reverseAPIKeys.append("dcBlock");
|
||||
if (settingsKeys.contains("dcBlock") || force) {
|
||||
m_deviceAPI->configureCorrections(settings.m_dcBlock, settings.m_iqCorrection);
|
||||
}
|
||||
|
||||
if ((m_settings.m_iqCorrection != settings.m_iqCorrection) || force)
|
||||
{
|
||||
reverseAPIKeys.append("iqCorrection");
|
||||
if (settingsKeys.contains("iqCorrection") || force) {
|
||||
m_deviceAPI->configureCorrections(settings.m_dcBlock, settings.m_iqCorrection);
|
||||
}
|
||||
|
||||
if ((m_settings.m_rxDevSampleRate != settings.m_rxDevSampleRate) || force) {
|
||||
reverseAPIKeys.append("rxDevSampleRate");
|
||||
}
|
||||
if ((m_settings.m_log2HardDecim != settings.m_log2HardDecim) || force) {
|
||||
reverseAPIKeys.append("log2HardDecim");
|
||||
}
|
||||
|
||||
if ((m_settings.m_rxDevSampleRate != settings.m_rxDevSampleRate)
|
||||
|| (m_settings.m_log2HardDecim != settings.m_log2HardDecim) || force)
|
||||
if (settingsKeys.contains("rxDevSampleRate")
|
||||
|| settingsKeys.contains("log2HardDecim") || force)
|
||||
{
|
||||
forwardChangeRxDSP = true;
|
||||
|
||||
@ -556,9 +499,8 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_log2SoftDecim != settings.m_log2SoftDecim) || force)
|
||||
if (settingsKeys.contains("log2SoftDecim") || force)
|
||||
{
|
||||
reverseAPIKeys.append("log2SoftDecim");
|
||||
forwardChangeRxDSP = true;
|
||||
|
||||
if (m_sourceThread)
|
||||
@ -568,32 +510,21 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_iqOrder != settings.m_iqOrder) || force)
|
||||
if (settingsKeys.contains("iqOrder") || force)
|
||||
{
|
||||
reverseAPIKeys.append("iqOrder");
|
||||
|
||||
if (m_sourceThread) {
|
||||
m_sourceThread->setIQOrder(settings.m_iqOrder);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_ncoFrequencyRx != settings.m_ncoFrequencyRx) || force) {
|
||||
reverseAPIKeys.append("ncoFrequencyRx");
|
||||
}
|
||||
if ((m_settings.m_ncoEnableRx != settings.m_ncoEnableRx) || force) {
|
||||
reverseAPIKeys.append("ncoEnableRx");
|
||||
}
|
||||
|
||||
if ((m_settings.m_ncoFrequencyRx != settings.m_ncoFrequencyRx)
|
||||
|| (m_settings.m_ncoEnableRx != settings.m_ncoEnableRx) || force)
|
||||
if (settingsKeys.contains("ncoFrequencyRx")
|
||||
|| settingsKeys.contains("ncoEnableRx") || force)
|
||||
{
|
||||
forceNCOFrequencyRx = true;
|
||||
}
|
||||
|
||||
if ((m_settings.m_antennaPathRx != settings.m_antennaPathRx) || force)
|
||||
if (settingsKeys.contains("antennaPathRx") || force)
|
||||
{
|
||||
reverseAPIKeys.append("antennaPathRx");
|
||||
|
||||
if (m_deviceShared.m_dev->getDevice())
|
||||
{
|
||||
if (xtrx_set_antenna(m_deviceShared.m_dev->getDevice(), toXTRXAntennaRx(settings.m_antennaPathRx)) < 0) {
|
||||
@ -604,18 +535,14 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_rxCenterFrequency != settings.m_rxCenterFrequency) || force)
|
||||
{
|
||||
reverseAPIKeys.append("rxCenterFrequency");
|
||||
if (settingsKeys.contains("rxCenterFrequency") || force) {
|
||||
doRxChangeFreq = true;
|
||||
}
|
||||
|
||||
// Rx0/1
|
||||
|
||||
if ((m_settings.m_pwrmodeRx0 != settings.m_pwrmodeRx0))
|
||||
if (settingsKeys.contains("pwrmodeRx0") || force)
|
||||
{
|
||||
reverseAPIKeys.append("pwrmodeRx0");
|
||||
|
||||
if (m_deviceShared.m_dev->getDevice())
|
||||
{
|
||||
if (xtrx_val_set(m_deviceShared.m_dev->getDevice(),
|
||||
@ -628,10 +555,8 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_pwrmodeRx1 != settings.m_pwrmodeRx1))
|
||||
if (settingsKeys.contains("pwrmodeRx1") || force)
|
||||
{
|
||||
reverseAPIKeys.append("pwrmodeRx1");
|
||||
|
||||
if (m_deviceShared.m_dev->getDevice())
|
||||
{
|
||||
if (xtrx_val_set(m_deviceShared.m_dev->getDevice(),
|
||||
@ -644,38 +569,6 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_gainModeRx0 != settings.m_gainModeRx0) || force) {
|
||||
reverseAPIKeys.append("gainModeRx0");
|
||||
}
|
||||
if ((m_settings.m_gainRx0 != settings.m_gainRx0) || force) {
|
||||
reverseAPIKeys.append("gainRx0");
|
||||
}
|
||||
if ((m_settings.m_lnaGainRx0 != settings.m_lnaGainRx0) || force) {
|
||||
reverseAPIKeys.append("lnaGainRx0");
|
||||
}
|
||||
if ((m_settings.m_tiaGainRx0 != settings.m_tiaGainRx0) || force) {
|
||||
reverseAPIKeys.append("tiaGainRx0");
|
||||
}
|
||||
if ((m_settings.m_pgaGainRx0 != settings.m_pgaGainRx0) || force) {
|
||||
reverseAPIKeys.append("pgaGainRx0");
|
||||
}
|
||||
|
||||
if ((m_settings.m_gainModeRx1 != settings.m_gainModeRx1) || force) {
|
||||
reverseAPIKeys.append("gainModeRx1");
|
||||
}
|
||||
if ((m_settings.m_gainRx1 != settings.m_gainRx1) || force) {
|
||||
reverseAPIKeys.append("gainRx1");
|
||||
}
|
||||
if ((m_settings.m_lnaGainRx1 != settings.m_lnaGainRx1) || force) {
|
||||
reverseAPIKeys.append("lnaGainRx1");
|
||||
}
|
||||
if ((m_settings.m_tiaGainRx1 != settings.m_tiaGainRx1) || force) {
|
||||
reverseAPIKeys.append("tiaGainRx1");
|
||||
}
|
||||
if ((m_settings.m_pgaGainRx1 != settings.m_pgaGainRx1) || force) {
|
||||
reverseAPIKeys.append("pgaGainRx1");
|
||||
}
|
||||
|
||||
if (m_deviceShared.m_dev->getDevice())
|
||||
{
|
||||
bool doGainAuto = false;
|
||||
@ -683,7 +576,7 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
bool doGainTia = false;
|
||||
bool doGainPga = false;
|
||||
|
||||
if ((m_settings.m_gainModeRx0 != settings.m_gainModeRx0) || force)
|
||||
if (settingsKeys.contains("gainModeRx0") || force)
|
||||
{
|
||||
if (settings.m_gainModeRx0 == XTRXMIMOSettings::GAIN_AUTO)
|
||||
{
|
||||
@ -704,13 +597,13 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
}
|
||||
else if (m_settings.m_gainModeRx0 == XTRXMIMOSettings::GAIN_MANUAL)
|
||||
{
|
||||
if (m_settings.m_lnaGainRx0 != settings.m_lnaGainRx0) {
|
||||
if (settingsKeys.contains("lnaGainRx0")) {
|
||||
doGainLna = true;
|
||||
}
|
||||
if (m_settings.m_tiaGainRx0 != settings.m_tiaGainRx0) {
|
||||
if (settingsKeys.contains("tiaGainRx0")) {
|
||||
doGainTia = true;
|
||||
}
|
||||
if (m_settings.m_pgaGainRx0 != settings.m_pgaGainRx0) {
|
||||
if (settingsKeys.contains("pgaGainRx0")) {
|
||||
doGainPga = true;
|
||||
}
|
||||
}
|
||||
@ -733,7 +626,7 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
doGainTia = false;
|
||||
doGainPga = false;
|
||||
|
||||
if ((m_settings.m_gainModeRx1 != settings.m_gainModeRx1) || force)
|
||||
if (settingsKeys.contains("gainModeRx1") || force)
|
||||
{
|
||||
if (settings.m_gainModeRx1 == XTRXMIMOSettings::GAIN_AUTO)
|
||||
{
|
||||
@ -754,13 +647,13 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
}
|
||||
else if (m_settings.m_gainModeRx1 == XTRXMIMOSettings::GAIN_MANUAL)
|
||||
{
|
||||
if (m_settings.m_lnaGainRx1 != settings.m_lnaGainRx1) {
|
||||
if (settingsKeys.contains("lnaGainRx1")) {
|
||||
doGainLna = true;
|
||||
}
|
||||
if (m_settings.m_tiaGainRx1 != settings.m_tiaGainRx1) {
|
||||
if (settingsKeys.contains("tiaGainRx1")) {
|
||||
doGainTia = true;
|
||||
}
|
||||
if (m_settings.m_pgaGainRx1 != settings.m_pgaGainRx1) {
|
||||
if (settingsKeys.contains("pgaGainRx1")) {
|
||||
doGainPga = true;
|
||||
}
|
||||
}
|
||||
@ -779,19 +672,15 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_lpfBWRx0 != settings.m_lpfBWRx0) || force)
|
||||
if (settingsKeys.contains("lpfBWRx0") || force)
|
||||
{
|
||||
reverseAPIKeys.append("lpfBWRx0");
|
||||
|
||||
if (m_deviceShared.m_dev->getDevice()) {
|
||||
doRxLPCalibration = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_lpfBWRx1 != settings.m_lpfBWRx1) || force)
|
||||
if (settingsKeys.contains("lpfBWRx1") || force)
|
||||
{
|
||||
reverseAPIKeys.append("lpfBWRx1");
|
||||
|
||||
if (m_deviceShared.m_dev->getDevice()) {
|
||||
doRxLPCalibration = true;
|
||||
}
|
||||
@ -799,15 +688,8 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
|
||||
// Tx
|
||||
|
||||
if ((m_settings.m_txDevSampleRate != settings.m_txDevSampleRate) || force) {
|
||||
reverseAPIKeys.append("txDevSampleRate");
|
||||
}
|
||||
if ((m_settings.m_log2HardInterp != settings.m_log2HardInterp) || force) {
|
||||
reverseAPIKeys.append("log2HardInterp");
|
||||
}
|
||||
|
||||
if ((m_settings.m_txDevSampleRate != settings.m_txDevSampleRate)
|
||||
|| (m_settings.m_log2HardInterp != settings.m_log2HardInterp) || force)
|
||||
if (settingsKeys.contains("txDevSampleRate")
|
||||
|| settingsKeys.contains("log2HardInterp") || force)
|
||||
{
|
||||
forwardChangeTxDSP = true;
|
||||
|
||||
@ -816,9 +698,8 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_log2SoftInterp != settings.m_log2SoftInterp) || force)
|
||||
if (settingsKeys.contains("log2SoftInterp") || force)
|
||||
{
|
||||
reverseAPIKeys.append("log2SoftInterp");
|
||||
forwardChangeTxDSP = true;
|
||||
|
||||
if (m_sinkThread)
|
||||
@ -828,23 +709,14 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_ncoFrequencyTx != settings.m_ncoFrequencyTx) || force) {
|
||||
reverseAPIKeys.append("ncoFrequencyTx");
|
||||
}
|
||||
if ((m_settings.m_ncoEnableTx != settings.m_ncoEnableTx) || force) {
|
||||
reverseAPIKeys.append("ncoEnableTx");
|
||||
}
|
||||
|
||||
if ((m_settings.m_ncoFrequencyTx != settings.m_ncoFrequencyTx)
|
||||
|| (m_settings.m_ncoEnableTx != settings.m_ncoEnableTx) || force)
|
||||
if (settingsKeys.contains("ncoFrequencyTx")
|
||||
|| settingsKeys.contains("ncoEnableTx") || force)
|
||||
{
|
||||
forceNCOFrequencyTx = true;
|
||||
}
|
||||
|
||||
if ((m_settings.m_antennaPathTx != settings.m_antennaPathTx) || force)
|
||||
if (settingsKeys.contains("antennaPathTx") || force)
|
||||
{
|
||||
reverseAPIKeys.append("antennaPathTx");
|
||||
|
||||
if (m_deviceShared.m_dev->getDevice())
|
||||
{
|
||||
if (xtrx_set_antenna(m_deviceShared.m_dev->getDevice(), toXTRXAntennaTx(settings.m_antennaPathTx)) < 0) {
|
||||
@ -855,18 +727,15 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_txCenterFrequency != settings.m_txCenterFrequency) || force)
|
||||
if (settingsKeys.contains("txCenterFrequency") || force)
|
||||
{
|
||||
reverseAPIKeys.append("txCenterFrequency");
|
||||
doTxChangeFreq = true;
|
||||
}
|
||||
|
||||
// Tx0
|
||||
|
||||
if ((m_settings.m_pwrmodeTx0 != settings.m_pwrmodeTx0))
|
||||
if (settingsKeys.contains("pwrmodeTx0") || force)
|
||||
{
|
||||
reverseAPIKeys.append("pwrmodeTx0");
|
||||
|
||||
if (m_deviceShared.m_dev->getDevice())
|
||||
{
|
||||
if (xtrx_val_set(m_deviceShared.m_dev->getDevice(),
|
||||
@ -879,10 +748,8 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_gainTx0 != settings.m_gainTx0) || force)
|
||||
if (settingsKeys.contains("gainTx0") || force)
|
||||
{
|
||||
reverseAPIKeys.append("gainTx0");
|
||||
|
||||
if (m_deviceShared.m_dev->getDevice())
|
||||
{
|
||||
if (xtrx_set_gain(m_deviceShared.m_dev->getDevice(),
|
||||
@ -897,10 +764,8 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_lpfBWTx0 != settings.m_lpfBWTx0) || force)
|
||||
if (settingsKeys.contains("lpfBWTx0") || force)
|
||||
{
|
||||
reverseAPIKeys.append("lpfBWTx0");
|
||||
|
||||
if (m_deviceShared.m_dev->getDevice()) {
|
||||
doTxLPCalibration = true;
|
||||
}
|
||||
@ -908,16 +773,20 @@ bool XTRXMIMO::applySettings(const XTRXMIMOSettings& settings, bool force)
|
||||
|
||||
// Reverse API
|
||||
|
||||
if (settings.m_useReverseAPI)
|
||||
if (settingsKeys.contains("useReverseAPI"))
|
||||
{
|
||||
bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) ||
|
||||
(m_settings.m_reverseAPIAddress != settings.m_reverseAPIAddress) ||
|
||||
(m_settings.m_reverseAPIPort != settings.m_reverseAPIPort) ||
|
||||
(m_settings.m_reverseAPIDeviceIndex != settings.m_reverseAPIDeviceIndex);
|
||||
webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
|
||||
bool fullUpdate = (settingsKeys.contains("useReverseAPI") && settings.m_useReverseAPI) ||
|
||||
settingsKeys.contains("reverseAPIAddress") ||
|
||||
settingsKeys.contains("reverseAPIPort") ||
|
||||
settingsKeys.contains("reverseAPIDeviceIndex");
|
||||
webapiReverseSendSettings(settingsKeys, settings, fullUpdate || force);
|
||||
}
|
||||
|
||||
m_settings = settings;
|
||||
if (force) {
|
||||
m_settings = settings;
|
||||
} else {
|
||||
m_settings.applySettings(settingsKeys, settings);
|
||||
}
|
||||
|
||||
// Post Rx
|
||||
|
||||
@ -1330,12 +1199,12 @@ int XTRXMIMO::webapiSettingsPutPatch(
|
||||
XTRXMIMOSettings settings = m_settings;
|
||||
webapiUpdateDeviceSettings(settings, deviceSettingsKeys, response);
|
||||
|
||||
MsgConfigureXTRXMIMO *msg = MsgConfigureXTRXMIMO::create(settings, force);
|
||||
MsgConfigureXTRXMIMO *msg = MsgConfigureXTRXMIMO::create(settings, deviceSettingsKeys, force);
|
||||
m_inputMessageQueue.push(msg);
|
||||
|
||||
if (m_guiMessageQueue) // forward to GUI if any
|
||||
{
|
||||
MsgConfigureXTRXMIMO *msgToGUI = MsgConfigureXTRXMIMO::create(settings, force);
|
||||
MsgConfigureXTRXMIMO *msgToGUI = MsgConfigureXTRXMIMO::create(settings, deviceSettingsKeys, force);
|
||||
m_guiMessageQueue->push(msgToGUI);
|
||||
}
|
||||
|
||||
@ -1645,7 +1514,7 @@ void XTRXMIMO::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response)
|
||||
response.getXtrxMimoReport()->setGpsLock(gpsStatus ? 1 : 0);
|
||||
}
|
||||
|
||||
void XTRXMIMO::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const XTRXMIMOSettings& settings, bool force)
|
||||
void XTRXMIMO::webapiReverseSendSettings(const QList<QString>& deviceSettingsKeys, const XTRXMIMOSettings& settings, bool force)
|
||||
{
|
||||
SWGSDRangel::SWGDeviceSettings *swgDeviceSettings = new SWGSDRangel::SWGDeviceSettings();
|
||||
swgDeviceSettings->setDirection(2); // MIMO
|
||||
|
@ -46,20 +46,22 @@ public:
|
||||
|
||||
public:
|
||||
const XTRXMIMOSettings& getSettings() const { return m_settings; }
|
||||
const QList<QString>& getSettingsKeys() const { return m_settingsKeys; }
|
||||
bool getForce() const { return m_force; }
|
||||
|
||||
static MsgConfigureXTRXMIMO* create(const XTRXMIMOSettings& settings, bool force)
|
||||
{
|
||||
return new MsgConfigureXTRXMIMO(settings, force);
|
||||
static MsgConfigureXTRXMIMO* create(const XTRXMIMOSettings& settings, const QList<QString>& settingsKeys, bool force) {
|
||||
return new MsgConfigureXTRXMIMO(settings, settingsKeys, force);
|
||||
}
|
||||
|
||||
private:
|
||||
XTRXMIMOSettings m_settings;
|
||||
QList<QString> m_settingsKeys;
|
||||
bool m_force;
|
||||
|
||||
MsgConfigureXTRXMIMO(const XTRXMIMOSettings& settings, bool force) :
|
||||
MsgConfigureXTRXMIMO(const XTRXMIMOSettings& settings, const QList<QString>& settingsKeys, bool force) :
|
||||
Message(),
|
||||
m_settings(settings),
|
||||
m_settingsKeys(settingsKeys),
|
||||
m_force(force)
|
||||
{ }
|
||||
};
|
||||
@ -281,7 +283,7 @@ private:
|
||||
bool openDevice();
|
||||
void closeDevice();
|
||||
|
||||
bool applySettings(const XTRXMIMOSettings& settings, bool force);
|
||||
bool applySettings(const XTRXMIMOSettings& settings, const QList<QString>& settingsKeys, bool force);
|
||||
void applyGainAuto(unsigned int channel, uint32_t gain);
|
||||
void applyGainLNA(unsigned int channel, double gain);
|
||||
void applyGainTIA(unsigned int channel, double gain);
|
||||
@ -289,7 +291,7 @@ private:
|
||||
void setRxDeviceCenterFrequency(xtrx_dev *dev, quint64 freq_hz);
|
||||
void setTxDeviceCenterFrequency(xtrx_dev *dev, quint64 freq_hz);
|
||||
|
||||
void webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const XTRXMIMOSettings& settings, bool force);
|
||||
void webapiReverseSendSettings(const QList<QString>& deviceSettingsKeys, const XTRXMIMOSettings& settings, bool force);
|
||||
void webapiReverseSendStartStop(bool start);
|
||||
|
||||
static xtrx_antenna_t toXTRXAntennaRx(XTRXMIMOSettings::RxAntenna antennaPath);
|
||||
|
@ -117,6 +117,7 @@ void XTRXMIMOGUI::resetToDefaults()
|
||||
{
|
||||
m_settings.resetToDefaults();
|
||||
displaySettings();
|
||||
m_forceSettings = true;
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@ -193,7 +194,13 @@ bool XTRXMIMOGUI::handleMessage(const Message& message)
|
||||
else if (XTRXMIMO::MsgConfigureXTRXMIMO::match(message))
|
||||
{
|
||||
const XTRXMIMO::MsgConfigureXTRXMIMO& notif = (const XTRXMIMO::MsgConfigureXTRXMIMO&) message;
|
||||
m_settings = notif.getSettings();
|
||||
|
||||
if (notif.getForce()) {
|
||||
m_settings = notif.getSettings();
|
||||
} else {
|
||||
m_settings.applySettings(notif.getSettingsKeys(), notif.getSettings());
|
||||
}
|
||||
|
||||
blockApplySettings(true);
|
||||
displaySettings();
|
||||
blockApplySettings(false);
|
||||
@ -452,6 +459,7 @@ void XTRXMIMOGUI::setRxCenterFrequencySetting(uint64_t kHzValue)
|
||||
}
|
||||
|
||||
m_settings.m_rxCenterFrequency = centerFrequency < 0 ? 0 : (uint64_t) centerFrequency;
|
||||
m_settingsKeys.append("rxCenterFrequency");
|
||||
ui->centerFrequency->setToolTip(QString("Main center frequency in kHz (LO: %1 kHz)").arg(centerFrequency/1000));
|
||||
}
|
||||
|
||||
@ -478,6 +486,7 @@ void XTRXMIMOGUI::setTxCenterFrequencySetting(uint64_t kHzValue)
|
||||
}
|
||||
|
||||
m_settings.m_txCenterFrequency = centerFrequency < 0 ? 0 : (uint64_t) centerFrequency;
|
||||
m_settingsKeys.append("txCenterFrequency");
|
||||
ui->centerFrequency->setToolTip(QString("Main center frequency in kHz (LO: %1 kHz)").arg(centerFrequency/1000));
|
||||
}
|
||||
|
||||
@ -544,9 +553,10 @@ void XTRXMIMOGUI::updateHardware()
|
||||
{
|
||||
if (m_doApplySettings)
|
||||
{
|
||||
XTRXMIMO::MsgConfigureXTRXMIMO* message = XTRXMIMO::MsgConfigureXTRXMIMO::create(m_settings, m_forceSettings);
|
||||
XTRXMIMO::MsgConfigureXTRXMIMO* message = XTRXMIMO::MsgConfigureXTRXMIMO::create(m_settings, m_settingsKeys, m_forceSettings);
|
||||
m_xtrxMIMO->getInputMessageQueue()->push(message);
|
||||
m_forceSettings = false;
|
||||
m_settingsKeys.clear();
|
||||
m_updateTimer.stop();
|
||||
}
|
||||
}
|
||||
@ -711,11 +721,13 @@ void XTRXMIMOGUI::on_ncoEnable_toggled(bool checked)
|
||||
if (m_rxElseTx)
|
||||
{
|
||||
m_settings.m_ncoEnableRx = checked;
|
||||
m_settingsKeys.append("ncoEnableRx");
|
||||
setRxCenterFrequencyDisplay();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_settings.m_ncoEnableTx = checked;
|
||||
m_settingsKeys.append("ncoEnableTx");
|
||||
setTxCenterFrequencyDisplay();
|
||||
}
|
||||
|
||||
@ -727,11 +739,13 @@ void XTRXMIMOGUI::on_ncoFrequency_changed(qint64 value)
|
||||
if (m_rxElseTx)
|
||||
{
|
||||
m_settings.m_ncoFrequencyRx = value;
|
||||
m_settingsKeys.append("ncoFrequencyRx");
|
||||
setRxCenterFrequencyDisplay();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_settings.m_ncoFrequencyTx = value;
|
||||
m_settingsKeys.append("ncoFrequencyTx");
|
||||
setTxCenterFrequencyDisplay();
|
||||
}
|
||||
|
||||
@ -741,12 +755,14 @@ void XTRXMIMOGUI::on_ncoFrequency_changed(qint64 value)
|
||||
void XTRXMIMOGUI::on_dcOffset_toggled(bool checked)
|
||||
{
|
||||
m_settings.m_dcBlock = checked;
|
||||
m_settingsKeys.append("dcBlock");
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void XTRXMIMOGUI::on_iqImbalance_toggled(bool checked)
|
||||
{
|
||||
m_settings.m_iqCorrection = checked;
|
||||
m_settingsKeys.append("iqCorrection");
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@ -755,6 +771,8 @@ void XTRXMIMOGUI::on_extClock_clicked()
|
||||
m_settings.m_extClock = ui->extClock->getExternalClockActive();
|
||||
m_settings.m_extClockFreq = ui->extClock->getExternalClockFrequency();
|
||||
qDebug("XTRXMIMOGUI::on_extClock_clicked: %u Hz %s", m_settings.m_extClockFreq, m_settings.m_extClock ? "on" : "off");
|
||||
m_settingsKeys.append("extClock");
|
||||
m_settingsKeys.append("extClockFreq");
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@ -764,10 +782,15 @@ void XTRXMIMOGUI::on_hwDecim_currentIndexChanged(int index)
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_rxElseTx) {
|
||||
if (m_rxElseTx)
|
||||
{
|
||||
m_settings.m_log2HardDecim = index;
|
||||
} else {
|
||||
m_settingsKeys.append("log2HardDecim");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_settings.m_log2HardInterp = index;
|
||||
m_settingsKeys.append("log2HardInterp");
|
||||
}
|
||||
|
||||
sendSettings();
|
||||
@ -784,6 +807,8 @@ void XTRXMIMOGUI::on_swDecim_currentIndexChanged(int index)
|
||||
if (m_rxElseTx)
|
||||
{
|
||||
m_settings.m_log2SoftDecim = index;
|
||||
m_settingsKeys.append("log2SoftDecim");
|
||||
m_settingsKeys.append("rxDevSampleRate");
|
||||
|
||||
if (m_sampleRateMode) {
|
||||
m_settings.m_rxDevSampleRate = ui->sampleRate->getValueNew();
|
||||
@ -794,6 +819,8 @@ void XTRXMIMOGUI::on_swDecim_currentIndexChanged(int index)
|
||||
else
|
||||
{
|
||||
m_settings.m_log2SoftInterp = index;
|
||||
m_settingsKeys.append("log2SoftInterp");
|
||||
m_settingsKeys.append("txDevSampleRate");
|
||||
|
||||
if (m_sampleRateMode) {
|
||||
m_settings.m_txDevSampleRate = ui->sampleRate->getValueNew();
|
||||
@ -815,6 +842,8 @@ void XTRXMIMOGUI::on_sampleRate_changed(quint64 value)
|
||||
{
|
||||
if (m_rxElseTx)
|
||||
{
|
||||
m_settingsKeys.append("rxDevSampleRate");
|
||||
|
||||
if (m_sampleRateMode) {
|
||||
m_settings.m_rxDevSampleRate = value;
|
||||
} else {
|
||||
@ -823,6 +852,8 @@ void XTRXMIMOGUI::on_sampleRate_changed(quint64 value)
|
||||
}
|
||||
else
|
||||
{
|
||||
m_settingsKeys.append("txDevSampleRate");
|
||||
|
||||
if (m_sampleRateMode) {
|
||||
m_settings.m_txDevSampleRate = value;
|
||||
} else {
|
||||
@ -837,18 +868,28 @@ void XTRXMIMOGUI::on_lpf_changed(quint64 value)
|
||||
{
|
||||
if (m_rxElseTx)
|
||||
{
|
||||
if (m_streamIndex == 0) {
|
||||
if (m_streamIndex == 0)
|
||||
{
|
||||
m_settings.m_lpfBWRx0 = value * 1000;
|
||||
} else if (m_streamIndex == 1) {
|
||||
m_settingsKeys.append("lpfBWRx0");
|
||||
}
|
||||
else if (m_streamIndex == 1)
|
||||
{
|
||||
m_settings.m_lpfBWRx1 = value * 1000;
|
||||
m_settingsKeys.append("lpfBWRx1");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_streamIndex == 0) {
|
||||
if (m_streamIndex == 0)
|
||||
{
|
||||
m_settings.m_lpfBWTx0 = value * 1000;
|
||||
} else if (m_streamIndex == 1) {
|
||||
m_settingsKeys.append("lpfBWTx0");
|
||||
}
|
||||
else if (m_streamIndex == 1)
|
||||
{
|
||||
m_settings.m_lpfBWTx1 = value * 1000;
|
||||
m_settingsKeys.append("lpfBWTx1");
|
||||
}
|
||||
}
|
||||
|
||||
@ -859,18 +900,28 @@ void XTRXMIMOGUI::on_pwrmode_currentIndexChanged(int index)
|
||||
{
|
||||
if (m_rxElseTx)
|
||||
{
|
||||
if (m_streamIndex == 0) {
|
||||
if (m_streamIndex == 0)
|
||||
{
|
||||
m_settings.m_pwrmodeRx0 = index;
|
||||
} else if (m_streamIndex == 1) {
|
||||
m_settingsKeys.append("pwrmodeRx0");
|
||||
}
|
||||
else if (m_streamIndex == 1)
|
||||
{
|
||||
m_settings.m_pwrmodeRx1 = index;
|
||||
m_settingsKeys.append("pwrmodeRx1");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_streamIndex == 0) {
|
||||
if (m_streamIndex == 0)
|
||||
{
|
||||
m_settings.m_pwrmodeTx0 = index;
|
||||
} else if (m_streamIndex == 1) {
|
||||
m_settingsKeys.append("pwrmodeTx0");
|
||||
}
|
||||
else if (m_streamIndex == 1)
|
||||
{
|
||||
m_settings.m_pwrmodeTx1 = index;
|
||||
m_settingsKeys.append("pwrmodeTx1");
|
||||
}
|
||||
}
|
||||
|
||||
@ -883,10 +934,15 @@ void XTRXMIMOGUI::on_gainMode_currentIndexChanged(int index)
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_streamIndex == 0) {
|
||||
if (m_streamIndex == 0)
|
||||
{
|
||||
m_settings.m_gainModeRx0 = (XTRXMIMOSettings::GainMode) index;
|
||||
} else if (m_streamIndex == 1) {
|
||||
m_settingsKeys.append("gainModeRx0");
|
||||
}
|
||||
else if (m_streamIndex == 1)
|
||||
{
|
||||
m_settings.m_gainModeRx1 = (XTRXMIMOSettings::GainMode) index;
|
||||
m_settingsKeys.append("gainModeRx1");
|
||||
}
|
||||
|
||||
if (index == 0)
|
||||
@ -914,11 +970,13 @@ void XTRXMIMOGUI::on_gain_valueChanged(int value)
|
||||
if (m_streamIndex == 0)
|
||||
{
|
||||
m_settings.m_gainRx0 = value;
|
||||
m_settingsKeys.append("gainRx0");
|
||||
ui->gainText->setText(tr("%1").arg(m_settings.m_gainRx0));
|
||||
}
|
||||
else if (m_streamIndex == 1)
|
||||
{
|
||||
m_settings.m_gainRx1 = value;
|
||||
m_settingsKeys.append("gainRx1");
|
||||
ui->gainText->setText(tr("%1").arg(m_settings.m_gainRx1));
|
||||
}
|
||||
}
|
||||
@ -927,11 +985,13 @@ void XTRXMIMOGUI::on_gain_valueChanged(int value)
|
||||
if (m_streamIndex == 0)
|
||||
{
|
||||
m_settings.m_gainTx0 = value;
|
||||
m_settingsKeys.append("gainTx0");
|
||||
ui->gainText->setText(tr("%1").arg(m_settings.m_gainTx0));
|
||||
}
|
||||
else if (m_streamIndex == 1)
|
||||
{
|
||||
m_settings.m_gainTx1 = value;
|
||||
m_settingsKeys.append("gainTx1");
|
||||
ui->gainText->setText(tr("%1").arg(m_settings.m_gainTx1));
|
||||
}
|
||||
}
|
||||
@ -948,11 +1008,13 @@ void XTRXMIMOGUI::on_lnaGain_valueChanged(int value)
|
||||
if (m_streamIndex == 0)
|
||||
{
|
||||
m_settings.m_lnaGainRx0 = value;
|
||||
m_settingsKeys.append("lnaGainRx0");
|
||||
ui->lnaGainText->setText(tr("%1").arg(m_settings.m_lnaGainRx0));
|
||||
}
|
||||
else if (m_streamIndex == 1)
|
||||
{
|
||||
m_settings.m_lnaGainRx1 = value;
|
||||
m_settingsKeys.append("lnaGainRx1");
|
||||
ui->lnaGainText->setText(tr("%1").arg(m_settings.m_lnaGainRx1));
|
||||
}
|
||||
|
||||
@ -965,10 +1027,15 @@ void XTRXMIMOGUI::on_tiaGain_currentIndexChanged(int index)
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_streamIndex == 0) {
|
||||
if (m_streamIndex == 0)
|
||||
{
|
||||
m_settings.m_tiaGainRx0 = index + 1;
|
||||
} else {
|
||||
m_settingsKeys.append("tiaGainRx0");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_settings.m_tiaGainRx1 = index + 1;
|
||||
m_settingsKeys.append("tiaGainRx1");
|
||||
}
|
||||
|
||||
sendSettings();
|
||||
@ -983,11 +1050,13 @@ void XTRXMIMOGUI::on_pgaGain_valueChanged(int value)
|
||||
if (m_streamIndex == 0)
|
||||
{
|
||||
m_settings.m_pgaGainRx0 = value;
|
||||
m_settingsKeys.append("pgaGainRx0");
|
||||
ui->pgaGainText->setText(tr("%1").arg(m_settings.m_pgaGainRx0));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_settings.m_pgaGainRx1 = value;
|
||||
m_settingsKeys.append("pgaGainRx1");
|
||||
ui->pgaGainText->setText(tr("%1").arg(m_settings.m_pgaGainRx1));
|
||||
}
|
||||
|
||||
@ -996,10 +1065,15 @@ void XTRXMIMOGUI::on_pgaGain_valueChanged(int value)
|
||||
|
||||
void XTRXMIMOGUI::on_antenna_currentIndexChanged(int index)
|
||||
{
|
||||
if (m_rxElseTx) {
|
||||
if (m_rxElseTx)
|
||||
{
|
||||
m_settings.m_antennaPathRx = (XTRXMIMOSettings::RxAntenna) index;
|
||||
} else {
|
||||
m_settingsKeys.append("antennaPathRx");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_settings.m_antennaPathTx = (XTRXMIMOSettings::TxAntenna) index;
|
||||
m_settingsKeys.append("antennaPathTx");
|
||||
}
|
||||
|
||||
sendSettings();
|
||||
@ -1022,6 +1096,10 @@ void XTRXMIMOGUI::openDeviceSettingsDialog(const QPoint& p)
|
||||
m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
|
||||
m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
|
||||
m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
|
||||
m_settingsKeys.append("useReverseAPI");
|
||||
m_settingsKeys.append("reverseAPIAddress");
|
||||
m_settingsKeys.append("reverseAPIPort");
|
||||
m_settingsKeys.append("reverseAPIDeviceIndex");
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ private:
|
||||
Ui::XTRXMIMOGUI* ui;
|
||||
|
||||
XTRXMIMOSettings m_settings;
|
||||
QList<QString> m_settingsKeys;
|
||||
bool m_rxElseTx; //!< Which side is being dealt with
|
||||
int m_streamIndex; //!< Current stream index being dealt with
|
||||
bool m_spectrumRxElseTx;
|
||||
|
@ -216,3 +216,273 @@ bool XTRXMIMOSettings::deserialize(const QByteArray& data)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void XTRXMIMOSettings::applySettings(const QStringList& settingsKeys, const XTRXMIMOSettings& settings)
|
||||
{
|
||||
if (settingsKeys.contains("extClock")) {
|
||||
m_extClock = settings.m_extClock;
|
||||
}
|
||||
if (settingsKeys.contains("extClockFreq")) {
|
||||
m_extClockFreq = settings.m_extClockFreq;
|
||||
}
|
||||
if (settingsKeys.contains("useReverseAPI")) {
|
||||
m_useReverseAPI = settings.m_useReverseAPI;
|
||||
}
|
||||
if (settingsKeys.contains("reverseAPIAddress")) {
|
||||
m_reverseAPIAddress = settings.m_reverseAPIAddress;
|
||||
}
|
||||
if (settingsKeys.contains("reverseAPIPort")) {
|
||||
m_reverseAPIPort = settings.m_reverseAPIPort;
|
||||
}
|
||||
if (settingsKeys.contains("reverseAPIDeviceIndex")) {
|
||||
m_reverseAPIDeviceIndex = settings.m_reverseAPIDeviceIndex;
|
||||
}
|
||||
if (settingsKeys.contains("rxDevSampleRate")) {
|
||||
m_rxDevSampleRate = settings.m_rxDevSampleRate;
|
||||
}
|
||||
if (settingsKeys.contains("rxCenterFrequency")) {
|
||||
m_rxCenterFrequency = settings.m_rxCenterFrequency;
|
||||
}
|
||||
if (settingsKeys.contains("log2HardDecim")) {
|
||||
m_log2HardDecim = settings.m_log2HardDecim;
|
||||
}
|
||||
if (settingsKeys.contains("dcBlock")) {
|
||||
m_dcBlock = settings.m_dcBlock;
|
||||
}
|
||||
if (settingsKeys.contains("iqCorrection")) {
|
||||
m_iqCorrection = settings.m_iqCorrection;
|
||||
}
|
||||
if (settingsKeys.contains("log2SoftDecim")) {
|
||||
m_log2SoftDecim = settings.m_log2SoftDecim;
|
||||
}
|
||||
if (settingsKeys.contains("ncoEnableRx")) {
|
||||
m_ncoEnableRx = settings.m_ncoEnableRx;
|
||||
}
|
||||
if (settingsKeys.contains("ncoFrequencyRx")) {
|
||||
m_ncoFrequencyRx = settings.m_ncoFrequencyRx;
|
||||
}
|
||||
if (settingsKeys.contains("antennaPathRx")) {
|
||||
m_antennaPathRx = settings.m_antennaPathRx;
|
||||
}
|
||||
if (settingsKeys.contains("iqOrder")) {
|
||||
m_iqOrder = settings.m_iqOrder;
|
||||
}
|
||||
if (settingsKeys.contains("lpfBWRx0")) {
|
||||
m_lpfBWRx0 = settings.m_lpfBWRx0;
|
||||
}
|
||||
if (settingsKeys.contains("gainRx0")) {
|
||||
m_gainRx0 = settings.m_gainRx0;
|
||||
}
|
||||
if (settingsKeys.contains("gainModeRx0")) {
|
||||
m_gainModeRx0 = settings.m_gainModeRx0;
|
||||
}
|
||||
if (settingsKeys.contains("lnaGainRx0")) {
|
||||
m_lnaGainRx0 = settings.m_lnaGainRx0;
|
||||
}
|
||||
if (settingsKeys.contains("tiaGainRx0")) {
|
||||
m_tiaGainRx0 = settings.m_tiaGainRx0;
|
||||
}
|
||||
if (settingsKeys.contains("pgaGainRx0")) {
|
||||
m_pgaGainRx0 = settings.m_pgaGainRx0;
|
||||
}
|
||||
if (settingsKeys.contains("pwrmodeRx0")) {
|
||||
m_pwrmodeRx0 = settings.m_pwrmodeRx0;
|
||||
}
|
||||
if (settingsKeys.contains("lpfBWRx1")) {
|
||||
m_lpfBWRx1 = settings.m_lpfBWRx1;
|
||||
}
|
||||
if (settingsKeys.contains("gainRx1")) {
|
||||
m_gainRx1 = settings.m_gainRx1;
|
||||
}
|
||||
if (settingsKeys.contains("gainModeRx1")) {
|
||||
m_gainModeRx1 = settings.m_gainModeRx1;
|
||||
}
|
||||
if (settingsKeys.contains("lnaGainRx1")) {
|
||||
m_lnaGainRx1 = settings.m_lnaGainRx1;
|
||||
}
|
||||
if (settingsKeys.contains("tiaGainRx1")) {
|
||||
m_tiaGainRx1 = settings.m_tiaGainRx1;
|
||||
}
|
||||
if (settingsKeys.contains("pgaGainRx1")) {
|
||||
m_pgaGainRx1 = settings.m_pgaGainRx1;
|
||||
}
|
||||
if (settingsKeys.contains("pwrmodeRx1")) {
|
||||
m_pwrmodeRx1 = settings.m_pwrmodeRx1;
|
||||
}
|
||||
if (settingsKeys.contains("txDevSampleRate")) {
|
||||
m_txDevSampleRate = settings.m_txDevSampleRate;
|
||||
}
|
||||
if (settingsKeys.contains("txCenterFrequency")) {
|
||||
m_txCenterFrequency = settings.m_txCenterFrequency;
|
||||
}
|
||||
if (settingsKeys.contains("log2HardInterp")) {
|
||||
m_log2HardInterp = settings.m_log2HardInterp;
|
||||
}
|
||||
if (settingsKeys.contains("log2SoftInterp")) {
|
||||
m_log2SoftInterp = settings.m_log2SoftInterp;
|
||||
}
|
||||
if (settingsKeys.contains("ncoEnableTx")) {
|
||||
m_ncoEnableTx = settings.m_ncoEnableTx;
|
||||
}
|
||||
if (settingsKeys.contains("ncoFrequencyTx")) {
|
||||
m_ncoFrequencyTx = settings.m_ncoFrequencyTx;
|
||||
}
|
||||
if (settingsKeys.contains("antennaPathTx")) {
|
||||
m_antennaPathTx = settings.m_antennaPathTx;
|
||||
}
|
||||
if (settingsKeys.contains("lpfBWTx0")) {
|
||||
m_lpfBWTx0 = settings.m_lpfBWTx0;
|
||||
}
|
||||
if (settingsKeys.contains("gainTx0")) {
|
||||
m_gainTx0 = settings.m_gainTx0;
|
||||
}
|
||||
if (settingsKeys.contains("pwrmodeTx0")) {
|
||||
m_pwrmodeTx0 = settings.m_pwrmodeTx0;
|
||||
}
|
||||
if (settingsKeys.contains("lpfBWTx1")) {
|
||||
m_lpfBWTx1 = settings.m_lpfBWTx1;
|
||||
}
|
||||
if (settingsKeys.contains("gainTx1")) {
|
||||
m_gainTx1 = settings.m_gainTx1;
|
||||
}
|
||||
if (settingsKeys.contains("pwrmodeTx1")) {
|
||||
m_pwrmodeTx1 = settings.m_pwrmodeTx1;
|
||||
}
|
||||
}
|
||||
|
||||
QString XTRXMIMOSettings::getDebugString(const QStringList& settingsKeys, bool force) const
|
||||
{
|
||||
std::ostringstream ostr;
|
||||
|
||||
if (settingsKeys.contains("extClock") || force) {
|
||||
ostr << " m_extClock: " << m_extClock;
|
||||
}
|
||||
if (settingsKeys.contains("extClockFreq") || force) {
|
||||
ostr << " m_extClockFreq: " << m_extClockFreq;
|
||||
}
|
||||
if (settingsKeys.contains("useReverseAPI") || force) {
|
||||
ostr << " m_useReverseAPI: " << m_useReverseAPI;
|
||||
}
|
||||
if (settingsKeys.contains("reverseAPIAddress") || force) {
|
||||
ostr << " m_reverseAPIAddress: " << m_reverseAPIAddress.toStdString();
|
||||
}
|
||||
if (settingsKeys.contains("reverseAPIPort") || force) {
|
||||
ostr << " m_reverseAPIPort: " << m_reverseAPIPort;
|
||||
}
|
||||
if (settingsKeys.contains("reverseAPIDeviceIndex") || force) {
|
||||
ostr << " m_reverseAPIDeviceIndex: " << m_reverseAPIDeviceIndex;
|
||||
}
|
||||
if (settingsKeys.contains("rxDevSampleRate") || force) {
|
||||
ostr << " m_rxDevSampleRate: " << m_rxDevSampleRate;
|
||||
}
|
||||
if (settingsKeys.contains("rxCenterFrequency") || force) {
|
||||
ostr << " m_rxCenterFrequency: " << m_rxCenterFrequency;
|
||||
}
|
||||
if (settingsKeys.contains("log2HardDecim") || force) {
|
||||
ostr << " m_log2HardDecim: " << m_log2HardDecim;
|
||||
}
|
||||
if (settingsKeys.contains("dcBlock") || force) {
|
||||
ostr << " m_dcBlock: " << m_dcBlock;
|
||||
}
|
||||
if (settingsKeys.contains("iqCorrection") || force) {
|
||||
ostr << " m_iqCorrection: " << m_iqCorrection;
|
||||
}
|
||||
if (settingsKeys.contains("log2SoftDecim") || force) {
|
||||
ostr << " m_log2SoftDecim: " << m_log2SoftDecim;
|
||||
}
|
||||
if (settingsKeys.contains("ncoEnableRx") || force) {
|
||||
ostr << " m_ncoEnableRx: " << m_ncoEnableRx;
|
||||
}
|
||||
if (settingsKeys.contains("ncoFrequencyRx") || force) {
|
||||
ostr << " m_ncoFrequencyRx: " << m_ncoFrequencyRx;
|
||||
}
|
||||
if (settingsKeys.contains("antennaPathRx") || force) {
|
||||
ostr << " m_antennaPathRx: " << m_antennaPathRx;
|
||||
}
|
||||
if (settingsKeys.contains("iqOrder") || force) {
|
||||
ostr << " m_iqOrder: " << m_iqOrder;
|
||||
}
|
||||
if (settingsKeys.contains("lpfBWRx0") || force) {
|
||||
ostr << " m_lpfBWRx0: " << m_lpfBWRx0;
|
||||
}
|
||||
if (settingsKeys.contains("gainRx0") || force) {
|
||||
ostr << " m_gainRx0: " << m_gainRx0;
|
||||
}
|
||||
if (settingsKeys.contains("gainModeRx0") || force) {
|
||||
ostr << " m_gainModeRx0: " << m_gainModeRx0;
|
||||
}
|
||||
if (settingsKeys.contains("lnaGainRx0") || force) {
|
||||
ostr << " m_lnaGainRx0: " << m_lnaGainRx0;
|
||||
}
|
||||
if (settingsKeys.contains("tiaGainRx0") || force) {
|
||||
ostr << " m_tiaGainRx0: " << m_tiaGainRx0;
|
||||
}
|
||||
if (settingsKeys.contains("pgaGainRx0") || force) {
|
||||
ostr << " m_pgaGainRx0: " << m_pgaGainRx0;
|
||||
}
|
||||
if (settingsKeys.contains("pwrmodeRx0") || force) {
|
||||
ostr << " m_pwrmodeRx0: " << m_pwrmodeRx0;
|
||||
}
|
||||
if (settingsKeys.contains("lpfBWRx1") || force) {
|
||||
ostr << " m_lpfBWRx1: " << m_lpfBWRx1;
|
||||
}
|
||||
if (settingsKeys.contains("gainRx1") || force) {
|
||||
ostr << " m_gainRx1: " << m_gainRx1;
|
||||
}
|
||||
if (settingsKeys.contains("gainModeRx1") || force) {
|
||||
ostr << " m_gainModeRx1: " << m_gainModeRx1;
|
||||
}
|
||||
if (settingsKeys.contains("lnaGainRx1") || force) {
|
||||
ostr << " m_lnaGainRx1: " << m_lnaGainRx1;
|
||||
}
|
||||
if (settingsKeys.contains("tiaGainRx1") || force) {
|
||||
ostr << " m_tiaGainRx1: " << m_tiaGainRx1;
|
||||
}
|
||||
if (settingsKeys.contains("pgaGainRx1") || force) {
|
||||
ostr << " m_pgaGainRx1: " << m_pgaGainRx1;
|
||||
}
|
||||
if (settingsKeys.contains("pwrmodeRx1") || force) {
|
||||
ostr << " m_pwrmodeRx1: " << m_pwrmodeRx1;
|
||||
}
|
||||
if (settingsKeys.contains("txDevSampleRate") || force) {
|
||||
ostr << " m_txDevSampleRate: " << m_txDevSampleRate;
|
||||
}
|
||||
if (settingsKeys.contains("txCenterFrequency") || force) {
|
||||
ostr << " m_txCenterFrequency: " << m_txCenterFrequency;
|
||||
}
|
||||
if (settingsKeys.contains("log2HardInterp") || force) {
|
||||
ostr << " m_log2HardInterp: " << m_log2HardInterp;
|
||||
}
|
||||
if (settingsKeys.contains("log2SoftInterp") || force) {
|
||||
ostr << " m_log2SoftInterp: " << m_log2SoftInterp;
|
||||
}
|
||||
if (settingsKeys.contains("ncoEnableTx") || force) {
|
||||
ostr << " m_ncoEnableTx: " << m_ncoEnableTx;
|
||||
}
|
||||
if (settingsKeys.contains("ncoFrequencyTx") || force) {
|
||||
ostr << " m_ncoFrequencyTx: " << m_ncoFrequencyTx;
|
||||
}
|
||||
if (settingsKeys.contains("antennaPathTx") || force) {
|
||||
ostr << " m_antennaPathTx: " << m_antennaPathTx;
|
||||
}
|
||||
if (settingsKeys.contains("lpfBWTx0") || force) {
|
||||
ostr << " m_lpfBWTx0: " << m_lpfBWTx0;
|
||||
}
|
||||
if (settingsKeys.contains("gainTx0") || force) {
|
||||
ostr << " m_gainTx0: " << m_gainTx0;
|
||||
}
|
||||
if (settingsKeys.contains("pwrmodeTx0") || force) {
|
||||
ostr << " m_pwrmodeTx0: " << m_pwrmodeTx0;
|
||||
}
|
||||
if (settingsKeys.contains("lpfBWTx1") || force) {
|
||||
ostr << " m_lpfBWTx1: " << m_lpfBWTx1;
|
||||
}
|
||||
if (settingsKeys.contains("gainTx1") || force) {
|
||||
ostr << " m_gainTx1: " << m_gainTx1;
|
||||
}
|
||||
if (settingsKeys.contains("pwrmodeTx1") || force) {
|
||||
ostr << " m_pwrmodeTx1: " << m_pwrmodeTx1;
|
||||
}
|
||||
|
||||
return QString(ostr.str().c_str());
|
||||
}
|
||||
|
@ -98,6 +98,8 @@ struct XTRXMIMOSettings
|
||||
void resetToDefaults();
|
||||
QByteArray serialize() const;
|
||||
bool deserialize(const QByteArray& data);
|
||||
void applySettings(const QStringList& settingsKeys, const XTRXMIMOSettings& settings);
|
||||
QString getDebugString(const QStringList& settingsKeys, bool force=false) const;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user