mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-06 03:29:12 -04:00
SoapySDR support: fixed display settings
This commit is contained in:
parent
97ee2cd5be
commit
8a72372b28
@ -846,7 +846,7 @@ bool SoapySDROutput::applySettings(const SoapySDROutputSettings& settings, bool
|
||||
{
|
||||
auto nvalue = settings.m_tunableElements.find(oname);
|
||||
|
||||
if (nvalue != settings.m_tunableElements.end() && (m_settings.m_tunableElements[oname] != *nvalue))
|
||||
if (nvalue != settings.m_tunableElements.end() && ((m_settings.m_tunableElements[oname] != *nvalue) || force))
|
||||
{
|
||||
if (dev != 0)
|
||||
{
|
||||
@ -1034,7 +1034,8 @@ bool SoapySDROutput::applySettings(const SoapySDROutputSettings& settings, bool
|
||||
<< " m_log2Interp: " << m_settings.m_log2Interp
|
||||
<< " m_devSampleRate: " << m_settings.m_devSampleRate
|
||||
<< " m_bandwidth: " << m_settings.m_bandwidth
|
||||
<< " m_globalGain: " << m_settings.m_globalGain;
|
||||
<< " m_globalGain: " << m_settings.m_globalGain
|
||||
<< " force: " << force;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -426,7 +426,7 @@ void SoapySDROutputGui::handleInputMessages()
|
||||
|
||||
void SoapySDROutputGui::sampleRateChanged(double sampleRate)
|
||||
{
|
||||
m_settings.m_devSampleRate = sampleRate;
|
||||
m_settings.m_devSampleRate = round(sampleRate);
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@ -439,7 +439,7 @@ void SoapySDROutputGui::antennasChanged()
|
||||
|
||||
void SoapySDROutputGui::bandwidthChanged(double bandwidth)
|
||||
{
|
||||
m_settings.m_bandwidth = bandwidth;
|
||||
m_settings.m_bandwidth = round(bandwidth);
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@ -558,14 +558,20 @@ void SoapySDROutputGui::displaySettings()
|
||||
if (m_antennas) {
|
||||
m_antennas->setValue(m_settings.m_antenna.toStdString());
|
||||
}
|
||||
if (m_sampleRateGUI) {
|
||||
if (m_sampleRateGUI)
|
||||
{
|
||||
m_sampleRateGUI->setValue(m_settings.m_devSampleRate);
|
||||
m_settings.m_devSampleRate = m_sampleRateGUI->getCurrentValue();
|
||||
}
|
||||
if (m_bandwidthGUI) {
|
||||
if (m_bandwidthGUI)
|
||||
{
|
||||
m_bandwidthGUI->setValue(m_settings.m_bandwidth);
|
||||
m_settings.m_bandwidth = m_bandwidthGUI->getCurrentValue();
|
||||
}
|
||||
if (m_gainSliderGUI) {
|
||||
if (m_gainSliderGUI)
|
||||
{
|
||||
m_gainSliderGUI->setValue(m_settings.m_globalGain);
|
||||
m_settings.m_globalGain = m_gainSliderGUI->getCurrentValue();
|
||||
}
|
||||
if (m_autoGain) {
|
||||
m_autoGain->setChecked(m_settings.m_autoGain);
|
||||
@ -599,10 +605,12 @@ void SoapySDROutputGui::displayIndividualGainsControlSettings()
|
||||
{
|
||||
for (const auto &it : m_individualGainsGUIs)
|
||||
{
|
||||
QMap<QString, double>::const_iterator elIt = m_settings.m_individualGains.find(it->getName());
|
||||
QMap<QString, double>::iterator elIt = m_settings.m_individualGains.find(it->getName());
|
||||
|
||||
if (elIt != m_settings.m_individualGains.end()) {
|
||||
if (elIt != m_settings.m_individualGains.end())
|
||||
{
|
||||
it->setValue(*elIt);
|
||||
*elIt = it->getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -892,7 +892,7 @@ bool SoapySDRInput::applySettings(const SoapySDRInputSettings& settings, bool fo
|
||||
{
|
||||
auto nvalue = settings.m_tunableElements.find(oname);
|
||||
|
||||
if (nvalue != settings.m_tunableElements.end() && (m_settings.m_tunableElements[oname] != *nvalue))
|
||||
if (nvalue != settings.m_tunableElements.end() && ((m_settings.m_tunableElements[oname] != *nvalue) ||force))
|
||||
{
|
||||
if (dev != 0)
|
||||
{
|
||||
@ -1085,7 +1085,8 @@ bool SoapySDRInput::applySettings(const SoapySDRInputSettings& settings, bool fo
|
||||
<< " m_softIQCorrection: " << m_settings.m_softIQCorrection
|
||||
<< " m_antenna: " << m_settings.m_antenna
|
||||
<< " m_bandwidth: " << m_settings.m_bandwidth
|
||||
<< " m_globalGain: " << m_settings.m_globalGain;
|
||||
<< " m_globalGain: " << m_settings.m_globalGain
|
||||
<< " force: " << force;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -436,13 +436,13 @@ void SoapySDRInputGui::antennasChanged()
|
||||
|
||||
void SoapySDRInputGui::sampleRateChanged(double sampleRate)
|
||||
{
|
||||
m_settings.m_devSampleRate = sampleRate;
|
||||
m_settings.m_devSampleRate = round(sampleRate);
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
void SoapySDRInputGui::bandwidthChanged(double bandwidth)
|
||||
{
|
||||
m_settings.m_bandwidth = bandwidth;
|
||||
m_settings.m_bandwidth = round(bandwidth);
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
@ -600,14 +600,20 @@ void SoapySDRInputGui::displaySettings()
|
||||
qDebug("SoapySDRInputGui::displaySettings: m_antenna: %s", m_settings.m_antenna.toStdString().c_str());
|
||||
m_antennas->setValue(m_settings.m_antenna.toStdString());
|
||||
}
|
||||
if (m_sampleRateGUI) {
|
||||
if (m_sampleRateGUI)
|
||||
{
|
||||
m_sampleRateGUI->setValue(m_settings.m_devSampleRate);
|
||||
m_settings.m_devSampleRate = m_sampleRateGUI->getCurrentValue();
|
||||
}
|
||||
if (m_bandwidthGUI) {
|
||||
if (m_bandwidthGUI)
|
||||
{
|
||||
m_bandwidthGUI->setValue(m_settings.m_bandwidth);
|
||||
m_settings.m_bandwidth = m_bandwidthGUI->getCurrentValue();
|
||||
}
|
||||
if (m_gainSliderGUI) {
|
||||
if (m_gainSliderGUI)
|
||||
{
|
||||
m_gainSliderGUI->setValue(m_settings.m_globalGain);
|
||||
m_settings.m_globalGain = m_gainSliderGUI->getCurrentValue();
|
||||
}
|
||||
if (m_autoGain) {
|
||||
m_autoGain->setChecked(m_settings.m_autoGain);
|
||||
@ -645,10 +651,12 @@ void SoapySDRInputGui::displayIndividualGainsControlSettings()
|
||||
{
|
||||
for (const auto &it : m_individualGainsGUIs)
|
||||
{
|
||||
QMap<QString, double>::const_iterator elIt = m_settings.m_individualGains.find(it->getName());
|
||||
QMap<QString, double>::iterator elIt = m_settings.m_individualGains.find(it->getName());
|
||||
|
||||
if (elIt != m_settings.m_individualGains.end()) {
|
||||
if (elIt != m_settings.m_individualGains.end())
|
||||
{
|
||||
it->setValue(*elIt);
|
||||
*elIt = it->getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user