mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-05 23:45:00 -04:00
IQ swap: initial implementation in plugins
This commit is contained in:
@@ -53,7 +53,7 @@ AirspyHFInput::AirspyHFInput(DeviceAPI *deviceAPI) :
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_dev(0),
|
||||
m_airspyHFThread(0),
|
||||
m_airspyHFThread(nullptr),
|
||||
m_deviceDescription("AirspyHF"),
|
||||
m_running(false)
|
||||
{
|
||||
@@ -181,6 +181,7 @@ bool AirspyHFInput::start()
|
||||
}
|
||||
|
||||
m_airspyHFThread->setLog2Decimation(m_settings.m_log2Decim);
|
||||
m_airspyHFThread->setIQOrder(m_settings.m_iqOrder);
|
||||
m_airspyHFThread->startWork();
|
||||
|
||||
mutexLocker.unlock();
|
||||
@@ -210,11 +211,11 @@ void AirspyHFInput::stop()
|
||||
qDebug("AirspyHFInput::stop");
|
||||
QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
if (m_airspyHFThread != 0)
|
||||
if (m_airspyHFThread)
|
||||
{
|
||||
m_airspyHFThread->stopWork();
|
||||
delete m_airspyHFThread;
|
||||
m_airspyHFThread = 0;
|
||||
m_airspyHFThread = nullptr;
|
||||
}
|
||||
|
||||
m_running = false;
|
||||
@@ -445,7 +446,7 @@ bool AirspyHFInput::applySettings(const AirspyHFSettings& settings, bool force)
|
||||
{
|
||||
qCritical("AirspyHFInput::applySettings: could not set sample rate index %u (%d S/s)", sampleRateIndex, m_sampleRates[sampleRateIndex]);
|
||||
}
|
||||
else if (m_airspyHFThread != 0)
|
||||
else if (m_airspyHFThread)
|
||||
{
|
||||
qDebug("AirspyHFInput::applySettings: sample rate set to index: %u (%d S/s)", sampleRateIndex, m_sampleRates[sampleRateIndex]);
|
||||
m_airspyHFThread->setSamplerate(m_sampleRates[sampleRateIndex]);
|
||||
@@ -458,13 +459,22 @@ bool AirspyHFInput::applySettings(const AirspyHFSettings& settings, bool force)
|
||||
reverseAPIKeys.append("log2Decim");
|
||||
forwardChange = true;
|
||||
|
||||
if (m_airspyHFThread != 0)
|
||||
if (m_airspyHFThread)
|
||||
{
|
||||
m_airspyHFThread->setLog2Decimation(settings.m_log2Decim);
|
||||
qDebug() << "AirspyInput: set decimation to " << (1<<settings.m_log2Decim);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_iqOrder != settings.m_iqOrder) || force)
|
||||
{
|
||||
reverseAPIKeys.append("iqOrder");
|
||||
|
||||
if (m_airspyHFThread) {
|
||||
m_airspyHFThread->setIQOrder(settings.m_iqOrder);
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_LOppmTenths != settings.m_LOppmTenths) || force)
|
||||
{
|
||||
reverseAPIKeys.append("LOppmTenths");
|
||||
@@ -477,7 +487,7 @@ bool AirspyHFInput::applySettings(const AirspyHFSettings& settings, bool force)
|
||||
{
|
||||
qCritical("AirspyHFInput::applySettings: could not set LO ppm correction to %f", settings.m_LOppmTenths / 10.0f);
|
||||
}
|
||||
else if (m_airspyHFThread != 0)
|
||||
else if (m_airspyHFThread)
|
||||
{
|
||||
qDebug("AirspyHFInput::applySettings: LO ppm correction set to %f", settings.m_LOppmTenths / 10.0f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user