1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 01:18:38 -05:00

SoapySDR support: individual gains GUIs fixes

This commit is contained in:
f4exb 2018-11-07 20:06:07 +01:00
parent e636d448a7
commit b316af2d1d
3 changed files with 15 additions and 3 deletions

View File

@ -58,6 +58,7 @@ SoapySDROutputGui::SoapySDROutputGui(DeviceUISet *deviceUISet, QWidget* parent)
createRangesControl(&m_bandwidthGUI, m_sampleSink->getBandwidthRanges(), "BW", "Hz");
createTunableElementsControl(m_sampleSink->getTunableElements());
createGlobalGainControl();
createIndividualGainsControl(m_sampleSink->getIndividualGainsRanges());
if (m_sampleRateGUI) {
connect(m_sampleRateGUI, SIGNAL(valueChanged(double)), this, SLOT(sampleRateChanged(double)));
@ -205,6 +206,7 @@ void SoapySDROutputGui::createIndividualGainsControl(const std::vector<DeviceSoa
return;
}
QVBoxLayout *layout = (QVBoxLayout *) ui->scrollAreaWidgetContents->layout();
std::vector<DeviceSoapySDRParams::GainSetting>::const_iterator it = individualGainsList.begin();
for (int i = 0; it != individualGainsList.end(); ++it, i++)
@ -214,6 +216,7 @@ void SoapySDROutputGui::createIndividualGainsControl(const std::vector<DeviceSoa
gainGUI->setLabel(QString("%1 gain").arg(it->m_name.c_str()));
gainGUI->setUnits(QString(""));
DynamicItemSettingGUI *gui = new DynamicItemSettingGUI(gainGUI, QString(it->m_name.c_str()));
layout->addWidget(gainGUI);
m_individualGainsGUIs.push_back(gui);
connect(m_individualGainsGUIs.back(), SIGNAL(valueChanged(QString, double)), this, SLOT(individualGainChanged(QString, double)));
}

View File

@ -59,6 +59,7 @@ SoapySDRInputGui::SoapySDRInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
createRangesControl(&m_bandwidthGUI, m_sampleSource->getBandwidthRanges(), "BW", "Hz");
createTunableElementsControl(m_sampleSource->getTunableElements());
createGlobalGainControl();
createIndividualGainsControl(m_sampleSource->getIndividualGainsRanges());
if (m_sampleRateGUI) {
connect(m_sampleRateGUI, SIGNAL(valueChanged(double)), this, SLOT(sampleRateChanged(double)));
@ -206,6 +207,7 @@ void SoapySDRInputGui::createIndividualGainsControl(const std::vector<DeviceSoap
return;
}
QVBoxLayout *layout = (QVBoxLayout *) ui->scrollAreaWidgetContents->layout();
std::vector<DeviceSoapySDRParams::GainSetting>::const_iterator it = individualGainsList.begin();
for (int i = 0; it != individualGainsList.end(); ++it, i++)
@ -215,6 +217,7 @@ void SoapySDRInputGui::createIndividualGainsControl(const std::vector<DeviceSoap
gainGUI->setLabel(QString("%1 gain").arg(it->m_name.c_str()));
gainGUI->setUnits(QString(""));
DynamicItemSettingGUI *gui = new DynamicItemSettingGUI(gainGUI, QString(it->m_name.c_str()));
layout->addWidget(gainGUI);
m_individualGainsGUIs.push_back(gui);
connect(m_individualGainsGUIs.back(), SIGNAL(valueChanged(QString, double)), this, SLOT(individualGainChanged(QString, double)));
}

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>203</width>
<width>266</width>
<height>30</height>
</rect>
</property>
@ -30,13 +30,19 @@
<rect>
<x>0</x>
<y>0</y>
<width>179</width>
<height>29</height>
<width>256</width>
<height>21</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="intervalLabel">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Label</string>
</property>