QGCParamSlider.cc 19.1 KB
Newer Older
1 2
#include <QMenu>
#include <QContextMenuEvent>
3
#include <QSettings>
4
#include <QTimer>
Lorenz Meier's avatar
Lorenz Meier committed
5
#include <QToolTip>
6

7 8
#include "QGCParamSlider.h"
#include "ui_QGCParamSlider.h"
9
#include "UASInterface.h"
10
#include "UASManager.h"
11

12

13
QGCParamSlider::QGCParamSlider(QWidget *parent) :
14 15 16 17 18 19 20
    QGCToolWidgetItem("Slider", parent),
    parameterName(""),
    parameterValue(0.0f),
    parameterScalingFactor(0.0),
    parameterMin(0.0f),
    parameterMax(0.0f),
    component(0),
21 22
    ui(new Ui::QGCParamSlider)
{
23
    valueModLock = false;
24
    visibleEnabled = true;
25
    valueModLockParam = false;
26
    ui->setupUi(this);
27
    ui->intValueSpinBox->hide();
28 29
    ui->valueSlider->setEnabled(false);
    ui->doubleValueSpinBox->setEnabled(false);
30
    uas = NULL;
pixhawk's avatar
pixhawk committed
31 32 33

    scaledInt = ui->valueSlider->maximum() - ui->valueSlider->minimum();

34
    ui->editInfoCheckBox->hide();
35 36 37 38 39 40 41 42
    ui->editDoneButton->hide();
    ui->editNameLabel->hide();
    ui->editRefreshParamsButton->hide();
    ui->editSelectParamComboBox->hide();
    ui->editSelectComponentComboBox->hide();
    ui->editStatusLabel->hide();
    ui->editMinSpinBox->hide();
    ui->editMaxSpinBox->hide();
43 44
    ui->editLine1->hide();
    ui->editLine2->hide();
45
    ui->infoLabel->hide();
46

pixhawk's avatar
pixhawk committed
47
    connect(ui->editDoneButton, SIGNAL(clicked()), this, SLOT(endEditMode()));
48 49

    // Sending actions
50 51 52 53 54 55 56 57 58 59 60 61 62 63
    connect(ui->writeButton, SIGNAL(clicked()),
            this, SLOT(setParamPending()));
    connect(ui->editSelectComponentComboBox, SIGNAL(currentIndexChanged(int)),
            this, SLOT(selectComponent(int)));
    connect(ui->editSelectParamComboBox, SIGNAL(currentIndexChanged(int)),
            this, SLOT(selectParameter(int)));
    connect(ui->valueSlider, SIGNAL(valueChanged(int)),
            this, SLOT(setSliderValue(int)));
    connect(ui->doubleValueSpinBox, SIGNAL(valueChanged(double)),
            this, SLOT(setParamValue(double)));
    connect(ui->intValueSpinBox, SIGNAL(valueChanged(int)),
            this, SLOT(setParamValue(int)));
    connect(ui->editNameLabel, SIGNAL(textChanged(QString)),
            ui->nameLabel, SLOT(setText(QString)));
64
    connect(ui->readButton, SIGNAL(clicked()), this, SLOT(requestParameter()));
65 66 67 68
    connect(ui->editRefreshParamsButton, SIGNAL(clicked()),
            this, SLOT(refreshParamList()));
    connect(ui->editInfoCheckBox, SIGNAL(clicked(bool)),
            this, SLOT(showInfo(bool)));
Lorenz Meier's avatar
Lorenz Meier committed
69
    // connect to self
70 71
    connect(ui->infoLabel, SIGNAL(released()),
            this, SLOT(showTooltip()));
72
    // Set the current UAS if present
73 74
    connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)),
            this, SLOT(setActiveUAS(UASInterface*)));
75 76 77 78 79 80 81
}

QGCParamSlider::~QGCParamSlider()
{
    delete ui;
}

Lorenz Meier's avatar
Lorenz Meier committed
82 83 84 85 86 87
void QGCParamSlider::showTooltip()
{
    QWidget* sender = dynamic_cast<QWidget*>(QObject::sender());

    if (sender)
    {
88
        QPoint point = mapToGlobal(ui->infoLabel->pos());
Lorenz Meier's avatar
Lorenz Meier committed
89 90 91 92
        QToolTip::showText(point, sender->toolTip());
    }
}

