mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-06-16 05:22:54 -04:00
XTRX input: Make settings assignments atomic. Part of #1329
This commit is contained in:
parent
d2fbdad736
commit
96d0bef47e
@ -198,7 +198,7 @@ void XTRXInput::closeDevice()
|
|||||||
|
|
||||||
void XTRXInput::init()
|
void XTRXInput::init()
|
||||||
{
|
{
|
||||||
applySettings(m_settings, true, false);
|
applySettings(m_settings, QList<QString>(), true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
XTRXInputThread *XTRXInput::findThread()
|
XTRXInputThread *XTRXInput::findThread()
|
||||||
@ -353,7 +353,7 @@ bool XTRXInput::start()
|
|||||||
xtrxInputThread->setFifo(requestedChannel, &m_sampleFifo);
|
xtrxInputThread->setFifo(requestedChannel, &m_sampleFifo);
|
||||||
xtrxInputThread->setLog2Decimation(requestedChannel, m_settings.m_log2SoftDecim);
|
xtrxInputThread->setLog2Decimation(requestedChannel, m_settings.m_log2SoftDecim);
|
||||||
|
|
||||||
applySettings(m_settings, true);
|
applySettings(m_settings, QList<QString>(), true);
|
||||||
|
|
||||||
if (needsStart)
|
if (needsStart)
|
||||||
{
|
{
|
||||||
@ -429,7 +429,7 @@ void XTRXInput::stop()
|
|||||||
((DeviceXTRXShared*) (*it)->getBuddySharedPtr())->m_source->setThread(nullptr);
|
((DeviceXTRXShared*) (*it)->getBuddySharedPtr())->m_source->setThread(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
applySettings(m_settings, true);
|
applySettings(m_settings, QList<QString>(), true);
|
||||||
xtrxInputThread->startWork();
|
xtrxInputThread->startWork();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -491,12 +491,12 @@ bool XTRXInput::deserialize(const QByteArray& data)
|
|||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
MsgConfigureXTRX* message = MsgConfigureXTRX::create(m_settings, true);
|
MsgConfigureXTRX* message = MsgConfigureXTRX::create(m_settings, QList<QString>(), true);
|
||||||
m_inputMessageQueue.push(message);
|
m_inputMessageQueue.push(message);
|
||||||
|
|
||||||
if (m_guiMessageQueue)
|
if (m_guiMessageQueue)
|
||||||
{
|
{
|
||||||
MsgConfigureXTRX* messageToGUI = MsgConfigureXTRX::create(m_settings, true);
|
MsgConfigureXTRX* messageToGUI = MsgConfigureXTRX::create(m_settings, QList<QString>(), true);
|
||||||
m_guiMessageQueue->push(messageToGUI);
|
m_guiMessageQueue->push(messageToGUI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -556,12 +556,12 @@ void XTRXInput::setCenterFrequency(qint64 centerFrequency)
|
|||||||
XTRXInputSettings settings = m_settings;
|
XTRXInputSettings settings = m_settings;
|
||||||
settings.m_centerFrequency = centerFrequency - (m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0);
|
settings.m_centerFrequency = centerFrequency - (m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0);
|
||||||
|
|
||||||
MsgConfigureXTRX* message = MsgConfigureXTRX::create(settings, false);
|
MsgConfigureXTRX* message = MsgConfigureXTRX::create(settings, QList<QString>{"centerFrequency"}, false);
|
||||||
m_inputMessageQueue.push(message);
|
m_inputMessageQueue.push(message);
|
||||||
|
|
||||||
if (m_guiMessageQueue)
|
if (m_guiMessageQueue)
|
||||||
{
|
{
|
||||||
MsgConfigureXTRX* messageToGUI = MsgConfigureXTRX::create(settings, false);
|
MsgConfigureXTRX* messageToGUI = MsgConfigureXTRX::create(settings, QList<QString>{"centerFrequency"}, false);
|
||||||
m_guiMessageQueue->push(messageToGUI);
|
m_guiMessageQueue->push(messageToGUI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -605,7 +605,7 @@ bool XTRXInput::handleMessage(const Message& message)
|
|||||||
MsgConfigureXTRX& conf = (MsgConfigureXTRX&) message;
|
MsgConfigureXTRX& conf = (MsgConfigureXTRX&) message;
|
||||||
qDebug() << "XTRXInput::handleMessage: MsgConfigureXTRX";
|
qDebug() << "XTRXInput::handleMessage: MsgConfigureXTRX";
|
||||||
|
|
||||||
if (!applySettings(conf.getSettings(), conf.getForce()))
|
if (!applySettings(conf.getSettings(), conf.getSettingsKeys(), conf.getForce()))
|
||||||
{
|
{
|
||||||
qDebug("XTRXInput::handleMessage config error");
|
qDebug("XTRXInput::handleMessage config error");
|
||||||
}
|
}
|
||||||
@ -634,7 +634,7 @@ bool XTRXInput::handleMessage(const Message& message)
|
|||||||
<< " m_log2HardDecim: " << m_settings.m_log2HardDecim;
|
<< " m_log2HardDecim: " << m_settings.m_log2HardDecim;
|
||||||
|
|
||||||
if (m_settings.m_ncoEnable) { // need to reset NCO after sample rate change
|
if (m_settings.m_ncoEnable) { // need to reset NCO after sample rate change
|
||||||
applySettings(m_settings, false, true);
|
applySettings(m_settings, QList<QString>{"ncoEnable"}, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ncoShift = m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0;
|
int ncoShift = m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0;
|
||||||
@ -829,11 +829,11 @@ void XTRXInput::apply_gain_pga(double gain)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, bool forceNCOFrequency)
|
bool XTRXInput::applySettings(const XTRXInputSettings& settings, const QList<QString>& settingsKeys, bool force, bool forceNCOFrequency)
|
||||||
{
|
{
|
||||||
|
qDebug() << "XTRXInput::applySettings: force:" << force << " forceNCOFrequency:" << forceNCOFrequency << settings.getDebugString(settingsKeys, force);
|
||||||
int requestedChannel = m_deviceAPI->getDeviceItemIndex();
|
int requestedChannel = m_deviceAPI->getDeviceItemIndex();
|
||||||
XTRXInputThread *inputThread = findThread();
|
XTRXInputThread *inputThread = findThread();
|
||||||
QList<QString> reverseAPIKeys;
|
|
||||||
|
|
||||||
bool forwardChangeOwnDSP = false;
|
bool forwardChangeOwnDSP = false;
|
||||||
bool forwardChangeRxDSP = false;
|
bool forwardChangeRxDSP = false;
|
||||||
@ -848,43 +848,12 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
|
|||||||
bool doGainTia = false;
|
bool doGainTia = false;
|
||||||
bool doGainPga = false;
|
bool doGainPga = false;
|
||||||
|
|
||||||
// apply settings
|
if (settingsKeys.contains("dcBlock") || settingsKeys.contains("iqCorrection") || force) {
|
||||||
|
|
||||||
qDebug() << "XTRXInput::applySettings: center freq: " << settings.m_centerFrequency << " Hz"
|
|
||||||
<< " device stream sample rate: " << getDevSampleRate() << "S/s"
|
|
||||||
<< " sample rate with soft decimation: " << getSampleRate() << "S/s"
|
|
||||||
<< " m_devSampleRate: " << settings.m_devSampleRate
|
|
||||||
<< " m_dcBlock: " << settings.m_dcBlock
|
|
||||||
<< " m_iqCorrection: " << settings.m_iqCorrection
|
|
||||||
<< " m_log2SoftDecim: " << settings.m_log2SoftDecim
|
|
||||||
<< " m_gain: " << settings.m_gain
|
|
||||||
<< " m_lpfBW: " << settings.m_lpfBW
|
|
||||||
<< " m_pwrmode: " << settings.m_pwrmode
|
|
||||||
<< " m_ncoEnable: " << settings.m_ncoEnable
|
|
||||||
<< " m_ncoFrequency: " << settings.m_ncoFrequency
|
|
||||||
<< " m_antennaPath: " << settings.m_antennaPath
|
|
||||||
<< " m_extClock: " << settings.m_extClock
|
|
||||||
<< " m_extClockFreq: " << settings.m_extClockFreq
|
|
||||||
<< " force: " << force
|
|
||||||
<< " forceNCOFrequency: " << forceNCOFrequency
|
|
||||||
<< " doLPCalibration: " << doLPCalibration;
|
|
||||||
|
|
||||||
if ((m_settings.m_dcBlock != settings.m_dcBlock) || force)
|
|
||||||
{
|
|
||||||
reverseAPIKeys.append("dcBlock");
|
|
||||||
m_deviceAPI->configureCorrections(settings.m_dcBlock, settings.m_iqCorrection);
|
m_deviceAPI->configureCorrections(settings.m_dcBlock, settings.m_iqCorrection);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_settings.m_iqCorrection != settings.m_iqCorrection) || force)
|
if (settingsKeys.contains("pwrmode") || force)
|
||||||
{
|
{
|
||||||
reverseAPIKeys.append("iqCorrection");
|
|
||||||
m_deviceAPI->configureCorrections(settings.m_dcBlock, settings.m_iqCorrection);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((m_settings.m_pwrmode != settings.m_pwrmode))
|
|
||||||
{
|
|
||||||
reverseAPIKeys.append("pwrmode");
|
|
||||||
|
|
||||||
if (m_deviceShared.m_dev->getDevice())
|
if (m_deviceShared.m_dev->getDevice())
|
||||||
{
|
{
|
||||||
if (xtrx_val_set(m_deviceShared.m_dev->getDevice(),
|
if (xtrx_val_set(m_deviceShared.m_dev->getDevice(),
|
||||||
@ -897,15 +866,8 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_settings.m_extClock != settings.m_extClock) || force) {
|
if (settingsKeys.contains("extClock")
|
||||||
reverseAPIKeys.append("extClock");
|
|| (settings.m_extClock && settingsKeys.contains("extClockFreq")) || force)
|
||||||
}
|
|
||||||
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 (m_deviceShared.m_dev->getDevice())
|
if (m_deviceShared.m_dev->getDevice())
|
||||||
{
|
{
|
||||||
@ -923,15 +885,8 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || force) {
|
if (settingsKeys.contains("devSampleRate")
|
||||||
reverseAPIKeys.append("devSampleRate");
|
|| settingsKeys.contains("log2HardDecim") || force)
|
||||||
}
|
|
||||||
if ((m_settings.m_log2HardDecim != settings.m_log2HardDecim) || force) {
|
|
||||||
reverseAPIKeys.append("log2HardDecim");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((m_settings.m_devSampleRate != settings.m_devSampleRate)
|
|
||||||
|| (m_settings.m_log2HardDecim != settings.m_log2HardDecim) || force)
|
|
||||||
{
|
{
|
||||||
forwardChangeAllDSP = true; //m_settings.m_devSampleRate != settings.m_devSampleRate;
|
forwardChangeAllDSP = true; //m_settings.m_devSampleRate != settings.m_devSampleRate;
|
||||||
|
|
||||||
@ -940,22 +895,6 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_settings.m_gainMode != settings.m_gainMode) || force) {
|
|
||||||
reverseAPIKeys.append("gainMode");
|
|
||||||
}
|
|
||||||
if ((m_settings.m_gain != settings.m_gain) || force) {
|
|
||||||
reverseAPIKeys.append("gain");
|
|
||||||
}
|
|
||||||
if ((m_settings.m_lnaGain != settings.m_lnaGain) || force) {
|
|
||||||
reverseAPIKeys.append("lnaGain");
|
|
||||||
}
|
|
||||||
if ((m_settings.m_tiaGain != settings.m_tiaGain) || force) {
|
|
||||||
reverseAPIKeys.append("tiaGain");
|
|
||||||
}
|
|
||||||
if ((m_settings.m_pgaGain != settings.m_pgaGain) || force) {
|
|
||||||
reverseAPIKeys.append("pgaGain");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_deviceShared.m_dev->getDevice())
|
if (m_deviceShared.m_dev->getDevice())
|
||||||
{
|
{
|
||||||
if ((m_settings.m_gainMode != settings.m_gainMode) || force)
|
if ((m_settings.m_gainMode != settings.m_gainMode) || force)
|
||||||
@ -973,28 +912,26 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
|
|||||||
}
|
}
|
||||||
else if (m_settings.m_gainMode == XTRXInputSettings::GAIN_AUTO)
|
else if (m_settings.m_gainMode == XTRXInputSettings::GAIN_AUTO)
|
||||||
{
|
{
|
||||||
if (m_settings.m_gain != settings.m_gain) {
|
if (settingsKeys.contains("gain")) {
|
||||||
doGainAuto = true;
|
doGainAuto = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_settings.m_gainMode == XTRXInputSettings::GAIN_MANUAL)
|
else if (m_settings.m_gainMode == XTRXInputSettings::GAIN_MANUAL)
|
||||||
{
|
{
|
||||||
if (m_settings.m_lnaGain != settings.m_lnaGain) {
|
if (settingsKeys.contains("lnaGain")) {
|
||||||
doGainLna = true;
|
doGainLna = true;
|
||||||
}
|
}
|
||||||
if (m_settings.m_tiaGain != settings.m_tiaGain) {
|
if (settingsKeys.contains("tiasGain")) {
|
||||||
doGainTia = true;
|
doGainTia = true;
|
||||||
}
|
}
|
||||||
if (m_settings.m_pgaGain != settings.m_pgaGain) {
|
if (settingsKeys.contains("pgaGain")) {
|
||||||
doGainPga = true;
|
doGainPga = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_settings.m_lpfBW != settings.m_lpfBW) || force)
|
if (settingsKeys.contains("lpfBW") || force)
|
||||||
{
|
{
|
||||||
reverseAPIKeys.append("lpfBW");
|
|
||||||
|
|
||||||
if (m_deviceShared.m_dev->getDevice()) {
|
if (m_deviceShared.m_dev->getDevice()) {
|
||||||
doLPCalibration = true;
|
doLPCalibration = true;
|
||||||
}
|
}
|
||||||
@ -1027,9 +964,8 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((m_settings.m_log2SoftDecim != settings.m_log2SoftDecim) || force)
|
if (settingsKeys.contains("log2SoftDecim") || force)
|
||||||
{
|
{
|
||||||
reverseAPIKeys.append("log2SoftDecim");
|
|
||||||
forwardChangeOwnDSP = true;
|
forwardChangeOwnDSP = true;
|
||||||
|
|
||||||
if (inputThread)
|
if (inputThread)
|
||||||
@ -1039,10 +975,8 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_settings.m_iqOrder != settings.m_iqOrder) || force)
|
if (settingsKeys.contains("iqOrder") || force)
|
||||||
{
|
{
|
||||||
reverseAPIKeys.append("iqOrder");
|
|
||||||
|
|
||||||
if (inputThread)
|
if (inputThread)
|
||||||
{
|
{
|
||||||
inputThread->setIQOrder(settings.m_iqOrder);
|
inputThread->setIQOrder(settings.m_iqOrder);
|
||||||
@ -1050,10 +984,8 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_settings.m_antennaPath != settings.m_antennaPath) || force)
|
if (settingsKeys.contains("antennaPath") || force)
|
||||||
{
|
{
|
||||||
reverseAPIKeys.append("antennaPath");
|
|
||||||
|
|
||||||
if (m_deviceShared.m_dev->getDevice())
|
if (m_deviceShared.m_dev->getDevice())
|
||||||
{
|
{
|
||||||
if (xtrx_set_antenna(m_deviceShared.m_dev->getDevice(), settings.m_antennaPath) < 0) {
|
if (xtrx_set_antenna(m_deviceShared.m_dev->getDevice(), settings.m_antennaPath) < 0) {
|
||||||
@ -1064,35 +996,31 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_settings.m_centerFrequency != settings.m_centerFrequency) || force)
|
if (settingsKeys.contains("centerFrequency") || force)
|
||||||
{
|
{
|
||||||
reverseAPIKeys.append("centerFrequency");
|
|
||||||
doChangeFreq = true;
|
doChangeFreq = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_settings.m_ncoFrequency != settings.m_ncoFrequency) || force) {
|
if (settingsKeys.contains("ncoFrequency")
|
||||||
reverseAPIKeys.append("ncoFrequency");
|
|| settingsKeys.contains("ncoEnable") || force)
|
||||||
}
|
|
||||||
if ((m_settings.m_ncoEnable != settings.m_ncoEnable) || force) {
|
|
||||||
reverseAPIKeys.append("ncoEnable");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((m_settings.m_ncoFrequency != settings.m_ncoFrequency)
|
|
||||||
|| (m_settings.m_ncoEnable != settings.m_ncoEnable) || force)
|
|
||||||
{
|
{
|
||||||
forceNCOFrequency = true;
|
forceNCOFrequency = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings.m_useReverseAPI)
|
if (settingsKeys.contains("useReverseAPI"))
|
||||||
{
|
{
|
||||||
bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) ||
|
bool fullUpdate = (settingsKeys.contains("useReverseAPI") && settings.m_useReverseAPI) ||
|
||||||
(m_settings.m_reverseAPIAddress != settings.m_reverseAPIAddress) ||
|
settingsKeys.contains("reverseAPIAddress") ||
|
||||||
(m_settings.m_reverseAPIPort != settings.m_reverseAPIPort) ||
|
settingsKeys.contains("reverseAPIPort") ||
|
||||||
(m_settings.m_reverseAPIDeviceIndex != settings.m_reverseAPIDeviceIndex);
|
settingsKeys.contains("reverseAPIDeviceIndex");
|
||||||
webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
|
webapiReverseSendSettings(settingsKeys, settings, fullUpdate || force);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_settings = settings;
|
if (force) {
|
||||||
|
m_settings = settings;
|
||||||
|
} else {
|
||||||
|
m_settings.applySettings(settingsKeys, settings);
|
||||||
|
}
|
||||||
|
|
||||||
if (doChangeSampleRate && (m_settings.m_devSampleRate != 0))
|
if (doChangeSampleRate && (m_settings.m_devSampleRate != 0))
|
||||||
{
|
{
|
||||||
@ -1144,20 +1072,16 @@ bool XTRXInput::applySettings(const XTRXInputSettings& settings, bool force, boo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doGainAuto)
|
if (doGainAuto) {
|
||||||
{
|
|
||||||
apply_gain_auto(m_settings.m_gain);
|
apply_gain_auto(m_settings.m_gain);
|
||||||
}
|
}
|
||||||
if (doGainLna)
|
if (doGainLna) {
|
||||||
{
|
|
||||||
apply_gain_lna(m_settings.m_lnaGain);
|
apply_gain_lna(m_settings.m_lnaGain);
|
||||||
}
|
}
|
||||||
if (doGainTia)
|
if (doGainTia) {
|
||||||
{
|
|
||||||
apply_gain_tia(tia_to_db(m_settings.m_tiaGain));
|
apply_gain_tia(tia_to_db(m_settings.m_tiaGain));
|
||||||
}
|
}
|
||||||
if (doGainPga)
|
if (doGainPga) {
|
||||||
{
|
|
||||||
apply_gain_pga(m_settings.m_pgaGain);
|
apply_gain_pga(m_settings.m_pgaGain);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1335,12 +1259,12 @@ int XTRXInput::webapiSettingsPutPatch(
|
|||||||
XTRXInputSettings settings = m_settings;
|
XTRXInputSettings settings = m_settings;
|
||||||
webapiUpdateDeviceSettings(settings, deviceSettingsKeys, response);
|
webapiUpdateDeviceSettings(settings, deviceSettingsKeys, response);
|
||||||
|
|
||||||
MsgConfigureXTRX *msg = MsgConfigureXTRX::create(settings, force);
|
MsgConfigureXTRX *msg = MsgConfigureXTRX::create(settings, deviceSettingsKeys, force);
|
||||||
m_inputMessageQueue.push(msg);
|
m_inputMessageQueue.push(msg);
|
||||||
|
|
||||||
if (m_guiMessageQueue) // forward to GUI if any
|
if (m_guiMessageQueue) // forward to GUI if any
|
||||||
{
|
{
|
||||||
MsgConfigureXTRX *msgToGUI = MsgConfigureXTRX::create(settings, force);
|
MsgConfigureXTRX *msgToGUI = MsgConfigureXTRX::create(settings, deviceSettingsKeys, force);
|
||||||
m_guiMessageQueue->push(msgToGUI);
|
m_guiMessageQueue->push(msgToGUI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1522,7 +1446,7 @@ void XTRXInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response)
|
|||||||
response.getXtrxInputReport()->setGpsLock(gpsStatus ? 1 : 0);
|
response.getXtrxInputReport()->setGpsLock(gpsStatus ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XTRXInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const XTRXInputSettings& settings, bool force)
|
void XTRXInput::webapiReverseSendSettings(const QList<QString>& deviceSettingsKeys, const XTRXInputSettings& settings, bool force)
|
||||||
{
|
{
|
||||||
SWGSDRangel::SWGDeviceSettings *swgDeviceSettings = new SWGSDRangel::SWGDeviceSettings();
|
SWGSDRangel::SWGDeviceSettings *swgDeviceSettings = new SWGSDRangel::SWGDeviceSettings();
|
||||||
swgDeviceSettings->setDirection(0); // single Rx
|
swgDeviceSettings->setDirection(0); // single Rx
|
||||||
|
@ -41,22 +41,24 @@ public:
|
|||||||
class MsgConfigureXTRX : public Message {
|
class MsgConfigureXTRX : public Message {
|
||||||
MESSAGE_CLASS_DECLARATION
|
MESSAGE_CLASS_DECLARATION
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const XTRXInputSettings& getSettings() const { return m_settings; }
|
const XTRXInputSettings& getSettings() const { return m_settings; }
|
||||||
|
const QList<QString>& getSettingsKeys() const { return m_settingsKeys; }
|
||||||
bool getForce() const { return m_force; }
|
bool getForce() const { return m_force; }
|
||||||
|
|
||||||
static MsgConfigureXTRX* create(const XTRXInputSettings& settings, bool force)
|
static MsgConfigureXTRX* create(const XTRXInputSettings& settings, const QList<QString>& settingsKeys, bool force) {
|
||||||
{
|
return new MsgConfigureXTRX(settings, settingsKeys, force);
|
||||||
return new MsgConfigureXTRX(settings, force);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XTRXInputSettings m_settings;
|
XTRXInputSettings m_settings;
|
||||||
|
QList<QString> m_settingsKeys;
|
||||||
bool m_force;
|
bool m_force;
|
||||||
|
|
||||||
MsgConfigureXTRX(const XTRXInputSettings& settings, bool force) :
|
MsgConfigureXTRX(const XTRXInputSettings& settings, const QList<QString>& settingsKeys, bool force) :
|
||||||
Message(),
|
Message(),
|
||||||
m_settings(settings),
|
m_settings(settings),
|
||||||
|
m_settingsKeys(settingsKeys),
|
||||||
m_force(force)
|
m_force(force)
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
@ -255,9 +257,9 @@ private:
|
|||||||
|
|
||||||
void suspendTxThread();
|
void suspendTxThread();
|
||||||
void resumeTxThread();
|
void resumeTxThread();
|
||||||
bool applySettings(const XTRXInputSettings& settings, bool force = false, bool forceNCOFrequency = false);
|
bool applySettings(const XTRXInputSettings& settings, const QList<QString>& settingsKeys, bool force = false, bool forceNCOFrequency = false);
|
||||||
void webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response);
|
void webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response);
|
||||||
void webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const XTRXInputSettings& settings, bool force);
|
void webapiReverseSendSettings(const QList<QString>& deviceSettingsKeys, const XTRXInputSettings& settings, bool force);
|
||||||
void webapiReverseSendStartStop(bool start);
|
void webapiReverseSendStartStop(bool start);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@ -101,6 +101,7 @@ void XTRXInputGUI::resetToDefaults()
|
|||||||
{
|
{
|
||||||
m_settings.resetToDefaults();
|
m_settings.resetToDefaults();
|
||||||
displaySettings();
|
displaySettings();
|
||||||
|
m_forceSettings = true;
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,7 +244,13 @@ void XTRXInputGUI::handleInputMessages()
|
|||||||
{
|
{
|
||||||
qDebug("XTRXInputGUI::handleInputMessages: MsgConfigureXTRX");
|
qDebug("XTRXInputGUI::handleInputMessages: MsgConfigureXTRX");
|
||||||
const XTRXInput::MsgConfigureXTRX& cfg = (XTRXInput::MsgConfigureXTRX&) *message;
|
const XTRXInput::MsgConfigureXTRX& cfg = (XTRXInput::MsgConfigureXTRX&) *message;
|
||||||
m_settings = cfg.getSettings();
|
|
||||||
|
if (cfg.getForce()) {
|
||||||
|
m_settings = cfg.getSettings();
|
||||||
|
} else {
|
||||||
|
m_settings.applySettings(cfg.getSettingsKeys(), cfg.getSettings());
|
||||||
|
}
|
||||||
|
|
||||||
displaySettings();
|
displaySettings();
|
||||||
|
|
||||||
delete message;
|
delete message;
|
||||||
@ -399,8 +406,9 @@ void XTRXInputGUI::setCenterFrequencySetting(uint64_t kHzValue)
|
|||||||
|
|
||||||
void XTRXInputGUI::sendSettings()
|
void XTRXInputGUI::sendSettings()
|
||||||
{
|
{
|
||||||
if(!m_updateTimer.isActive())
|
if (!m_updateTimer.isActive()) {
|
||||||
m_updateTimer.start(100);
|
m_updateTimer.start(100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XTRXInputGUI::updateHardware()
|
void XTRXInputGUI::updateHardware()
|
||||||
@ -408,9 +416,10 @@ void XTRXInputGUI::updateHardware()
|
|||||||
if (m_doApplySettings)
|
if (m_doApplySettings)
|
||||||
{
|
{
|
||||||
qDebug() << "XTRXInputGUI::updateHardware";
|
qDebug() << "XTRXInputGUI::updateHardware";
|
||||||
XTRXInput::MsgConfigureXTRX* message = XTRXInput::MsgConfigureXTRX::create(m_settings, m_forceSettings);
|
XTRXInput::MsgConfigureXTRX* message = XTRXInput::MsgConfigureXTRX::create(m_settings, m_settingsKeys, m_forceSettings);
|
||||||
m_XTRXInput->getInputMessageQueue()->push(message);
|
m_XTRXInput->getInputMessageQueue()->push(message);
|
||||||
m_forceSettings = false;
|
m_forceSettings = false;
|
||||||
|
m_settingsKeys.clear();
|
||||||
m_updateTimer.stop();
|
m_updateTimer.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -487,6 +496,7 @@ void XTRXInputGUI::on_startStop_toggled(bool checked)
|
|||||||
void XTRXInputGUI::on_centerFrequency_changed(quint64 value)
|
void XTRXInputGUI::on_centerFrequency_changed(quint64 value)
|
||||||
{
|
{
|
||||||
setCenterFrequencySetting(value);
|
setCenterFrequencySetting(value);
|
||||||
|
m_settingsKeys.append("centerFrequency");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,6 +504,7 @@ void XTRXInputGUI::on_ncoFrequency_changed(qint64 value)
|
|||||||
{
|
{
|
||||||
m_settings.m_ncoFrequency = value;
|
m_settings.m_ncoFrequency = value;
|
||||||
setCenterFrequencyDisplay();
|
setCenterFrequencyDisplay();
|
||||||
|
m_settingsKeys.append("ncoFrequency");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -501,18 +512,21 @@ void XTRXInputGUI::on_ncoEnable_toggled(bool checked)
|
|||||||
{
|
{
|
||||||
m_settings.m_ncoEnable = checked;
|
m_settings.m_ncoEnable = checked;
|
||||||
setCenterFrequencyDisplay();
|
setCenterFrequencyDisplay();
|
||||||
|
m_settingsKeys.append("ncoEnable");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void XTRXInputGUI::on_dcOffset_toggled(bool checked)
|
void XTRXInputGUI::on_dcOffset_toggled(bool checked)
|
||||||
{
|
{
|
||||||
m_settings.m_dcBlock = checked;
|
m_settings.m_dcBlock = checked;
|
||||||
|
m_settingsKeys.append("dcBlock");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void XTRXInputGUI::on_iqImbalance_toggled(bool checked)
|
void XTRXInputGUI::on_iqImbalance_toggled(bool checked)
|
||||||
{
|
{
|
||||||
m_settings.m_iqCorrection = checked;
|
m_settings.m_iqCorrection = checked;
|
||||||
|
m_settingsKeys.append("iqCorrection");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -526,6 +540,7 @@ void XTRXInputGUI::on_sampleRate_changed(quint64 value)
|
|||||||
|
|
||||||
updateADCRate();
|
updateADCRate();
|
||||||
setNCODisplay();
|
setNCODisplay();
|
||||||
|
m_settingsKeys.append("devSampleRate");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -536,6 +551,7 @@ void XTRXInputGUI::on_hwDecim_currentIndexChanged(int index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_settings.m_log2HardDecim = index;
|
m_settings.m_log2HardDecim = index;
|
||||||
|
m_settingsKeys.append("log2HardDecim");
|
||||||
|
|
||||||
updateADCRate();
|
updateADCRate();
|
||||||
setNCODisplay();
|
setNCODisplay();
|
||||||
@ -549,6 +565,7 @@ void XTRXInputGUI::on_swDecim_currentIndexChanged(int index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_settings.m_log2SoftDecim = index;
|
m_settings.m_log2SoftDecim = index;
|
||||||
|
m_settingsKeys.append("log2SoftDecim");
|
||||||
displaySampleRate();
|
displaySampleRate();
|
||||||
|
|
||||||
if (m_sampleRateMode) {
|
if (m_sampleRateMode) {
|
||||||
@ -557,18 +574,21 @@ void XTRXInputGUI::on_swDecim_currentIndexChanged(int index)
|
|||||||
m_settings.m_devSampleRate = ui->sampleRate->getValueNew() * (1 << m_settings.m_log2SoftDecim);
|
m_settings.m_devSampleRate = ui->sampleRate->getValueNew() * (1 << m_settings.m_log2SoftDecim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_settingsKeys.append("devSampleRate");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void XTRXInputGUI::on_lpf_changed(quint64 value)
|
void XTRXInputGUI::on_lpf_changed(quint64 value)
|
||||||
{
|
{
|
||||||
m_settings.m_lpfBW = value * 1000;
|
m_settings.m_lpfBW = value * 1000;
|
||||||
|
m_settingsKeys.append("lpfBW");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void XTRXInputGUI::on_gainMode_currentIndexChanged(int index)
|
void XTRXInputGUI::on_gainMode_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
m_settings.m_gainMode = (XTRXInputSettings::GainMode) index;
|
m_settings.m_gainMode = (XTRXInputSettings::GainMode) index;
|
||||||
|
m_settingsKeys.append("gainMode");
|
||||||
|
|
||||||
if (index == 0)
|
if (index == 0)
|
||||||
{
|
{
|
||||||
@ -592,6 +612,7 @@ void XTRXInputGUI::on_gain_valueChanged(int value)
|
|||||||
{
|
{
|
||||||
m_settings.m_gain = value;
|
m_settings.m_gain = value;
|
||||||
ui->gainText->setText(tr("%1").arg(m_settings.m_gain));
|
ui->gainText->setText(tr("%1").arg(m_settings.m_gain));
|
||||||
|
m_settingsKeys.append("gain");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -599,18 +620,21 @@ void XTRXInputGUI::on_lnaGain_valueChanged(int value)
|
|||||||
{
|
{
|
||||||
m_settings.m_lnaGain = value;
|
m_settings.m_lnaGain = value;
|
||||||
ui->lnaGainText->setText(tr("%1").arg(m_settings.m_lnaGain));
|
ui->lnaGainText->setText(tr("%1").arg(m_settings.m_lnaGain));
|
||||||
|
m_settingsKeys.append("lnaGain");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void XTRXInputGUI::on_tiaGain_currentIndexChanged(int index)
|
void XTRXInputGUI::on_tiaGain_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
m_settings.m_tiaGain = index + 1;
|
m_settings.m_tiaGain = index + 1;
|
||||||
|
m_settingsKeys.append("tiaGain");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void XTRXInputGUI::on_pgaGain_valueChanged(int value)
|
void XTRXInputGUI::on_pgaGain_valueChanged(int value)
|
||||||
{
|
{
|
||||||
m_settings.m_pgaGain = value;
|
m_settings.m_pgaGain = value;
|
||||||
|
m_settingsKeys.append("pgaGain");
|
||||||
ui->pgaGainText->setText(tr("%1").arg(m_settings.m_pgaGain));
|
ui->pgaGainText->setText(tr("%1").arg(m_settings.m_pgaGain));
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
@ -618,6 +642,7 @@ void XTRXInputGUI::on_pgaGain_valueChanged(int value)
|
|||||||
void XTRXInputGUI::on_antenna_currentIndexChanged(int index)
|
void XTRXInputGUI::on_antenna_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
m_settings.m_antennaPath = (xtrx_antenna_t) index;
|
m_settings.m_antennaPath = (xtrx_antenna_t) index;
|
||||||
|
m_settingsKeys.append("antennaPath");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -625,6 +650,8 @@ void XTRXInputGUI::on_extClock_clicked()
|
|||||||
{
|
{
|
||||||
m_settings.m_extClock = ui->extClock->getExternalClockActive();
|
m_settings.m_extClock = ui->extClock->getExternalClockActive();
|
||||||
m_settings.m_extClockFreq = ui->extClock->getExternalClockFrequency();
|
m_settings.m_extClockFreq = ui->extClock->getExternalClockFrequency();
|
||||||
|
m_settingsKeys.append("extClock");
|
||||||
|
m_settingsKeys.append("extClockFreq");
|
||||||
qDebug("XTRXInputGUI::on_extClock_clicked: %u Hz %s", m_settings.m_extClockFreq, m_settings.m_extClock ? "on" : "off");
|
qDebug("XTRXInputGUI::on_extClock_clicked: %u Hz %s", m_settings.m_extClockFreq, m_settings.m_extClock ? "on" : "off");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
@ -632,6 +659,7 @@ void XTRXInputGUI::on_extClock_clicked()
|
|||||||
void XTRXInputGUI::on_pwrmode_currentIndexChanged(int index)
|
void XTRXInputGUI::on_pwrmode_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
m_settings.m_pwrmode = index;
|
m_settings.m_pwrmode = index;
|
||||||
|
m_settingsKeys.append("pwrmode");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -658,6 +686,10 @@ void XTRXInputGUI::openDeviceSettingsDialog(const QPoint& p)
|
|||||||
m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
|
m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
|
||||||
m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
|
m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
|
||||||
m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
|
m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
|
||||||
|
m_settingsKeys.append("useReverseAPI");
|
||||||
|
m_settingsKeys.append("reverseAPIAddress");
|
||||||
|
m_settingsKeys.append("reverseAPIPort");
|
||||||
|
m_settingsKeys.append("reverseAPIDeviceIndex");
|
||||||
|
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,7 @@ private:
|
|||||||
|
|
||||||
XTRXInput* m_XTRXInput; //!< Same object as above but gives easy access to XTRXInput methods and attributes that are used intensively
|
XTRXInput* m_XTRXInput; //!< Same object as above but gives easy access to XTRXInput methods and attributes that are used intensively
|
||||||
XTRXInputSettings m_settings;
|
XTRXInputSettings m_settings;
|
||||||
|
QList<QString> m_settingsKeys;
|
||||||
bool m_sampleRateMode; //!< true: device, false: base band sample rate update mode
|
bool m_sampleRateMode; //!< true: device, false: base band sample rate update mode
|
||||||
QTimer m_updateTimer;
|
QTimer m_updateTimer;
|
||||||
QTimer m_statusTimer;
|
QTimer m_statusTimer;
|
||||||
|
@ -137,3 +137,153 @@ bool XTRXInputSettings::deserialize(const QByteArray& data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XTRXInputSettings::applySettings(const QStringList& settingsKeys, const XTRXInputSettings& settings)
|
||||||
|
{
|
||||||
|
if (settingsKeys.contains("centerFrequency")) {
|
||||||
|
m_centerFrequency = settings.m_centerFrequency;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("devSampleRate")) {
|
||||||
|
m_devSampleRate = settings.m_devSampleRate;
|
||||||
|
}
|
||||||
|
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("lpfBW")) {
|
||||||
|
m_lpfBW = settings.m_lpfBW;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("gain")) {
|
||||||
|
m_gain = settings.m_gain;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("ncoEnable")) {
|
||||||
|
m_ncoEnable = settings.m_ncoEnable;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("ncoFrequency")) {
|
||||||
|
m_ncoFrequency = settings.m_ncoFrequency;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("antennaPath")) {
|
||||||
|
m_antennaPath = settings.m_antennaPath;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("gainMode")) {
|
||||||
|
m_gainMode = settings.m_gainMode;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("lnaGain")) {
|
||||||
|
m_lnaGain = settings.m_lnaGain;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("tiaGain")) {
|
||||||
|
m_tiaGain = settings.m_tiaGain;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("pgaGain")) {
|
||||||
|
m_pgaGain = settings.m_pgaGain;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("extClock")) {
|
||||||
|
m_extClock = settings.m_extClock;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("extClockFreq")) {
|
||||||
|
m_extClockFreq = settings.m_extClockFreq;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("pwrmode")) {
|
||||||
|
m_pwrmode = settings.m_pwrmode;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("iqOrder")) {
|
||||||
|
m_iqOrder = settings.m_iqOrder;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QString XTRXInputSettings::getDebugString(const QStringList& settingsKeys, bool force) const
|
||||||
|
{
|
||||||
|
std::ostringstream ostr;
|
||||||
|
|
||||||
|
if (settingsKeys.contains("centerFrequency") || force) {
|
||||||
|
ostr << " m_centerFrequency: " << m_centerFrequency;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("devSampleRate") || force) {
|
||||||
|
ostr << " m_devSampleRate: " << m_devSampleRate;
|
||||||
|
}
|
||||||
|
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("lpfBW") || force) {
|
||||||
|
ostr << " m_lpfBW: " << m_lpfBW;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("gain") || force) {
|
||||||
|
ostr << " m_gain: " << m_gain;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("ncoEnable") || force) {
|
||||||
|
ostr << " m_ncoEnable: " << m_ncoEnable;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("ncoFrequency") || force) {
|
||||||
|
ostr << " m_ncoFrequency: " << m_ncoFrequency;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("antennaPath") || force) {
|
||||||
|
ostr << " m_antennaPath: " << m_antennaPath;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("gainMode") || force) {
|
||||||
|
ostr << " m_gainMode: " << m_gainMode;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("lnaGain") || force) {
|
||||||
|
ostr << " m_lnaGain: " << m_lnaGain;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("tiaGain") || force) {
|
||||||
|
ostr << " m_tiaGain: " << m_tiaGain;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("pgaGain") || force) {
|
||||||
|
ostr << " m_pgaGain: " << m_pgaGain;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("extClock") || force) {
|
||||||
|
ostr << " m_extClock: " << m_extClock;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("extClockFreq") || force) {
|
||||||
|
ostr << " m_extClockFreq: " << m_extClockFreq;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("pwrmode") || force) {
|
||||||
|
ostr << " m_pwrmode: " << m_pwrmode;
|
||||||
|
}
|
||||||
|
if (settingsKeys.contains("iqOrder") || force) {
|
||||||
|
ostr << " m_iqOrder: " << m_iqOrder;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
return QString(ostr.str().c_str());
|
||||||
|
}
|
||||||
|
@ -66,6 +66,8 @@ struct XTRXInputSettings
|
|||||||
void resetToDefaults();
|
void resetToDefaults();
|
||||||
QByteArray serialize() const;
|
QByteArray serialize() const;
|
||||||
bool deserialize(const QByteArray& data);
|
bool deserialize(const QByteArray& data);
|
||||||
|
void applySettings(const QStringList& settingsKeys, const XTRXInputSettings& settings);
|
||||||
|
QString getDebugString(const QStringList& settingsKeys, bool force=false) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* PLUGINS_SAMPLESOURCE_XTRXINPUT_XTRXINPUTSETTINGS_H_ */
|
#endif /* PLUGINS_SAMPLESOURCE_XTRXINPUT_XTRXINPUTSETTINGS_H_ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user