mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-15 12:51:49 -05:00
RTLSDR plugin: fixed sample rate display and update
This commit is contained in:
parent
b2e2c0a106
commit
a7fabd5f58
@ -40,8 +40,8 @@ RTLSDRGui::RTLSDRGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
|||||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));
|
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold));
|
||||||
ui->centerFrequency->setValueRange(7, 24000U, 1900000U);
|
ui->centerFrequency->setValueRange(7, 24000U, 1900000U);
|
||||||
|
|
||||||
ui->newSampleRate->setColorMapper(ColorMapper(ColorMapper::ReverseGreenYellow));
|
ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::ReverseGreenYellow));
|
||||||
ui->newSampleRate->setValueRange(7, 950000U, 2400000U);
|
ui->sampleRate->setValueRange(7, 950000U, 2400000U);
|
||||||
|
|
||||||
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
|
||||||
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
|
||||||
@ -190,12 +190,13 @@ void RTLSDRGui::updateSampleRateAndFrequency()
|
|||||||
{
|
{
|
||||||
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate);
|
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate);
|
||||||
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
|
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
|
||||||
ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000));
|
ui->deviceRateText->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTLSDRGui::displaySettings()
|
void RTLSDRGui::displaySettings()
|
||||||
{
|
{
|
||||||
ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
|
ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
|
||||||
|
ui->sampleRate->setValue(m_settings.m_devSampleRate);
|
||||||
ui->dcOffset->setChecked(m_settings.m_dcBlock);
|
ui->dcOffset->setChecked(m_settings.m_dcBlock);
|
||||||
ui->iqImbalance->setChecked(m_settings.m_iqImbalance);
|
ui->iqImbalance->setChecked(m_settings.m_iqImbalance);
|
||||||
ui->ppm->setValue(m_settings.m_loPpmCorrection);
|
ui->ppm->setValue(m_settings.m_loPpmCorrection);
|
||||||
@ -392,7 +393,7 @@ void RTLSDRGui::on_checkBox_stateChanged(int state)
|
|||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTLSDRGui::on_newSampleRate_changed(quint64 value)
|
void RTLSDRGui::on_sampleRate_changed(quint64 value)
|
||||||
{
|
{
|
||||||
m_settings.m_devSampleRate = value;
|
m_settings.m_devSampleRate = value;
|
||||||
sendSettings();
|
sendSettings();
|
||||||
@ -401,12 +402,12 @@ void RTLSDRGui::on_newSampleRate_changed(quint64 value)
|
|||||||
void RTLSDRGui::on_lowSampleRate_toggled(bool checked)
|
void RTLSDRGui::on_lowSampleRate_toggled(bool checked)
|
||||||
{
|
{
|
||||||
if (checked) {
|
if (checked) {
|
||||||
ui->newSampleRate->setValueRange(7, 230000U, 300000U);
|
ui->sampleRate->setValueRange(7, 230000U, 300000U);
|
||||||
} else {
|
} else {
|
||||||
ui->newSampleRate->setValueRange(7, 950000U, 2400000U);
|
ui->sampleRate->setValueRange(7, 950000U, 2400000U);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_settings.m_devSampleRate = ui->newSampleRate->getValueNew();
|
m_settings.m_devSampleRate = ui->sampleRate->getValueNew();
|
||||||
qDebug("RTLSDRGui::on_lowSampleRate_toggled: %d S/s", m_settings.m_devSampleRate);
|
qDebug("RTLSDRGui::on_lowSampleRate_toggled: %d S/s", m_settings.m_devSampleRate);
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ private:
|
|||||||
private slots:
|
private slots:
|
||||||
void handleDSPMessages();
|
void handleDSPMessages();
|
||||||
void on_centerFrequency_changed(quint64 value);
|
void on_centerFrequency_changed(quint64 value);
|
||||||
void on_newSampleRate_changed(quint64 value);
|
void on_sampleRate_changed(quint64 value);
|
||||||
void on_lowSampleRate_toggled(bool checked);
|
void on_lowSampleRate_toggled(bool checked);
|
||||||
void on_dcOffset_toggled(bool checked);
|
void on_dcOffset_toggled(bool checked);
|
||||||
void on_iqImbalance_toggled(bool checked);
|
void on_iqImbalance_toggled(bool checked);
|
||||||
|
@ -339,7 +339,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="ValueDial" name="newSampleRate" native="true">
|
<widget class="ValueDial" name="sampleRate" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
Loading…
Reference in New Issue
Block a user