diff --git a/plugins/samplesource/airspy/airspygui.ui b/plugins/samplesource/airspy/airspygui.ui index 0129cf9d2..a1d73bf15 100644 --- a/plugins/samplesource/airspy/airspygui.ui +++ b/plugins/samplesource/airspy/airspygui.ui @@ -23,7 +23,7 @@ - BladeRF + Airspy diff --git a/plugins/samplesource/bladerf/bladerfgui.cpp b/plugins/samplesource/bladerf/bladerfgui.cpp index 17baf0cab..8f9c13609 100644 --- a/plugins/samplesource/bladerf/bladerfgui.cpp +++ b/plugins/samplesource/bladerf/bladerfgui.cpp @@ -33,6 +33,19 @@ BladerfGui::BladerfGui(PluginAPI* pluginAPI, QWidget* parent) : ui->setupUi(this); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); ui->centerFrequency->setValueRange(7, BLADERF_FREQUENCY_MIN_XB200/1000, BLADERF_FREQUENCY_MAX/1000); + + ui->samplerate->clear(); + for (int i = 0; i < BladerfSampleRates::getNbRates(); i++) + { + ui->samplerate->addItem(QString::number(BladerfSampleRates::getRate(i))); + } + + ui->bandwidth->clear(); + for (int i = 0; i < BladerfBandwidths::getNbBandwidths(); i++) + { + ui->bandwidth->addItem(QString::number(BladerfBandwidths::getBandwidth(i))); + } + connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); displaySettings(); @@ -117,21 +130,17 @@ void BladerfGui::displaySettings() ui->dcOffset->setChecked(m_settings.m_dcBlock); ui->iqImbalance->setChecked(m_settings.m_iqCorrection); - ui->samplerateText->setText(tr("%1k").arg(m_settings.m_devSampleRate / 1000)); unsigned int sampleRateIndex = BladerfSampleRates::getRateIndex(m_settings.m_devSampleRate); - ui->samplerate->setValue(sampleRateIndex); + ui->samplerate->setCurrentIndex(sampleRateIndex); - ui->bandwidthText->setText(tr("%1k").arg(m_settings.m_bandwidth / 1000)); unsigned int bandwidthIndex = BladerfBandwidths::getBandwidthIndex(m_settings.m_bandwidth); - ui->bandwidth->setValue(bandwidthIndex); + ui->bandwidth->setCurrentIndex(bandwidthIndex); - ui->decimText->setText(tr("%1").arg(1<decim->setValue(m_settings.m_log2Decim); + ui->decim->setCurrentIndex(m_settings.m_log2Decim); ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos); - ui->lnaGainText->setText(tr("%1dB").arg(m_settings.m_lnaGain*3)); - ui->lna->setValue(m_settings.m_lnaGain); + ui->lna->setCurrentIndex(m_settings.m_lnaGain); ui->vga1Text->setText(tr("%1dB").arg(m_settings.m_vga1)); ui->vga1->setValue(m_settings.m_vga1); @@ -166,28 +175,25 @@ void BladerfGui::on_iqImbalance_toggled(bool checked) sendSettings(); } -void BladerfGui::on_samplerate_valueChanged(int value) +void BladerfGui::on_samplerate_currentIndexChanged(int index) { - int newrate = BladerfSampleRates::getRate(value); - ui->samplerateText->setText(tr("%1k").arg(newrate)); + int newrate = BladerfSampleRates::getRate(index); m_settings.m_devSampleRate = newrate * 1000; sendSettings(); } -void BladerfGui::on_bandwidth_valueChanged(int value) +void BladerfGui::on_bandwidth_currentIndexChanged(int index) { - int newbw = BladerfBandwidths::getBandwidth(value); - ui->bandwidthText->setText(tr("%1k").arg(newbw)); + int newbw = BladerfBandwidths::getBandwidth(index); m_settings.m_bandwidth = newbw * 1000; sendSettings(); } -void BladerfGui::on_decim_valueChanged(int value) +void BladerfGui::on_decim_currentIndexChanged(int index) { - if ((value <0) || (value > 5)) + if ((index <0) || (index > 5)) return; - ui->decimText->setText(tr("%1").arg(1< 2)) + if ((index < 0) || (index > 2)) return; - ui->lnaGainText->setText(tr("%1dB").arg(value*3)); - m_settings.m_lnaGain = value; + m_settings.m_lnaGain = index; sendSettings(); } @@ -379,6 +384,11 @@ unsigned int BladerfSampleRates::getRateIndex(unsigned int rate) return 0; } +unsigned int BladerfSampleRates::getNbRates() +{ + return BladerfSampleRates::m_nb_rates; +} + unsigned int BladerfBandwidths::m_halfbw[] = {750, 875, 1250, 1375, 1500, 1920, 2500, 2750, 3000, 3500, 4375, 5000, 6000, 7000, 10000, 14000}; unsigned int BladerfBandwidths::m_nb_halfbw = 16; @@ -406,3 +416,9 @@ unsigned int BladerfBandwidths::getBandwidthIndex(unsigned int bandwidth) return 0; } + +unsigned int BladerfBandwidths::getNbBandwidths() +{ + return BladerfBandwidths::m_nb_halfbw; +} + diff --git a/plugins/samplesource/bladerf/bladerfgui.h b/plugins/samplesource/bladerf/bladerfgui.h index b3d0aa9d5..ae364d854 100644 --- a/plugins/samplesource/bladerf/bladerfgui.h +++ b/plugins/samplesource/bladerf/bladerfgui.h @@ -64,10 +64,10 @@ private slots: void on_centerFrequency_changed(quint64 value); void on_dcOffset_toggled(bool checked); void on_iqImbalance_toggled(bool checked); - void on_samplerate_valueChanged(int value); - void on_bandwidth_valueChanged(int value); - void on_decim_valueChanged(int value); - void on_lna_valueChanged(int value); + void on_samplerate_currentIndexChanged(int index); + void on_bandwidth_currentIndexChanged(int index); + void on_decim_currentIndexChanged(int index); + void on_lna_currentIndexChanged(int index); void on_vga1_valueChanged(int value); void on_vga2_valueChanged(int value); void on_xb200_currentIndexChanged(int index); @@ -79,6 +79,7 @@ class BladerfSampleRates { public: static unsigned int getRate(unsigned int rate_index); static unsigned int getRateIndex(unsigned int rate); + static unsigned int getNbRates(); private: static unsigned int m_rates[20]; static unsigned int m_nb_rates; @@ -88,6 +89,7 @@ class BladerfBandwidths { public: static unsigned int getBandwidth(unsigned int bandwidth_index); static unsigned int getBandwidthIndex(unsigned int bandwidth); + static unsigned int getNbBandwidths(); private: static unsigned int m_halfbw[16]; static unsigned int m_nb_halfbw; diff --git a/plugins/samplesource/bladerf/bladerfgui.ui b/plugins/samplesource/bladerf/bladerfgui.ui index 2ba5495cf..0a26b4e2e 100644 --- a/plugins/samplesource/bladerf/bladerfgui.ui +++ b/plugins/samplesource/bladerf/bladerfgui.ui @@ -6,8 +6,8 @@ 0 0 - 247 - 308 + 300 + 172 @@ -29,16 +29,7 @@ 3 - - 2 - - - 2 - - - 2 - - + 2 @@ -109,6 +100,13 @@ + + + + Qt::Horizontal + + + @@ -117,7 +115,7 @@ Automatic IQ imbalance correction - IQ imbalance + IQ @@ -127,33 +125,19 @@ Automatic DC offset removal - DC offset + DC - Auto corr + Auto - - - - - - Qt::Horizontal - - - - - - - 3 - - - + + Qt::Horizontal @@ -165,12 +149,19 @@ - + + + + xb200 + + + + XB200 board mode - + None @@ -221,17 +212,10 @@ - - - - xb200 - - - - + Qt::Horizontal @@ -242,25 +226,6 @@ 3 - - - - Device Samplerate - - - 13 - - - 1 - - - 3 - - - Qt::Horizontal - - - @@ -270,57 +235,57 @@ - Rate + SR + + + + + + + + 70 + 16777215 + + + + Sample rate in kS/s - - - - 40 - 0 - - + - --- - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + k - - - - - - Qt::Horizontal - - - - - - - 3 - - - + + + + + 70 + 16777215 + + - RF filter bandwidth - - - 15 - - - 1 + IF bandwidth in kHz + + + + Qt::Horizontal - + + + 40 + 20 + + + - + @@ -333,101 +298,15 @@ - - - - - 40 - 0 - - + + - --- - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + k - - - - - - Qt::Horizontal - - - - - - - 3 - - - - - Dec. - - - - - - - Decimation factor - - - 5 - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - - 40 - 0 - - - - 1 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - Qt::Horizontal - - - - - - - 3 - - - - - Fc pos - - - - - + + Qt::Horizontal @@ -439,7 +318,74 @@ + + + + + + 3 + + + + + Dec + + + + + + + 50 + 16777215 + + + + Decimation factor + + + 3 + + + + 1 + + + + + 2 + + + + + 4 + + + + + 8 + + + + + 16 + + + + + 32 + + + + + + + + Fp + + + + Relative position of device center frequency @@ -456,26 +402,12 @@ - Cent + Cen - - - - - - Qt::Horizontal - - - - - - - 3 - - + @@ -488,40 +420,63 @@ - - - - true - - - LNA gain (dB) - - - 2 - - - 1 - + + Qt::Horizontal + + + 40 + 20 + + + + + + + + + 40 + 16777215 + + + + + 0 + + + + + 3 + + + + + 6 + + + + + + + + dB + - - + + + Qt::Horizontal + + 40 - 0 + 20 - - 0 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + diff --git a/plugins/samplesource/hackrf/hackrfgui.ui b/plugins/samplesource/hackrf/hackrfgui.ui index a0246fae0..1ed40929f 100644 --- a/plugins/samplesource/hackrf/hackrfgui.ui +++ b/plugins/samplesource/hackrf/hackrfgui.ui @@ -29,7 +29,7 @@ - BladeRF + HackRF @@ -281,7 +281,7 @@ - + 3