93 94 95 96
void QGCParamSlider::refreshParamList()
{
    ui->editSelectParamComboBox->setEnabled(true);
    ui->editSelectComponentComboBox->setEnabled(true);
97
    if (uas) {
98
        uas->getParamManager()->requestParameterList();
Lorenz Meier's avatar
Lorenz Meier committed
99
        ui->editStatusLabel->setText(tr("Parameter list updating.."));
100 101 102
    }
}

103 104
void QGCParamSlider::setActiveUAS(UASInterface* activeUas)
{
105

106 107 108 109
    if (uas != activeUas)  {
        if (uas) {
            disconnect(uas, SIGNAL(parameterChanged(int,int,int,int,QString,QVariant)),
                       this, SLOT(setParameterValue(int,int,int,int,QString,QVariant)));
110
        }
111 112 113
        if (activeUas) {
            connect(activeUas, SIGNAL(parameterChanged(int,int,int,int,QString,QVariant)),
                    this, SLOT(setParameterValue(int,int,int,int,QString,QVariant)), Qt::UniqueConnection);
114
        }
115
        uas = activeUas;
116
    }
117 118

    if (uas && !parameterName.isEmpty()) {
119
        QString text =  uas->getParamManager()->dataModel()->getParamDescription(parameterName);
120 121 122 123 124 125 126 127 128 129 130
        if (!text.isEmpty()) {
            ui->infoLabel->setToolTip(text);
            ui->infoLabel->show();
        }
        // Force-uncheck and hide label if no description is available
        if (ui->editInfoCheckBox->isChecked()) {
            showInfo((text.length() > 0));
        }
    }


131 132 133 134
}

void QGCParamSlider::requestParameter()
{
135 136
    if (uas && !parameterName.isEmpty()) {
        uas->getParamManager()->requestParameterUpdate(component, parameterName);
137 138 139
    }
}

140 141 142 143 144 145
void QGCParamSlider::showInfo(bool enable)
{
    ui->editInfoCheckBox->setChecked(enable);
    ui->infoLabel->setVisible(enable);
}

146 147
void QGCParamSlider::setParamValue(double value)
{
148
    parameterValue = (float)value;
149 150 151 152 153 154 155 156 157 158 159
     //disconnect(ui->valueSlider,SIGNAL(valueChanged(int)));
    if (!valueModLock && !valueModLockParam)
    {
        valueModLock = true;
        ui->valueSlider->setValue(floatToScaledInt(value));
    }
    else
    {
        valueModLock = false;
    }
    //connect(ui->valueSlider, SIGNAL(valueChanged(int)), this, SLOT(setSliderValue(int)));
160 161
}

162 163 164
void QGCParamSlider::setParamValue(int value)
{
    parameterValue = value;
165 166 167 168 169 170 171 172 173 174 175
    // disconnect(ui->valueSlider,SIGNAL(valueChanged(int)));
    if (!valueModLock && !valueModLockParam)
    {
        valueModLock = true;
        ui->valueSlider->setValue(floatToScaledInt(value));
    }
    else
    {
        valueModLock = false;
    }
    //connect(ui->valueSlider, SIGNAL(valueChanged(int)), this, SLOT(setSliderValue(int)));
176 177
}

178 179 180 181 182 183 184
void QGCParamSlider::selectComponent(int componentIndex)
{
    this->component = ui->editSelectComponentComboBox->itemData(componentIndex).toInt();
}

void QGCParamSlider::selectParameter(int paramIndex)
{
LM's avatar
LM committed
185
    // Set name
186
    parameterName = ui->editSelectParamComboBox->itemText(paramIndex);
tstellanova's avatar
tstellanova committed
187 188 189
    if (parameterName.isEmpty()) {
        return;
    }
LM's avatar
LM committed
190 191

    // Update min and max values if available
192
    if (uas) {
193
        UASParameterDataModel* dataModel =  uas->getParamManager()->dataModel();
194
        if (dataModel) {
LM's avatar
LM committed
195
            // Minimum
196 197
            if (dataModel->isParamMinKnown(parameterName)) {
                parameterMin = dataModel->getParamMin(parameterName);
LM's avatar
LM committed
198 199 200 201
                ui->editMinSpinBox->setValue(parameterMin);
            }

            // Maximum
202 203
            if (dataModel->isParamMaxKnown(parameterName)) {
                parameterMax = dataModel->getParamMax(parameterName);
LM's avatar
LM committed
204 205 206 207
                ui->editMaxSpinBox->setValue(parameterMax);
            }
        }
    }
208 209
}

