mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-07-11 13:24:19 -04:00
LimeSDR: cleaned up apply settings method code removing obsolete suspend/resume threads logic
This commit is contained in:
@@ -625,10 +625,7 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
|
||||
bool forwardChangeOwnDSP = false;
|
||||
bool forwardChangeTxDSP = false;
|
||||
bool forwardChangeAllDSP = false;
|
||||
bool suspendOwnThread = false;
|
||||
bool ownThreadWasRunning = false;
|
||||
bool suspendTxThread = false;
|
||||
bool suspendAllThread = false;
|
||||
bool doCalibration = false;
|
||||
double clockGenFreq = 0.0;
|
||||
// QMutexLocker mutexLocker(&m_mutex);
|
||||
@@ -642,62 +639,6 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
|
||||
qDebug() << "LimeSDROutput::applySettings: clock gen frequency: " << clockGenFreq;
|
||||
}
|
||||
|
||||
// determine if buddies threads or own thread need to be suspended
|
||||
|
||||
if ((m_settings.m_devSampleRate != settings.m_devSampleRate) ||
|
||||
(m_settings.m_log2HardInterp != settings.m_log2HardInterp) ||force)
|
||||
{
|
||||
suspendAllThread = false;
|
||||
}
|
||||
|
||||
if ((m_settings.m_centerFrequency != settings.m_centerFrequency) || force)
|
||||
{
|
||||
suspendTxThread = false;
|
||||
}
|
||||
|
||||
if ((m_settings.m_gain != settings.m_gain) ||
|
||||
(m_settings.m_lpfBW != settings.m_lpfBW) ||
|
||||
(m_settings.m_lpfFIRBW != settings.m_lpfFIRBW) ||
|
||||
(m_settings.m_lpfFIREnable != settings.m_lpfFIREnable) ||
|
||||
(m_settings.m_ncoEnable != settings.m_ncoEnable) ||
|
||||
(m_settings.m_ncoFrequency != settings.m_ncoFrequency) ||
|
||||
(m_settings.m_log2SoftInterp != settings.m_log2SoftInterp) || force)
|
||||
{
|
||||
suspendOwnThread = false;
|
||||
}
|
||||
|
||||
// suspend buddies threads or own thread
|
||||
|
||||
if (suspendAllThread)
|
||||
{
|
||||
suspendRxBuddies();
|
||||
suspendTxBuddies();
|
||||
|
||||
if (m_limeSDROutputThread && m_limeSDROutputThread->isRunning())
|
||||
{
|
||||
m_limeSDROutputThread->stopWork();
|
||||
ownThreadWasRunning = true;
|
||||
}
|
||||
}
|
||||
else if (suspendTxThread)
|
||||
{
|
||||
suspendTxBuddies();
|
||||
|
||||
if (m_limeSDROutputThread && m_limeSDROutputThread->isRunning())
|
||||
{
|
||||
m_limeSDROutputThread->stopWork();
|
||||
ownThreadWasRunning = true;
|
||||
}
|
||||
}
|
||||
else if (suspendOwnThread)
|
||||
{
|
||||
if (m_limeSDROutputThread && m_limeSDROutputThread->isRunning())
|
||||
{
|
||||
m_limeSDROutputThread->stopWork();
|
||||
ownThreadWasRunning = true;
|
||||
}
|
||||
}
|
||||
|
||||
// apply settings
|
||||
|
||||
if ((m_settings.m_gain != settings.m_gain) || force)
|
||||
@@ -928,32 +869,6 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
|
||||
}
|
||||
}
|
||||
|
||||
// resume buddies threads or own thread
|
||||
|
||||
if (suspendAllThread)
|
||||
{
|
||||
resumeTxBuddies();
|
||||
resumeRxBuddies();
|
||||
|
||||
if (ownThreadWasRunning) {
|
||||
m_limeSDROutputThread->startWork();
|
||||
}
|
||||
}
|
||||
else if (suspendTxThread)
|
||||
{
|
||||
resumeTxBuddies();
|
||||
|
||||
if (ownThreadWasRunning) {
|
||||
m_limeSDROutputThread->startWork();
|
||||
}
|
||||
}
|
||||
else if (ownThreadWasRunning)
|
||||
{
|
||||
if (m_limeSDROutputThread) {
|
||||
m_limeSDROutputThread->startWork();
|
||||
}
|
||||
}
|
||||
|
||||
// forward changes to buddies or oneself
|
||||
|
||||
if (forwardChangeAllDSP)
|
||||
|
||||
Reference in New Issue
Block a user