1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -04:00

SoapySDR support: input: AGC GUI

This commit is contained in:
f4exb
2018-11-08 01:31:39 +01:00
parent 59c8ecd2d0
commit f97091e0f3
7 changed files with 58 additions and 10 deletions
@@ -221,6 +221,12 @@ void SoapySDRInput::getGlobalGainRange(int& min, int& max)
}
}
bool SoapySDRInput::isAGCSupported()
{
const DeviceSoapySDRParams::ChannelSettings* channelSettings = m_deviceShared.m_deviceParams->getRxChannelSettings(m_deviceShared.m_channel);
return channelSettings->m_hasAGC;
}
const std::vector<std::string>& SoapySDRInput::getAntennas()
{
const DeviceSoapySDRParams::ChannelSettings* channelSettings = m_deviceShared.m_deviceParams->getRxChannelSettings(m_deviceShared.m_channel);
@@ -933,6 +939,22 @@ bool SoapySDRInput::applySettings(const SoapySDRInputSettings& settings, bool fo
}
}
if ((m_settings.m_autoGain != settings.m_autoGain) || force)
{
if (dev != 0)
{
try
{
dev->setGainMode(SOAPY_SDR_RX, requestedChannel, settings.m_autoGain);
qDebug("SoapySDRInput::applySettings: %s AGC", settings.m_autoGain ? "set" : "unset");
}
catch (const std::exception &ex)
{
qCritical("SoapySDRInput::applySettings: cannot %s AGC", settings.m_autoGain ? "set" : "unset");
}
}
}
if (forwardChangeOwnDSP)
{
int sampleRate = settings.m_devSampleRate/(1<<settings.m_log2Decim);