1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

Deep redesign: Init sequence review phase #5: fixed source message forwarding for other sample sources

This commit is contained in:
f4exb 2015-08-19 22:12:08 +02:00
parent 23c956cf17
commit 60a8946ce4
4 changed files with 30 additions and 2 deletions

View File

@ -19,7 +19,6 @@
#include <QDebug>
#include "util/simpleserializer.h"
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "bladerfgui.h"
#include "bladerfinput.h"

View File

@ -21,6 +21,7 @@
#include "fcdthread.h"
#include "fcdgui.h"
#include "qthid.h"
#include "dsp/dspcommands.h"
#include "util/simpleserializer.h"
MESSAGE_CLASS_DEFINITION(FCDInput::MsgConfigureFCD, Message)
@ -179,6 +180,12 @@ void FCDInput::applySettings(const Settings& settings, bool force)
set_lna_gain(settings.gain > 0);
set_bias_t(settings.bias > 0);
}
if (sampleSourcChange)
{
DSPSignalNotification *notif = new DSPSignalNotification(960000, m_settings.centerFrequency);
getOutputMessageQueue()->push(notif);
}
}
void FCDInput::set_center_freq(double freq)

View File

@ -19,6 +19,7 @@
#include <QDebug>
#include "util/simpleserializer.h"
#include "dsp/dspcommands.h"
#include "dsp/filesink.h"
#include "filesourcegui.h"
@ -273,6 +274,9 @@ bool FileSourceInput::applySettings(const Settings& settings, bool force)
}
}
DSPSignalNotification *notif = new DSPSignalNotification(m_sampleRate, m_centerFrequency);
getOutputMessageQueue()->push(notif);
qDebug() << "FileSourceInput::applySettings:"
<< " file name: " << settings.m_fileName.toStdString().c_str()
<< " center freq: " << m_centerFrequency << " Hz"

View File

@ -20,6 +20,7 @@
#include "rtlsdrinput.h"
#include "rtlsdrthread.h"
#include "rtlsdrgui.h"
#include "dsp/dspcommands.h"
#include "util/simpleserializer.h"
MESSAGE_CLASS_DEFINITION(RTLSDRInput::MsgConfigureRTLSDR, Message)
@ -259,6 +260,7 @@ bool RTLSDRInput::handleMessage(const Message& message)
bool RTLSDRInput::applySettings(const Settings& settings, bool force)
{
QMutexLocker mutexLocker(&m_mutex);
bool forwardChange = false;
if ((m_settings.m_gain != settings.m_gain) || force)
{
@ -275,6 +277,8 @@ bool RTLSDRInput::applySettings(const Settings& settings, bool force)
if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || force)
{
forwardChange = true;
if(m_dev != 0)
{
if( rtlsdr_set_sample_rate(m_dev, settings.m_devSampleRate) < 0)
@ -306,6 +310,8 @@ bool RTLSDRInput::applySettings(const Settings& settings, bool force)
if ((m_settings.m_log2Decim != settings.m_log2Decim) || force)
{
forwardChange = true;
if(m_dev != 0)
{
m_settings.m_log2Decim = settings.m_log2Decim;
@ -313,6 +319,11 @@ bool RTLSDRInput::applySettings(const Settings& settings, bool force)
}
}
if (m_settings.m_centerFrequency != settings.m_centerFrequency)
{
forwardChange = true;
}
m_settings.m_centerFrequency = settings.m_centerFrequency;
if(m_dev != 0)
@ -334,6 +345,13 @@ bool RTLSDRInput::applySettings(const Settings& settings, bool force)
}
}
if (forwardChange)
{
int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2Decim);
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency);
getOutputMessageQueue()->push(notif);
}
return true;
}