210 211
void QGCParamSlider::startEditMode()
{
212
    ui->valueSlider->hide();
213 214
    ui->doubleValueSpinBox->hide();
    ui->intValueSpinBox->hide();
215 216 217 218
    ui->nameLabel->hide();
    ui->writeButton->hide();
    ui->readButton->hide();

219
    ui->editInfoCheckBox->show();
pixhawk's avatar
pixhawk committed
220
    ui->editDoneButton->show();
221
    ui->editNameLabel->show();
pixhawk's avatar
pixhawk committed
222 223 224 225 226 227
    ui->editRefreshParamsButton->show();
    ui->editSelectParamComboBox->show();
    ui->editSelectComponentComboBox->show();
    ui->editStatusLabel->show();
    ui->editMinSpinBox->show();
    ui->editMaxSpinBox->show();
228 229
    ui->writeButton->hide();
    ui->readButton->hide();
230 231
    ui->editLine1->show();
    ui->editLine2->show();
232 233 234 235 236
    isInEditMode = true;
}

void QGCParamSlider::endEditMode()
{
237 238 239 240 241 242 243 244 245 246
    // Store component id
    selectComponent(ui->editSelectComponentComboBox->currentIndex());

    // Store parameter name and id
    selectParameter(ui->editSelectParamComboBox->currentIndex());

    // Min/max
    parameterMin = ui->editMinSpinBox->value();
    parameterMax = ui->editMaxSpinBox->value();

247
    ui->editInfoCheckBox->hide();
pixhawk's avatar
pixhawk committed
248
    ui->editDoneButton->hide();
249
    ui->editNameLabel->hide();
pixhawk's avatar
pixhawk committed
250 251 252 253 254 255
    ui->editRefreshParamsButton->hide();
    ui->editSelectParamComboBox->hide();
    ui->editSelectComponentComboBox->hide();
    ui->editStatusLabel->hide();
    ui->editMinSpinBox->hide();
    ui->editMaxSpinBox->hide();
256 257
    ui->editLine1->hide();
    ui->editLine2->hide();
258 259
    ui->writeButton->show();
    ui->readButton->show();
260
    ui->valueSlider->show();
261
    switch ((int)parameterValue.type())
262
    {
263
    case QVariant::Char:
264 265 266 267 268 269 270 271 272 273 274
    case QVariant::Int:
    case QVariant::UInt:
        ui->intValueSpinBox->show();
        break;
    case QMetaType::Float:
        ui->doubleValueSpinBox->show();
        break;
    default:
        qCritical() << "ERROR: NO VALID PARAM TYPE";
        return;
    }
275
    ui->nameLabel->show();
276
    isInEditMode = false;
lm's avatar
lm committed
277
    emit editingFinished();
278 279
}

280
void QGCParamSlider::setParamPending()
281
{
282 283
    if (uas)  {
        uas->getParamManager()->setPendingParam(component, parameterName, parameterValue);
284
    }
285 286
    else {
        qWarning() << __FILE__ << __LINE__ << "NO UAS SET, DOING NOTHING";
287 288 289
    }
}

pixhawk's avatar
pixhawk committed
290 291
void QGCParamSlider::setSliderValue(int sliderValue)
{
292
    if (!valueModLock && !valueModLockParam)
293
    {
294
        valueModLock = true;
295
        switch ((int)parameterValue.type())
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321
        {
        case QVariant::Char:
            parameterValue = QVariant(QChar((unsigned char)scaledIntToFloat(sliderValue)));
            ui->intValueSpinBox->setValue(parameterValue.toInt());
            break;
        case QVariant::Int:
            parameterValue = (int)scaledIntToFloat(sliderValue);
            ui->intValueSpinBox->setValue(parameterValue.toInt());
            break;
        case QVariant::UInt:
            parameterValue = (unsigned int)scaledIntToFloat(sliderValue);
            ui->intValueSpinBox->setValue(parameterValue.toUInt());
            break;
        case QMetaType::Float:
            parameterValue = scaledIntToFloat(sliderValue);
            ui->doubleValueSpinBox->setValue(parameterValue.toFloat());
            break;
        default:
            qCritical() << "ERROR: NO VALID PARAM TYPE";
            valueModLock = false;
            return;
        }
    }
    else
    {
        valueModLock = false;
322
    }
pixhawk's avatar
pixhawk committed
323 324
}

