mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -04:00
BladeRF2: generalize scale support in range queries
This commit is contained in:
@@ -47,19 +47,20 @@ BladeRF2InputGui::BladeRF2InputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
{
|
||||
m_sampleSource = (BladeRF2Input*) m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||
int max, min, step;
|
||||
float scale;
|
||||
uint64_t f_min, f_max;
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
m_sampleSource->getFrequencyRange(f_min, f_max, step);
|
||||
m_sampleSource->getFrequencyRange(f_min, f_max, step, scale);
|
||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
ui->centerFrequency->setValueRange(7, f_min/1000, f_max/1000);
|
||||
|
||||
m_sampleSource->getSampleRateRange(min, max, step);
|
||||
m_sampleSource->getSampleRateRange(min, max, step, scale);
|
||||
ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow));
|
||||
ui->sampleRate->setValueRange(8, min, max);
|
||||
|
||||
m_sampleSource->getBandwidthRange(min, max, step);
|
||||
m_sampleSource->getBandwidthRange(min, max, step, scale);
|
||||
ui->bandwidth->setColorMapper(ColorMapper(ColorMapper::GrayYellow));
|
||||
ui->bandwidth->setValueRange(5, min/1000, max/1000);
|
||||
|
||||
@@ -159,8 +160,9 @@ void BladeRF2InputGui::updateFrequencyLimits()
|
||||
// values in kHz
|
||||
uint64_t f_min, f_max;
|
||||
int step;
|
||||
float scale;
|
||||
qint64 deltaFrequency = m_settings.m_transverterMode ? m_settings.m_transverterDeltaFrequency/1000 : 0;
|
||||
m_sampleSource->getFrequencyRange(f_min, f_max, step);
|
||||
m_sampleSource->getFrequencyRange(f_min, f_max, step, scale);
|
||||
qint64 minLimit = f_min/1000 + deltaFrequency;
|
||||
qint64 maxLimit = f_max/1000 + deltaFrequency;
|
||||
|
||||
@@ -264,7 +266,8 @@ void BladeRF2InputGui::updateSampleRateAndFrequency()
|
||||
void BladeRF2InputGui::displaySampleRate()
|
||||
{
|
||||
int max, min, step;
|
||||
m_sampleSource->getSampleRateRange(min, max, step);
|
||||
float scale;
|
||||
m_sampleSource->getSampleRateRange(min, max, step, scale);
|
||||
|
||||
ui->sampleRate->blockSignals(true);
|
||||
displayFcTooltip();
|
||||
|
||||
Reference in New Issue
Block a user