1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-04-06 11:39:02 -04:00

BFM demod: update spectrum with sample rate information by polling

This commit is contained in:
f4exb 2015-12-08 09:25:46 +01:00
parent 4aaaad2fe9
commit 205fee6837
2 changed files with 12 additions and 7 deletions

View File

@ -252,7 +252,8 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
m_pluginAPI(pluginAPI),
m_channelMarker(this),
m_basicSettingsShown(false),
m_channelPowerDbAvg(20,0)
m_channelPowerDbAvg(20,0),
m_rate(625000)
{
ui->setupUi(this);
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));
@ -268,12 +269,8 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this);
DSPEngine::instance()->addThreadedSink(m_threadedChannelizer);
//ui->glSpectrum->setCenterFrequency(BFMDemodGUI::m_rfBW[ui->rfBW->value()] / 4);
//ui->glSpectrum->setSampleRate(BFMDemodGUI::m_rfBW[ui->rfBW->value()] / 2);
ui->glSpectrum->setCenterFrequency(625000 / 4);
ui->glSpectrum->setSampleRate(625000 / 2);
//ui->glSpectrum->setCenterFrequency(48000 / 4);
//ui->glSpectrum->setSampleRate(48000 / 2);
ui->glSpectrum->setCenterFrequency(m_rate / 4);
ui->glSpectrum->setSampleRate(m_rate / 2);
ui->glSpectrum->setDisplayWaterfall(false);
ui->glSpectrum->setDisplayMaxHold(false);
ui->glSpectrum->setSsbSpectrum(true);
@ -366,5 +363,12 @@ void BFMDemodGUI::tick()
}
}
if ((m_bfmDemod) && (m_rate != m_bfmDemod->getSampleRate()))
{
m_rate = m_bfmDemod->getSampleRate();
ui->glSpectrum->setCenterFrequency(m_rate / 4);
ui->glSpectrum->setSampleRate(m_rate / 2);
}
//qDebug() << "Pilot lock: " << m_bfmDemod->getPilotLock() << ":" << m_bfmDemod->getPilotLevel(); TODO: update a GUI item with status
}

View File

@ -78,6 +78,7 @@ private:
BFMDemod* m_bfmDemod;
MovingAverage<Real> m_channelPowerDbAvg;
int m_rate;
static const int m_rfBW[];