325 326 327 328 329 330
/**
 * @brief uas Unmanned system sending the parameter
 * @brief component UAS component sending the parameter
 * @brief parameterName Key/name of the parameter
 * @brief value Value of the parameter
 */
331
void QGCParamSlider::setParameterValue(int uasId, int compId, int paramCount, int paramIndex, QString paramName, QVariant value)
pixhawk's avatar
pixhawk committed
332
{
333
    Q_UNUSED(paramCount);
334 335 336 337 338 339
    if (uasId != this->uas->getUASID()) {
        return;
    }

    if (ui->nameLabel->text() == "Name")  {
        ui->nameLabel->setText(paramName);
340
    }
341 342
    // Check if this component and parameter are part of the list
    bool found = false;
343 344
    for (int i = 0; i< ui->editSelectComponentComboBox->count(); ++i) {
        if (compId == ui->editSelectComponentComboBox->itemData(i).toInt()) {
345 346 347 348
            found = true;
        }
    }

349 350
    if (!found) {
        ui->editSelectComponentComboBox->addItem(tr("Component #%1").arg(compId), compId);
351 352 353 354
    }

    // Parameter checking
    found = false;
355 356
    for (int i = 0; i < ui->editSelectParamComboBox->count(); ++i) {
        if (paramName == ui->editSelectParamComboBox->itemText(i))  {
357 358 359 360
            found = true;
        }
    }

361 362
    if (!found) {
        ui->editSelectParamComboBox->addItem(paramName, paramIndex);
363 364
    }

365 366 367 368
    if (visibleParam != "") {
        if (paramName == visibleParam)  {
            if (visibleVal == value.toInt())  {
                uas->getParamManager()->requestParameterUpdate(compId,paramName);
369 370 371
                visibleEnabled = true;
                this->show();
            }
372
            else  {
373 374 375 376 377 378 379 380 381
                //Disable the component here.
                ui->valueSlider->setEnabled(false);
                ui->intValueSpinBox->setEnabled(false);
                ui->doubleValueSpinBox->setEnabled(false);
                visibleEnabled = false;
                this->hide();
            }
        }
    }
382
    Q_UNUSED(uas);
383 384
    if (compId == this->component && paramName == this->parameterName) {
        if (!visibleEnabled) {
385 386
            return;
        }
387
        parameterValue = value;
388
        ui->valueSlider->setEnabled(true);
389
        valueModLockParam = true;
390
        switch ((int)value.type())
391
        {
392 393 394 395 396
        case QVariant::Char:
            ui->intValueSpinBox->show();
            ui->intValueSpinBox->setEnabled(true);
            ui->doubleValueSpinBox->hide();
            ui->intValueSpinBox->setValue(value.toUInt());
397
            ui->intValueSpinBox->setRange(0, UINT8_MAX);
398 399
            if (parameterMax == 0 && parameterMin == 0)
            {
400
                ui->editMaxSpinBox->setValue(UINT8_MAX);
401 402
                ui->editMinSpinBox->setValue(0);
            }
403
            ui->valueSlider->setValue(floatToScaledInt(value.toUInt()));
404
            break;
405 406
        case QVariant::Int:
            ui->intValueSpinBox->show();
407
            ui->intValueSpinBox->setEnabled(true);
408
            ui->doubleValueSpinBox->hide();
409
            ui->intValueSpinBox->setValue(value.toInt());
410
            ui->intValueSpinBox->setRange(INT32_MIN, INT32_MAX);
411 412
            if (parameterMax == 0 && parameterMin == 0)
            {
413 414
                ui->editMaxSpinBox->setValue(INT32_MAX);
                ui->editMinSpinBox->setValue(INT32_MIN);
415
            }
416
            ui->valueSlider->setValue(floatToScaledInt(value.toInt()));
417 418 419
            break;
        case QVariant::UInt:
            ui->intValueSpinBox->show();
420
            ui->intValueSpinBox->setEnabled(true);
421
            ui->doubleValueSpinBox->hide();
422
            ui->intValueSpinBox->setValue(value.toUInt());
423
            ui->intValueSpinBox->setRange(0, UINT32_MAX);
424 425
            if (parameterMax == 0 && parameterMin == 0)
            {
426
                ui->editMaxSpinBox->setValue(UINT32_MAX);
427 428
                ui->editMinSpinBox->setValue(0);
            }
429
            ui->valueSlider->setValue(floatToScaledInt(value.toUInt()));
430 431
            break;
        case QMetaType::Float:
432
            ui->doubleValueSpinBox->setValue(value.toFloat());
433
            ui->doubleValueSpinBox->show();
434
            ui->doubleValueSpinBox->setEnabled(true);
435
            ui->intValueSpinBox->hide();
436 437 438 439 440
            if (parameterMax == 0 && parameterMin == 0)
            {
                ui->editMaxSpinBox->setValue(10000);
                ui->editMinSpinBox->setValue(0);
            }
441
            ui->valueSlider->setValue(floatToScaledInt(value.toFloat()));
442 443 444
            break;
        default:
            qCritical() << "ERROR: NO VALID PARAM TYPE";
445
            valueModLockParam = false;
446 447
            return;
        }
448 449 450
        valueModLockParam = false;
        parameterMax = ui->editMaxSpinBox->value();
        parameterMin = ui->editMinSpinBox->value();
451
    }
Lorenz Meier's avatar
Lorenz Meier committed
452

453
    if (paramIndex == paramCount - 1) {
Lorenz Meier's avatar
Lorenz Meier committed
454 455
        ui->editStatusLabel->setText(tr("Complete parameter list received."));
    }
pixhawk's avatar
pixhawk committed
456 457
}

