1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 17:28:50 -05:00

BFM demod: fixed spectrum gui update when channel sample rate changes

This commit is contained in:
f4exb 2017-11-12 14:58:52 +01:00
parent db889c78f8
commit 8958edd4be
3 changed files with 7 additions and 13 deletions

View File

@ -86,8 +86,6 @@ BFMDemod::BFMDemod(DeviceSourceAPI *deviceAPI) :
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
connect(m_channelizer, SIGNAL(inputSampleRateChanged()), this, SLOT(channelSampleRateChanged()));
applySettings(m_settings, true);
}
@ -302,12 +300,6 @@ void BFMDemod::stop()
{
}
void BFMDemod::channelSampleRateChanged()
{
MsgReportChannelSampleRateChanged *msg = MsgReportChannelSampleRateChanged::create(getSampleRate());
getMessageQueueToGUI()->push(msg);
}
bool BFMDemod::handleMessage(const Message& cmd)
{
if (DownChannelizer::MsgChannelizerNotification::match(cmd))
@ -325,6 +317,12 @@ bool BFMDemod::handleMessage(const Message& cmd)
<< " m_inputSampleRate: " << settings.m_inputSampleRate
<< " m_inputFrequencyOffset: " << settings.m_inputFrequencyOffset;
if (getMessageQueueToGUI())
{
MsgReportChannelSampleRateChanged *msg = MsgReportChannelSampleRateChanged::create(getSampleRate());
getMessageQueueToGUI()->push(msg);
}
return true;
}
else if (MsgConfigureChannelizer::match(cmd))

View File

@ -146,9 +146,6 @@ public:
static const QString m_channelID;
private slots:
void channelSampleRateChanged();
private:
enum RateState {
RSInitialFill,

View File

@ -112,6 +112,7 @@ bool BFMDemodGUI::handleMessage(const Message& message)
{
BFMDemod::MsgReportChannelSampleRateChanged& report = (BFMDemod::MsgReportChannelSampleRateChanged&) message;
m_rate = report.getSampleRate();
qDebug("BFMDemodGUI::handleMessage: MsgReportChannelSampleRateChanged: %d S/s", m_rate);
ui->glSpectrum->setCenterFrequency(m_rate / 4);
ui->glSpectrum->setSampleRate(m_rate / 2);
return true;
@ -128,8 +129,6 @@ void BFMDemodGUI::handleInputMessages()
while ((message = getInputMessageQueue()->pop()) != 0)
{
qDebug("BFMDemodGUI::handleInputMessages: message: %s", message->getIdentifier());
if (handleMessage(*message))
{
delete message;