AdvancedParamConfig.cc 1.14 KB
Newer Older
1 2 3
#include "AdvancedParamConfig.h"


4
AdvancedParamConfig::AdvancedParamConfig(QWidget *parent) : AP2ConfigWidget(parent)
5 6 7 8 9 10 11
{
    ui.setupUi(this);
}

AdvancedParamConfig::~AdvancedParamConfig()
{
}
12 13 14
void AdvancedParamConfig::addRange(QString title,QString description,QString param,double min,double max)
{
    ParamWidget *widget = new ParamWidget(ui.scrollAreaWidgetContents);
15
    m_paramToWidgetMap[param] = widget;
16 17 18 19 20 21 22 23
    widget->setupDouble(title + "(" + param + ")",description,0,min,max);
    ui.verticalLayout->addWidget(widget);
    widget->show();
}

void AdvancedParamConfig::addCombo(QString title,QString description,QString param,QList<QPair<int,QString> > valuelist)
{
    ParamWidget *widget = new ParamWidget(ui.scrollAreaWidgetContents);
24
    m_paramToWidgetMap[param] = widget;
25 26 27 28 29 30
    widget->setupCombo(title + "(" + param + ")",description,valuelist);
    ui.verticalLayout->addWidget(widget);
    widget->show();
}
void AdvancedParamConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
31
    if (m_paramToWidgetMap.contains(parameterName))
32
    {
33
        m_paramToWidgetMap[parameterName]->setValue(value.toDouble());
34 35
    }
}