458 459 460 461 462 463 464 465 466 467 468
void QGCParamSlider::changeEvent(QEvent *e)
{
    QWidget::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}
lm's avatar
lm committed
469

pixhawk's avatar
pixhawk committed
470
float QGCParamSlider::scaledIntToFloat(int sliderValue)
lm's avatar
lm committed
471
{
472
    float result = (((double)sliderValue)/(double)scaledInt)*(ui->editMaxSpinBox->value() - ui->editMinSpinBox->value());
473
    //qDebug() << "INT TO FLOAT: CONVERTED" << sliderValue << "TO" << result;
474
    return result;
pixhawk's avatar
pixhawk committed
475
}
lm's avatar
lm committed
476

pixhawk's avatar
pixhawk committed
477 478
int QGCParamSlider::floatToScaledInt(float value)
{
479
    int result = ((value - ui->editMinSpinBox->value())/(ui->editMaxSpinBox->value() - ui->editMinSpinBox->value()))*scaledInt;
480
    //qDebug() << "FLOAT TO INT: CONVERTED" << value << "TO" << result << "SCALEDINT" << scaledInt;
481
    return result;
lm's avatar
lm committed
482 483
}

pixhawk's avatar
pixhawk committed
484
void QGCParamSlider::writeSettings(QSettings& settings)
lm's avatar
lm committed
485
{
pixhawk's avatar
pixhawk committed
486 487 488
    settings.setValue("TYPE", "SLIDER");
    settings.setValue("QGC_PARAM_SLIDER_DESCRIPTION", ui->nameLabel->text());
    //settings.setValue("QGC_PARAM_SLIDER_BUTTONTEXT", ui->actionButton->text());
489 490
    settings.setValue("QGC_PARAM_SLIDER_PARAMID", parameterName);
    settings.setValue("QGC_PARAM_SLIDER_COMPONENTID", component);
pixhawk's avatar
pixhawk committed
491 492
    settings.setValue("QGC_PARAM_SLIDER_MIN", ui->editMinSpinBox->value());
    settings.setValue("QGC_PARAM_SLIDER_MAX", ui->editMaxSpinBox->value());
493
    settings.setValue("QGC_PARAM_SLIDER_DISPLAY_INFO", ui->editInfoCheckBox->isChecked());
pixhawk's avatar
pixhawk committed
494
    settings.sync();
lm's avatar
lm committed
495
}
496 497 498 499 500 501 502 503 504 505 506 507
void QGCParamSlider::readSettings(const QString& pre,const QVariantMap& settings)
{
    parameterName = settings.value(pre + "QGC_PARAM_SLIDER_PARAMID").toString();
    component = settings.value(pre + "QGC_PARAM_SLIDER_COMPONENTID").toInt();
    ui->nameLabel->setText(settings.value(pre + "QGC_PARAM_SLIDER_DESCRIPTION").toString());
    ui->editNameLabel->setText(settings.value(pre + "QGC_PARAM_SLIDER_DESCRIPTION").toString());
    //settings.setValue("QGC_PARAM_SLIDER_BUTTONTEXT", ui->actionButton->text());
    ui->editSelectParamComboBox->addItem(settings.value(pre + "QGC_PARAM_SLIDER_PARAMID").toString());
    ui->editSelectParamComboBox->setCurrentIndex(ui->editSelectParamComboBox->count()-1);
    ui->editSelectComponentComboBox->addItem(tr("Component #%1").arg(settings.value(pre + "QGC_PARAM_SLIDER_COMPONENTID").toInt()), settings.value(pre + "QGC_PARAM_SLIDER_COMPONENTID").toInt());
    ui->editMinSpinBox->setValue(settings.value(pre + "QGC_PARAM_SLIDER_MIN").toFloat());
    ui->editMaxSpinBox->setValue(settings.value(pre + "QGC_PARAM_SLIDER_MAX").toFloat());
508 509
    visibleParam = settings.value(pre+"QGC_PARAM_SLIDER_VISIBLE_PARAM","").toString();
    visibleVal = settings.value(pre+"QGC_PARAM_SLIDER_VISIBLE_VAL",0).toInt();
510 511 512 513
    parameterMax = ui->editMaxSpinBox->value();
    parameterMin = ui->editMinSpinBox->value();
    //ui->valueSlider->setMaximum(parameterMax);
    //ui->valueSlider->setMinimum(parameterMin);
514 515 516 517 518 519 520 521 522
    showInfo(settings.value(pre + "QGC_PARAM_SLIDER_DISPLAY_INFO", true).toBool());
    ui->editSelectParamComboBox->setEnabled(true);
    ui->editSelectComponentComboBox->setEnabled(true);

    setActiveUAS(UASManager::instance()->getActiveUAS());

    // Get param value after settings have been loaded
    //requestParameter();
}
lm's avatar
lm committed
523 524 525

