mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 09:48:45 -05:00
Frequency scanner: set device frequency for both Rx and MIMO devices
This commit is contained in:
parent
5ed6f060a0
commit
c5e9da7004
@ -35,7 +35,8 @@
|
|||||||
#include "device/deviceset.h"
|
#include "device/deviceset.h"
|
||||||
#include "dsp/dspengine.h"
|
#include "dsp/dspengine.h"
|
||||||
#include "dsp/dspcommands.h"
|
#include "dsp/dspcommands.h"
|
||||||
#include "dsp/morsedemod.h"
|
#include "dsp/devicesamplesource.h"
|
||||||
|
#include "dsp/devicesamplemimo.h"
|
||||||
#include "device/deviceapi.h"
|
#include "device/deviceapi.h"
|
||||||
#include "feature/feature.h"
|
#include "feature/feature.h"
|
||||||
#include "settings/serializable.h"
|
#include "settings/serializable.h"
|
||||||
@ -293,10 +294,17 @@ void FreqScanner::stopScan()
|
|||||||
|
|
||||||
void FreqScanner::setDeviceCenterFrequency(qint64 frequency)
|
void FreqScanner::setDeviceCenterFrequency(qint64 frequency)
|
||||||
{
|
{
|
||||||
// For RTL SDR, ChannelWebAPIUtils::setCenterFrequency takes ~50ms, which means tuneTime can be 0
|
DSPDeviceSourceEngine* deviceSourceEngine = getDeviceAPI()->getDeviceSourceEngine();
|
||||||
if (!ChannelWebAPIUtils::setCenterFrequency(getDeviceSetIndex(), frequency)) {
|
DSPDeviceMIMOEngine *deviceMIMOEngine = getDeviceAPI()->getDeviceMIMOEngine();
|
||||||
qWarning() << "Freq Scanner failed to set frequency" << frequency;
|
|
||||||
|
if (deviceSourceEngine) // Rx device
|
||||||
|
{
|
||||||
|
// For RTL SDR, setCenterFrequency takes ~50ms, which means tuneTime can be 0
|
||||||
|
getDeviceAPI()->getSampleSource()->setCenterFrequency(frequency);
|
||||||
|
} else if (deviceMIMOEngine) { // MIMO device - I/Q stream is the same as this channel
|
||||||
|
getDeviceAPI()->getSampleMIMO()->setSourceCenterFrequency(frequency, m_settings.m_streamIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_minFFTStartTime = QDateTime::currentDateTime().addMSecs(m_settings.m_tuneTime);
|
m_minFFTStartTime = QDateTime::currentDateTime().addMSecs(m_settings.m_tuneTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user