mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
SoapySDR support: input: auto correction GUIs (2)
This commit is contained in:
parent
66f95bc0a6
commit
e5748444c5
@ -461,6 +461,48 @@ void SoapySDRInputGui::individualGainChanged(QString name, double value)
|
|||||||
sendSettings();
|
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)
|
void SoapySDRInputGui::on_centerFrequency_changed(quint64 value)
|
||||||
{
|
{
|
||||||
m_settings.m_centerFrequency = value * 1000;
|
m_settings.m_centerFrequency = value * 1000;
|
||||||
@ -573,6 +615,7 @@ void SoapySDRInputGui::displaySettings()
|
|||||||
|
|
||||||
displayTunableElementsControlSettings();
|
displayTunableElementsControlSettings();
|
||||||
displayIndividualGainsControlSettings();
|
displayIndividualGainsControlSettings();
|
||||||
|
displayCorrectionsSettings();
|
||||||
|
|
||||||
blockApplySettings(false);
|
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()
|
void SoapySDRInputGui::sendSettings()
|
||||||
{
|
{
|
||||||
if (!m_updateTimer.isActive()) {
|
if (!m_updateTimer.isActive()) {
|
||||||
|
@ -97,6 +97,7 @@ private:
|
|||||||
void displaySettings();
|
void displaySettings();
|
||||||
void displayTunableElementsControlSettings();
|
void displayTunableElementsControlSettings();
|
||||||
void displayIndividualGainsControlSettings();
|
void displayIndividualGainsControlSettings();
|
||||||
|
void displayCorrectionsSettings();
|
||||||
void sendSettings();
|
void sendSettings();
|
||||||
void updateSampleRateAndFrequency();
|
void updateSampleRateAndFrequency();
|
||||||
void updateFrequencyLimits();
|
void updateFrequencyLimits();
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
<string>Normalized module</string>
|
<string>Normalized module</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>-100</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>100</number>
|
<number>100</number>
|
||||||
@ -112,7 +112,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>-1.00</string>
|
<string>1.00</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
Loading…
Reference in New Issue
Block a user