|
|
|
|
@ -30,6 +30,8 @@
@@ -30,6 +30,8 @@
|
|
|
|
|
#include "soapygui/dynamicitemsettinggui.h" |
|
|
|
|
#include "soapygui/intervalslidergui.h" |
|
|
|
|
#include "soapygui/complexfactorgui.h" |
|
|
|
|
#include "soapygui/arginfogui.h" |
|
|
|
|
#include "soapygui/dynamicargsettinggui.h" |
|
|
|
|
|
|
|
|
|
#include "soapysdroutputgui.h" |
|
|
|
|
|
|
|
|
|
@ -67,7 +69,9 @@ SoapySDROutputGui::SoapySDROutputGui(DeviceUISet *deviceUISet, QWidget* parent)
@@ -67,7 +69,9 @@ SoapySDROutputGui::SoapySDROutputGui(DeviceUISet *deviceUISet, QWidget* parent)
|
|
|
|
|
createTunableElementsControl(m_sampleSink->getTunableElements()); |
|
|
|
|
createGlobalGainControl(); |
|
|
|
|
createIndividualGainsControl(m_sampleSink->getIndividualGainsRanges()); |
|
|
|
|
createStreamArgumentsControl(m_sampleSink->getStreamArgInfoList()); |
|
|
|
|
m_sampleSink->initGainSettings(m_settings); |
|
|
|
|
m_sampleSink->initStreamArgSettings(m_settings); |
|
|
|
|
|
|
|
|
|
if (m_sampleRateGUI) { |
|
|
|
|
connect(m_sampleRateGUI, SIGNAL(valueChanged(double)), this, SLOT(sampleRateChanged(double))); |
|
|
|
|
@ -303,6 +307,86 @@ void SoapySDROutputGui::createCorrectionsControl()
@@ -303,6 +307,86 @@ void SoapySDROutputGui::createCorrectionsControl()
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SoapySDROutputGui::createStreamArgumentsControl(const SoapySDR::ArgInfoList& argInfoList) |
|
|
|
|
{ |
|
|
|
|
if (argInfoList.size() == 0) { // return early if list is empty
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QVBoxLayout *layout = (QVBoxLayout *) ui->scrollAreaWidgetContents->layout(); |
|
|
|
|
|
|
|
|
|
QFrame *line = new QFrame(this); |
|
|
|
|
line->setFrameShape(QFrame::HLine); |
|
|
|
|
line->setFrameShadow(QFrame::Sunken); |
|
|
|
|
layout->addWidget(line); |
|
|
|
|
|
|
|
|
|
std::vector<SoapySDR::ArgInfo>::const_iterator it = argInfoList.begin(); |
|
|
|
|
|
|
|
|
|
for (; it != argInfoList.end(); ++it) |
|
|
|
|
{ |
|
|
|
|
ArgInfoGUI::ArgInfoValueType valueType; |
|
|
|
|
ArgInfoGUI *argGUI; |
|
|
|
|
|
|
|
|
|
if (it->type == SoapySDR::ArgInfo::BOOL) { |
|
|
|
|
valueType = ArgInfoGUI::ArgInfoValueBool; |
|
|
|
|
} else if (it->type == SoapySDR::ArgInfo::INT) { |
|
|
|
|
valueType = ArgInfoGUI::ArgInfoValueInt; |
|
|
|
|
} else if (it->type == SoapySDR::ArgInfo::FLOAT) { |
|
|
|
|
valueType = ArgInfoGUI::ArgInfoValueFloat; |
|
|
|
|
} else if (it->type == SoapySDR::ArgInfo::STRING) { |
|
|
|
|
valueType = ArgInfoGUI::ArgInfoValueString; |
|
|
|
|
} else { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (valueType == ArgInfoGUI::ArgInfoValueBool) |
|
|
|
|
{ |
|
|
|
|
argGUI = new ArgInfoGUI(ArgInfoGUI::ArgInfoBinary, ArgInfoGUI::ArgInfoValueBool, this); |
|
|
|
|
} |
|
|
|
|
else if (it->options.size() == 0) |
|
|
|
|
{ |
|
|
|
|
argGUI = new ArgInfoGUI(ArgInfoGUI::ArgInfoContinuous, valueType, this); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
argGUI = new ArgInfoGUI(ArgInfoGUI::ArgInfoDiscrete, valueType, this); |
|
|
|
|
std::vector<std::string>::const_iterator optionIt = it->options.begin(); |
|
|
|
|
std::vector<std::string>::const_iterator optionNameIt = it->optionNames.begin(); |
|
|
|
|
|
|
|
|
|
for (int i = 0; optionIt != it->options.end(); ++optionIt, i++) |
|
|
|
|
{ |
|
|
|
|
QString name(optionNameIt == it->optionNames.end() ? optionIt->c_str() : optionNameIt->c_str()); |
|
|
|
|
++optionNameIt; |
|
|
|
|
|
|
|
|
|
if (valueType == ArgInfoGUI::ArgInfoValueInt) { |
|
|
|
|
argGUI->addIntValue(name, atoi(optionIt->c_str())); |
|
|
|
|
} else if (valueType == ArgInfoGUI::ArgInfoValueFloat) { |
|
|
|
|
argGUI->addFloatValue(name, atof(optionIt->c_str())); |
|
|
|
|
} else if (valueType == ArgInfoGUI::ArgInfoValueString) { |
|
|
|
|
argGUI->addStringValue(name, QString(optionIt->c_str())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ((it->range.minimum() != 0) || (it->range.maximum() != 0)) { |
|
|
|
|
argGUI->setRange(it->range.minimum(), it->range.maximum()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
argGUI->setLabel(QString(it->name.size() == 0 ? it->key.c_str() : it->name.c_str())); |
|
|
|
|
argGUI->setUnits(QString(it->units.c_str())); |
|
|
|
|
|
|
|
|
|
if (it->description.size() != 0) { |
|
|
|
|
argGUI->setToolTip(QString(it->description.c_str())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
layout->addWidget(argGUI); |
|
|
|
|
|
|
|
|
|
DynamicArgSettingGUI *gui = new DynamicArgSettingGUI(argGUI, QString(it->key.c_str())); |
|
|
|
|
m_streamArgsGUIs.push_back(gui); |
|
|
|
|
connect(gui, SIGNAL(valueChanged(QString, value)), this, SLOT(streamArgChanged(QString, QVariant))); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SoapySDROutputGui::setName(const QString& name) |
|
|
|
|
{ |
|
|
|
|
setObjectName(name); |
|
|
|
|
@ -509,6 +593,12 @@ void SoapySDROutputGui::iqCorrectionArgumentChanged(double value)
@@ -509,6 +593,12 @@ void SoapySDROutputGui::iqCorrectionArgumentChanged(double value)
|
|
|
|
|
sendSettings(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SoapySDROutputGui::streamArgChanged(QString itemName, QVariant value) |
|
|
|
|
{ |
|
|
|
|
m_settings.m_streamArgSettings[itemName] = value; |
|
|
|
|
sendSettings(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SoapySDROutputGui::on_centerFrequency_changed(quint64 value) |
|
|
|
|
{ |
|
|
|
|
m_settings.m_centerFrequency = value * 1000; |
|
|
|
|
@ -585,6 +675,7 @@ void SoapySDROutputGui::displaySettings()
@@ -585,6 +675,7 @@ void SoapySDROutputGui::displaySettings()
|
|
|
|
|
displayTunableElementsControlSettings(); |
|
|
|
|
displayIndividualGainsControlSettings(); |
|
|
|
|
displayCorrectionsSettings(); |
|
|
|
|
displayStreamArgsSettings(); |
|
|
|
|
|
|
|
|
|
blockApplySettings(false); |
|
|
|
|
} |
|
|
|
|
@ -640,6 +731,20 @@ void SoapySDROutputGui::displayCorrectionsSettings()
@@ -640,6 +731,20 @@ void SoapySDROutputGui::displayCorrectionsSettings()
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SoapySDROutputGui::displayStreamArgsSettings() |
|
|
|
|
{ |
|
|
|
|
for (const auto &it : m_streamArgsGUIs) |
|
|
|
|
{ |
|
|
|
|
QMap<QString, QVariant>::iterator elIt = m_settings.m_streamArgSettings.find(it->getName()); |
|
|
|
|
|
|
|
|
|
if (elIt != m_settings.m_streamArgSettings.end()) |
|
|
|
|
{ |
|
|
|
|
it->setValue(*elIt); |
|
|
|
|
*elIt = it->getValue(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SoapySDROutputGui::sendSettings() |
|
|
|
|
{ |
|
|
|
|
if (!m_updateTimer.isActive()) { |
|
|
|
|
|