mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 01:39:05 -05:00
SoapySDR: added try/catch blocks around calls to SoapySDR interface methods where missing
This commit is contained in:
parent
00ca85c0bf
commit
932048dba0
@ -720,10 +720,17 @@ void SoapySDROutput::updateGains(SoapySDR::Device *dev, int requestedChannel, So
|
||||
return;
|
||||
}
|
||||
|
||||
settings.m_globalGain = round(dev->getGain(SOAPY_SDR_TX, requestedChannel));
|
||||
try
|
||||
{
|
||||
settings.m_globalGain = round(dev->getGain(SOAPY_SDR_TX, requestedChannel));
|
||||
|
||||
for (const auto &name : settings.m_individualGains.keys()) {
|
||||
settings.m_individualGains[name] = dev->getGain(SOAPY_SDR_TX, requestedChannel, name.toStdString());
|
||||
for (const auto &name : settings.m_individualGains.keys()) {
|
||||
settings.m_individualGains[name] = dev->getGain(SOAPY_SDR_TX, requestedChannel, name.toStdString());
|
||||
}
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
qCritical("SoapySDROutput::updateGains: caught exception: %s", ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -733,8 +740,15 @@ void SoapySDROutput::updateTunableElements(SoapySDR::Device *dev, int requestedC
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto &name : settings.m_tunableElements.keys()) {
|
||||
settings.m_tunableElements[name] = dev->getFrequency(SOAPY_SDR_TX, requestedChannel, name.toStdString());
|
||||
try
|
||||
{
|
||||
for (const auto &name : settings.m_tunableElements.keys()) {
|
||||
settings.m_tunableElements[name] = dev->getFrequency(SOAPY_SDR_TX, requestedChannel, name.toStdString());
|
||||
}
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
qCritical("SoapySDROutput::updateTunableElements: caught exception: %s", ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -749,10 +749,17 @@ void SoapySDRInput::updateGains(SoapySDR::Device *dev, int requestedChannel, Soa
|
||||
return;
|
||||
}
|
||||
|
||||
settings.m_globalGain = round(dev->getGain(SOAPY_SDR_RX, requestedChannel));
|
||||
try
|
||||
{
|
||||
settings.m_globalGain = round(dev->getGain(SOAPY_SDR_RX, requestedChannel));
|
||||
|
||||
for (const auto &name : settings.m_individualGains.keys()) {
|
||||
settings.m_individualGains[name] = dev->getGain(SOAPY_SDR_RX, requestedChannel, name.toStdString());
|
||||
for (const auto &name : settings.m_individualGains.keys()) {
|
||||
settings.m_individualGains[name] = dev->getGain(SOAPY_SDR_RX, requestedChannel, name.toStdString());
|
||||
}
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
qCritical("SoapySDRInput::updateGains: caught exception: %s", ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -762,8 +769,15 @@ void SoapySDRInput::updateTunableElements(SoapySDR::Device *dev, int requestedCh
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto &name : settings.m_tunableElements.keys()) {
|
||||
settings.m_tunableElements[name] = dev->getFrequency(SOAPY_SDR_RX, requestedChannel, name.toStdString());
|
||||
try
|
||||
{
|
||||
for (const auto &name : settings.m_tunableElements.keys()) {
|
||||
settings.m_tunableElements[name] = dev->getFrequency(SOAPY_SDR_RX, requestedChannel, name.toStdString());
|
||||
}
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
qCritical("SoapySDRInput::updateTunableElements: caught exception: %s", ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user