1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 10:05:46 -05:00

Merge pull request #1479 from srcejon/device_freq

Adjust number of frequency digits displayed depending whether tranverter is enabled
This commit is contained in:
Edouard Griffiths 2022-10-16 23:00:28 +02:00 committed by GitHub
commit 01a78e959e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 60 additions and 25 deletions

View File

@ -182,12 +182,19 @@ void AirspyGui::updateFrequencyLimits()
qint64 minLimit = AirspyInput::loLowLimitFreq/1000 + deltaFrequency;
qint64 maxLimit = AirspyInput::loHighLimitFreq/1000 + deltaFrequency;
minLimit = minLimit < 0 ? 0 : minLimit > 999999999 ? 999999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 999999999 ? 999999999 : maxLimit;
if (m_settings.m_transverterMode)
{
minLimit = minLimit < 0 ? 0 : minLimit > 999999999 ? 999999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 999999999 ? 999999999 : maxLimit;
ui->centerFrequency->setValueRange(9, minLimit, maxLimit);
}
else
{
minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
}
qDebug("AirspyGui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
ui->centerFrequency->setValueRange(9, minLimit, maxLimit);
}
void AirspyGui::displaySettings()

View File

@ -195,12 +195,19 @@ void AirspyHFGui::updateFrequencyLimits()
break;
}
minLimit = minLimit < 0 ? 0 : minLimit > 999999999 ? 999999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 999999999 ? 999999999 : maxLimit;
if (m_settings.m_transverterMode)
{
minLimit = minLimit < 0 ? 0 : minLimit > 999999999 ? 999999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 999999999 ? 999999999 : maxLimit;
ui->centerFrequency->setValueRange(9, minLimit, maxLimit);
}
else
{
minLimit = minLimit < 0 ? 0 : minLimit > 999999 ? 999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 999999 ? 999999 : maxLimit;
ui->centerFrequency->setValueRange(6, minLimit, maxLimit);
}
qDebug("AirspyHFGui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
ui->centerFrequency->setValueRange(9, minLimit, maxLimit);
}
void AirspyHFGui::displaySettings()

View File

@ -200,12 +200,19 @@ void RTLSDRGui::updateFrequencyLimits()
qint64 minLimit = (m_settings.m_noModMode ? RTLSDRInput::frequencyLowRangeMin : RTLSDRInput::frequencyHighRangeMin) + deltaFrequency;
qint64 maxLimit = (m_settings.m_noModMode ? RTLSDRInput::frequencyLowRangeMax : RTLSDRInput::frequencyHighRangeMax) + deltaFrequency;
minLimit = minLimit < 0 ? 0 : minLimit > 999999999 ? 999999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 999999999 ? 999999999 : maxLimit;
if (m_settings.m_transverterMode)
{
minLimit = minLimit < 0 ? 0 : minLimit > 999999999 ? 999999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 999999999 ? 999999999 : maxLimit;
ui->centerFrequency->setValueRange(9, minLimit, maxLimit);
}
else
{
minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
}
qDebug("RTLSDRGui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
ui->centerFrequency->setValueRange(9, minLimit, maxLimit);
}
void RTLSDRGui::displayGains()

View File

@ -237,12 +237,19 @@ void SDRPlayV3Gui::updateFrequencyLimits()
qint64 minLimit = 1U + deltaFrequency;
qint64 maxLimit = 2000000U + deltaFrequency;
minLimit = minLimit < 0 ? 0 : minLimit > 999999999 ? 999999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 999999999 ? 999999999 : maxLimit;
if (m_settings.m_transverterMode)
{
minLimit = minLimit < 0 ? 0 : minLimit > 999999999 ? 999999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 999999999 ? 999999999 : maxLimit;
ui->centerFrequency->setValueRange(9, minLimit, maxLimit);
}
else
{
minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
}
qDebug("SDRPlayV3Gui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
ui->centerFrequency->setValueRange(9, minLimit, maxLimit);
}
void SDRPlayV3Gui::displaySettings()

View File

@ -256,12 +256,19 @@ void USRPInputGUI::updateFrequencyLimits()
qint64 minLimit = minF/1000 + deltaFrequency;
qint64 maxLimit = maxF/1000 + deltaFrequency;
minLimit = minLimit < 0 ? 0 : minLimit > 999999999 ? 999999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 999999999 ? 999999999 : maxLimit;
if (m_settings.m_transverterMode)
{
minLimit = minLimit < 0 ? 0 : minLimit > 999999999 ? 999999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 999999999 ? 999999999 : maxLimit;
ui->centerFrequency->setValueRange(9, minLimit, maxLimit);
}
else
{
minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
ui->centerFrequency->setValueRange(7, minLimit, maxLimit);
}
qDebug("USRPInputGUI::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
ui->centerFrequency->setValueRange(9, minLimit, maxLimit);
}
void USRPInputGUI::handleInputMessages()