mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-05 19:18:38 -04:00
BFM demod: RDS GUI part #10: prepare ability to change frequency from frequency combo boxex. Need future channel plugin to its source plugin link to be implemented
This commit is contained in:
parent
044e0bfc27
commit
73ac0c58e5
@ -263,6 +263,10 @@ void BFMDemodGUI::on_clearData_clicked(bool checked)
|
||||
ui->g14MappedFrequencies->clear();
|
||||
ui->g14AltFrequencies->clear();
|
||||
|
||||
ui->g00AltFrequenciesBox->setEnabled(false);
|
||||
ui->g14MappedFrequencies->setEnabled(false);
|
||||
ui->g14AltFrequencies->setEnabled(false);
|
||||
|
||||
rdsUpdate(true);
|
||||
}
|
||||
}
|
||||
@ -286,6 +290,8 @@ void BFMDemodGUI::on_g14ProgServiceNames_currentIndexChanged(int index)
|
||||
os << std::fixed << std::showpoint << std::setprecision(2) << *sIt;
|
||||
ui->g14MappedFrequencies->addItem(os.str().c_str());
|
||||
}
|
||||
|
||||
ui->g14MappedFrequencies->setEnabled(ui->g14MappedFrequencies->count() > 0);
|
||||
}
|
||||
|
||||
mIt = m_rdsParser.m_g14_alt_freqs.find(piKey);
|
||||
@ -302,10 +308,31 @@ void BFMDemodGUI::on_g14ProgServiceNames_currentIndexChanged(int index)
|
||||
os << std::fixed << std::showpoint << std::setprecision(2) << *sIt;
|
||||
ui->g14AltFrequencies->addItem(os.str().c_str());
|
||||
}
|
||||
|
||||
ui->g14AltFrequencies->setEnabled(ui->g14AltFrequencies->count() > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BFMDemodGUI::on_g00AltFrequenciesBox_activated(int index)
|
||||
{
|
||||
qint64 f = (qint64) ((ui->g00AltFrequenciesBox->currentText()).toDouble() * 1e6);
|
||||
changeFrequency(f);
|
||||
}
|
||||
|
||||
void BFMDemodGUI::on_g14MappedFrequencies_activated(int index)
|
||||
{
|
||||
qint64 f = (qint64) ((ui->g14MappedFrequencies->currentText()).toDouble() * 1e6);
|
||||
changeFrequency(f);
|
||||
}
|
||||
|
||||
void BFMDemodGUI::on_g14AltFrequencies_activated(int index)
|
||||
{
|
||||
qint64 f = (qint64) ((ui->g14AltFrequencies->currentText()).toDouble() * 1e6);
|
||||
changeFrequency(f);
|
||||
}
|
||||
|
||||
|
||||
void BFMDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown)
|
||||
{
|
||||
}
|
||||
@ -364,6 +391,10 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) :
|
||||
|
||||
ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
|
||||
|
||||
ui->g00AltFrequenciesBox->setEnabled(false);
|
||||
ui->g14MappedFrequencies->setEnabled(false);
|
||||
ui->g14AltFrequencies->setEnabled(false);
|
||||
|
||||
rdsUpdateFixedFields();
|
||||
rdsUpdate(true);
|
||||
|
||||
@ -560,6 +591,8 @@ void BFMDemodGUI::rdsUpdate(bool force)
|
||||
ui->g00AltFrequenciesBox->addItem(QString(os.str().c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
ui->g00AltFrequenciesBox->setEnabled(ui->g00AltFrequenciesBox->count() > 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -699,3 +732,10 @@ void BFMDemodGUI::rdsUpdate(bool force)
|
||||
|
||||
m_rdsParser.clearUpdateFlags();
|
||||
}
|
||||
|
||||
void BFMDemodGUI::changeFrequency(qint64 f)
|
||||
{
|
||||
qint64 df = m_channelMarker.getCenterFrequency();
|
||||
qDebug() << "BFMDemodGUI::changeFrequency: " << f - df;
|
||||
// TODO: in the future it should be able to set the center frequency of the sample source this channel plugin is linked to
|
||||
}
|
||||
|
@ -67,6 +67,9 @@ private slots:
|
||||
void on_rds_clicked();
|
||||
void on_g14ProgServiceNames_currentIndexChanged(int index);
|
||||
void on_clearData_clicked(bool checked);
|
||||
void on_g00AltFrequenciesBox_activated(int index);
|
||||
void on_g14MappedFrequencies_activated(int index);
|
||||
void on_g14AltFrequencies_activated(int index);
|
||||
void onWidgetRolled(QWidget* widget, bool rollDown);
|
||||
void onMenuDoubleClicked();
|
||||
void tick();
|
||||
@ -101,6 +104,8 @@ private:
|
||||
|
||||
void leaveEvent(QEvent*);
|
||||
void enterEvent(QEvent*);
|
||||
|
||||
void changeFrequency(qint64 f);
|
||||
};
|
||||
|
||||
#endif // INCLUDE_BFMDEMODGUI_H
|
||||
|
Loading…
Reference in New Issue
Block a user