1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 17:28:50 -05:00

SoapySDR support: input: auto correction GUIs (2)

This commit is contained in:
f4exb 2018-11-08 16:27:33 +01:00
parent 66f95bc0a6
commit e5748444c5
3 changed files with 71 additions and 2 deletions

View File

@ -461,6 +461,48 @@ void SoapySDRInputGui::individualGainChanged(QString name, double value)
sendSettings();
}
void SoapySDRInputGui::autoDCCorrectionChanged(bool set)
{
m_settings.m_autoDCCorrection = set;
sendSettings();
}
void SoapySDRInputGui::autoIQCorrectionChanged(bool set)
{
m_settings.m_autoIQCorrection = set;
sendSettings();
}
void SoapySDRInputGui::dcCorrectionModuleChanged(double value)
{
std::complex<float> dcCorrection = std::polar<float>(value, arg(m_settings.m_dcCorrection));
m_settings.m_dcCorrection = dcCorrection;
sendSettings();
}
void SoapySDRInputGui::dcCorrectionArgumentChanged(double value)
{
double angleInRadians = (value / 180.0) * M_PI;
std::complex<float> dcCorrection = std::polar<float>(abs(m_settings.m_dcCorrection), angleInRadians);
m_settings.m_dcCorrection = dcCorrection;
sendSettings();
}
void SoapySDRInputGui::iqCorrectionModuleChanged(double value)
{
std::complex<float> iqCorrection = std::polar<float>(value, arg(m_settings.m_iqCorrection));
m_settings.m_iqCorrection = iqCorrection;
sendSettings();
}
void SoapySDRInputGui::iqCorrectionArgumentChanged(double value)
{
double angleInRadians = (value / 180.0) * M_PI;
std::complex<float> iqCorrection = std::polar<float>(abs(m_settings.m_iqCorrection), angleInRadians);
m_settings.m_iqCorrection = iqCorrection;
sendSettings();
}
void SoapySDRInputGui::on_centerFrequency_changed(quint64 value)
{
m_settings.m_centerFrequency = value * 1000;
@ -573,6 +615,7 @@ void SoapySDRInputGui::displaySettings()
displayTunableElementsControlSettings();
displayIndividualGainsControlSettings();
displayCorrectionsSettings();
blockApplySettings(false);
}
@ -601,6 +644,31 @@ void SoapySDRInputGui::displayIndividualGainsControlSettings()
}
}
void SoapySDRInputGui::displayCorrectionsSettings()
{
if (m_dcCorrectionGUI)
{
m_dcCorrectionGUI->setAutomatic(m_settings.m_autoDCCorrection);
m_dcCorrectionGUI->setModule(abs(m_settings.m_dcCorrection));
m_dcCorrectionGUI->setArgument(arg(m_settings.m_dcCorrection)*(180.0/M_PI));
}
if (m_iqCorrectionGUI)
{
m_iqCorrectionGUI->setAutomatic(m_settings.m_autoIQCorrection);
m_iqCorrectionGUI->setModule(abs(m_settings.m_iqCorrection));
m_iqCorrectionGUI->setArgument(arg(m_settings.m_iqCorrection)*(180.0/M_PI));
}
if (m_autoDCCorrection) {
m_autoDCCorrection->setChecked(m_settings.m_autoDCCorrection);
}
if (m_autoIQCorrection) {
m_autoIQCorrection->setChecked(m_settings.m_autoIQCorrection);
}
}
void SoapySDRInputGui::sendSettings()
{
if (!m_updateTimer.isActive()) {

View File

@ -97,6 +97,7 @@ private:
void displaySettings();
void displayTunableElementsControlSettings();
void displayIndividualGainsControlSettings();
void displayCorrectionsSettings();
void sendSettings();
void updateSampleRateAndFrequency();
void updateFrequencyLimits();

View File

@ -90,7 +90,7 @@
<string>Normalized module</string>
</property>
<property name="minimum">
<number>-100</number>
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
@ -112,7 +112,7 @@
</size>
</property>
<property name="text">
<string>-1.00</string>
<string>1.00</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>