StandardParamConfig.cc 1.26 KB
Newer Older
1
#include "StandardParamConfig.h"
2 3 4 5 6 7 8 9
#include "ParamWidget.h"
StandardParamConfig::StandardParamConfig(QWidget *parent) : AP2ConfigWidget(parent)
{
    ui.setupUi(this);
}
StandardParamConfig::~StandardParamConfig()
{
}
10 11


12
void StandardParamConfig::activeUASSet(UASInterface *uas)
13
{
14 15 16 17 18 19 20 21 22 23

    AP2ConfigWidget::activeUASSet(uas);
}
void StandardParamConfig::addRange(QString title,QString description,QString param,double min,double max)
{
    ParamWidget *widget = new ParamWidget(ui.scrollAreaWidgetContents);
    paramToWidgetMap[param] = widget;
    widget->setupDouble(title + "(" + param + ")",description,0,min,max);
    ui.verticalLayout->addWidget(widget);
    widget->show();
24 25
}

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