1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-04 16:01:14 -05:00

BFM demod: fixed missing channel configuration message handling

This commit is contained in:
f4exb 2017-10-21 10:35:03 +02:00
parent 79f46bec29
commit 32f284a0de
3 changed files with 24 additions and 12 deletions

View File

@ -324,6 +324,19 @@ bool BFMDemod::handleMessage(const Message& cmd)
return true; return true;
} }
else if (MsgConfigureChannelizer::match(cmd))
{
MsgConfigureChannelizer& cfg = (MsgConfigureChannelizer&) cmd;
m_channelizer->configure(m_channelizer->getInputMessageQueue(),
cfg.getSampleRate(),
cfg.getCenterFrequency());
qDebug() << "BFMDemod::handleMessage: MsgConfigureChannelizer: sampleRate: " << cfg.getSampleRate()
<< " centerFrequency: " << cfg.getCenterFrequency();
return true;
}
else if (MsgConfigureBFMDemod::match(cmd)) else if (MsgConfigureBFMDemod::match(cmd))
{ {
MsgConfigureBFMDemod& cfg = (MsgConfigureBFMDemod&) cmd; MsgConfigureBFMDemod& cfg = (MsgConfigureBFMDemod&) cmd;
@ -353,7 +366,7 @@ bool BFMDemod::handleMessage(const Message& cmd)
} }
else else
{ {
qDebug() << "BFMDemod::handleMessage: none"; qDebug() << "BFMDemod::handleMessage: passed: " << cmd.getIdentifier();
if (m_sampleSink != 0) if (m_sampleSink != 0)
{ {

View File

@ -138,14 +138,12 @@ void BFMDemodGUI::handleInputMessages()
} }
} }
void BFMDemodGUI::channelMarkerChanged() void BFMDemodGUI::channelMarkerUpdate()
{ {
setWindowTitle(m_channelMarker.getTitle());
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(), m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
m_settings.m_udpPort = m_channelMarker.getUDPSendPort(), m_settings.m_udpPort = m_channelMarker.getUDPSendPort(),
m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
displayUDPAddress(); displaySettings();
applySettings(); applySettings();
} }
@ -310,6 +308,11 @@ void BFMDemodGUI::onMenuDialogCalled(const QPoint &p)
BasicChannelSettingsDialog dialog(&m_channelMarker, this); BasicChannelSettingsDialog dialog(&m_channelMarker, this);
dialog.move(p); dialog.move(p);
dialog.exec(); dialog.exec();
if (dialog.hasChanged())
{
channelMarkerUpdate();
}
} }
BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent) : BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceSourceAPI *deviceAPI, QWidget* parent) :
@ -398,15 +401,11 @@ void BFMDemodGUI::applySettings(bool force)
{ {
if (m_doApplySettings) if (m_doApplySettings)
{ {
setTitleColor(m_channelMarker.getColor());
BFMDemod::MsgConfigureChannelizer *msgChan = BFMDemod::MsgConfigureChannelizer::create( BFMDemod::MsgConfigureChannelizer *msgChan = BFMDemod::MsgConfigureChannelizer::create(
requiredBW(BFMDemodSettings::getRFBW(ui->rfBW->value())), requiredBW(m_settings.m_rfBandwidth),
m_channelMarker.getCenterFrequency()); m_settings.m_inputFrequencyOffset);
m_bfmDemod->getInputMessageQueue()->push(msgChan); m_bfmDemod->getInputMessageQueue()->push(msgChan);
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
BFMDemod::MsgConfigureBFMDemod* msgConfig = BFMDemod::MsgConfigureBFMDemod::create( m_settings, force); BFMDemod::MsgConfigureBFMDemod* msgConfig = BFMDemod::MsgConfigureBFMDemod::create( m_settings, force);
m_bfmDemod->getInputMessageQueue()->push(msgConfig); m_bfmDemod->getInputMessageQueue()->push(msgConfig);
} }

View File

@ -59,7 +59,6 @@ public:
static const QString m_channelID; static const QString m_channelID;
private slots: private slots:
void channelMarkerChanged();
void on_deltaFrequency_changed(qint64 value); void on_deltaFrequency_changed(qint64 value);
void on_rfBW_valueChanged(int value); void on_rfBW_valueChanged(int value);
void on_afBW_valueChanged(int value); void on_afBW_valueChanged(int value);
@ -106,6 +105,7 @@ private:
void displayUDPAddress(); void displayUDPAddress();
void rdsUpdate(bool force); void rdsUpdate(bool force);
void rdsUpdateFixedFields(); void rdsUpdateFixedFields();
void channelMarkerUpdate();
void leaveEvent(QEvent*); void leaveEvent(QEvent*);
void enterEvent(QEvent*); void enterEvent(QEvent*);