void QGCParamSlider::readSettings(const QSettings& settings)
{
526 527 528 529 530 531 532 533
    QVariantMap map;
    foreach (QString key,settings.allKeys())
    {
        map[key] = settings.value(key);
    }

    readSettings("",map);
    return;
534 535
    parameterName = settings.value("QGC_PARAM_SLIDER_PARAMID").toString();
    component = settings.value("QGC_PARAM_SLIDER_COMPONENTID").toInt();
pixhawk's avatar
pixhawk committed
536
    ui->nameLabel->setText(settings.value("QGC_PARAM_SLIDER_DESCRIPTION").toString());
537
    ui->editNameLabel->setText(settings.value("QGC_PARAM_SLIDER_DESCRIPTION").toString());
pixhawk's avatar
pixhawk committed
538
    //settings.setValue("QGC_PARAM_SLIDER_BUTTONTEXT", ui->actionButton->text());
539 540
    ui->editSelectParamComboBox->addItem(settings.value("QGC_PARAM_SLIDER_PARAMID").toString());
    ui->editSelectParamComboBox->setCurrentIndex(ui->editSelectParamComboBox->count()-1);
541
    ui->editSelectComponentComboBox->addItem(tr("Component #%1").arg(settings.value("QGC_PARAM_SLIDER_COMPONENTID").toInt()), settings.value("QGC_PARAM_SLIDER_COMPONENTID").toInt());
542 543
    ui->editMinSpinBox->setValue(settings.value("QGC_PARAM_SLIDER_MIN").toFloat());
    ui->editMaxSpinBox->setValue(settings.value("QGC_PARAM_SLIDER_MAX").toFloat());
544 545 546
    visibleParam = settings.value("QGC_PARAM_SLIDER_VISIBLE_PARAM","").toString();
             //QGC_TOOL_WIDGET_ITEMS\1\QGC_PARAM_SLIDER_VISIBLE_PARAM=RC5_FUNCTION
    visibleVal = settings.value("QGC_PARAM_SLIDER_VISIBLE_VAL",0).toInt();
547 548
    parameterMax = ui->editMaxSpinBox->value();
    parameterMin = ui->editMinSpinBox->value();
549
    showInfo(settings.value("QGC_PARAM_SLIDER_DISPLAY_INFO", true).toBool());
550 551
    ui->editSelectParamComboBox->setEnabled(true);
    ui->editSelectComponentComboBox->setEnabled(true);
552 553 554 555

    setActiveUAS(UASManager::instance()->getActiveUAS());

    // Get param value after settings have been loaded
556
    //requestParameter();
lm's avatar
lm committed
557
}