Fact.cc 18 KB
Newer Older
1 2 3 4 5 6 7 8 9
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

Don Gagne's avatar
Don Gagne committed
10
#include "Fact.h"
11
#include "FactValueSliderListModel.h"
Don Gagne's avatar
Don Gagne committed
12
#include "QGCMAVLink.h"
13 14
#include "QGCApplication.h"
#include "QGCCorePlugin.h"
Don Gagne's avatar
Don Gagne committed
15 16

#include <QtQml>
17
#include <QQmlEngine>
Don Gagne's avatar
Don Gagne committed
18

19 20
static const char* kMissingMetadata = "Meta data pointer missing";

Don Gagne's avatar
Don Gagne committed
21
Fact::Fact(QObject* parent)
22 23 24 25 26 27
    : QObject                   (parent)
    , _componentId              (-1)
    , _rawValue                 (0)
    , _type                     (FactMetaData::valueTypeInt32)
    , _metaData                 (NULL)
    , _sendValueChangedSignals  (true)
Don Gagne's avatar
Don Gagne committed
28
    , _deferredValueChangeSignal(false)
29
    , _valueSliderModel         (NULL)
Don Gagne's avatar
Don Gagne committed
30 31 32
{    
    FactMetaData* metaData = new FactMetaData(_type, this);
    setMetaData(metaData);
33

34
    _init();
Don Gagne's avatar
Don Gagne committed
35 36
}

Don Gagne's avatar
Don Gagne committed
37
Fact::Fact(int componentId, QString name, FactMetaData::ValueType_t type, QObject* parent)
38 39 40 41 42 43 44
    : QObject                   (parent)
    , _name                     (name)
    , _componentId              (componentId)
    , _rawValue                 (0)
    , _type                     (type)
    , _metaData                 (NULL)
    , _sendValueChangedSignals  (true)
Don Gagne's avatar
Don Gagne committed
45
    , _deferredValueChangeSignal(false)
46
    , _valueSliderModel         (NULL)
Don Gagne's avatar
Don Gagne committed
47
{
Don Gagne's avatar
Don Gagne committed
48 49
    FactMetaData* metaData = new FactMetaData(_type, this);
    setMetaData(metaData);
50 51

    _init();
Don Gagne's avatar
Don Gagne committed
52
}
Don Gagne's avatar
Don Gagne committed
53

54
Fact::Fact(const QString& settingsGroup, FactMetaData* metaData, QObject* parent)
55 56 57 58 59 60 61 62
    : QObject(parent)
    , _name                     (metaData->name())
    , _componentId              (0)
    , _rawValue                 (0)
    , _type                     (metaData->type())
    , _metaData                 (NULL)
    , _sendValueChangedSignals  (true)
    , _deferredValueChangeSignal(false)
63
    , _valueSliderModel         (NULL)
64
{
65
    qgcApp()->toolbox()->corePlugin()->adjustSettingMetaData(settingsGroup, *metaData);
66
    setMetaData(metaData, true /* setDefaultFromMetaData */);
67 68

    _init();
69 70
}

Don Gagne's avatar
Don Gagne committed
71 72 73 74
Fact::Fact(const Fact& other, QObject* parent)
    : QObject(parent)
{
    *this = other;
75 76 77 78 79 80

    _init();
}

void Fact::_init(void)
{
81
    QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
82
    connect(this, &Fact::_containerRawValueChanged, this, &Fact::_checkForRebootMessaging);
Don Gagne's avatar
Don Gagne committed
83 84 85 86
}

const Fact& Fact::operator=(const Fact& other)
{
Don Gagne's avatar
Don Gagne committed
87 88 89 90 91 92
    _name                       = other._name;
    _componentId                = other._componentId;
    _rawValue                   = other._rawValue;
    _type                       = other._type;
    _sendValueChangedSignals    = other._sendValueChangedSignals;
    _deferredValueChangeSignal  = other._deferredValueChangeSignal;
93
    _valueSliderModel       = NULL;
Don Gagne's avatar
Don Gagne committed
94 95 96 97 98 99 100
    if (_metaData && other._metaData) {
        *_metaData = *other._metaData;
    } else {
        _metaData = NULL;
    }
    
    return *this;
Don Gagne's avatar
Don Gagne committed
101 102
}

Don Gagne's avatar
Don Gagne committed
103
void Fact::forceSetRawValue(const QVariant& value)
104 105 106 107 108
{
    if (_metaData) {
        QVariant    typedValue;
        QString     errorString;
        
109
        if (_metaData->convertAndValidateRaw(value, true /* convertOnly */, typedValue, errorString)) {
Don Gagne's avatar
Don Gagne committed
110
            _rawValue.setValue(typedValue);
Don Gagne's avatar
Don Gagne committed
111
            _sendValueChangedSignal(cookedValue());
112 113
            //-- Must be in this order
            emit _containerRawValueChanged(rawValue());
114
            emit rawValueChanged(_rawValue);
115 116
        }
    } else {
117
        qWarning() << kMissingMetadata << name();
118 119 120
    }
}

Gus Grubba's avatar
Gus Grubba committed
121
void Fact::setRawValue(const QVariant& value)
Don Gagne's avatar
Don Gagne committed
122
{
Don Gagne's avatar
Don Gagne committed
123 124 125 126
    if (_metaData) {
        QVariant    typedValue;
        QString     errorString;
        
127
        if (_metaData->convertAndValidateRaw(value, true /* convertOnly */, typedValue, errorString)) {
128 129
            if (typedValue != _rawValue) {
                _rawValue.setValue(typedValue);
Don Gagne's avatar
Don Gagne committed
130
                _sendValueChangedSignal(cookedValue());
131 132
                //-- Must be in this order
                emit _containerRawValueChanged(rawValue());
133
                emit rawValueChanged(_rawValue);
Don Gagne's avatar
Don Gagne committed
134 135 136
            }
        }
    } else {
137
        qWarning() << kMissingMetadata << name();
138
    }
Don Gagne's avatar
Don Gagne committed
139 140
}

Don Gagne's avatar
Don Gagne committed
141
void Fact::setCookedValue(const QVariant& value)
142 143 144 145
{
    if (_metaData) {
        setRawValue(_metaData->cookedTranslator()(value));
    } else {
146
        qWarning() << kMissingMetadata << name();
147 148 149 150 151 152 153 154
    }
}

void Fact::setEnumStringValue(const QString& value)
{
    if (_metaData) {
        int index = _metaData->enumStrings().indexOf(value);
        if (index != -1) {
Don Gagne's avatar
Don Gagne committed
155
            setCookedValue(_metaData->enumValues()[index]);
156 157
        }
    } else {
158
        qWarning() << kMissingMetadata << name();
159 160 161 162 163 164
    }
}

void Fact::setEnumIndex(int index)
{
    if (_metaData) {
Don Gagne's avatar
Don Gagne committed
165
        setCookedValue(_metaData->enumValues()[index]);
166
    } else {
167
        qWarning() << kMissingMetadata << name();
168 169 170
    }
}

Don Gagne's avatar
Don Gagne committed
171
void Fact::_containerSetRawValue(const QVariant& value)
Don Gagne's avatar
Don Gagne committed
172
{
173 174 175 176 177
    if(_rawValue != value) {
        _rawValue = value;
        _sendValueChangedSignal(cookedValue());
        emit rawValueChanged(_rawValue);
    }
178 179 180

    // This always need to be signalled in order to support forceSetRawValue usage and waiting for vehicleUpdated signal
    emit vehicleUpdated(_rawValue);
Don Gagne's avatar
Don Gagne committed
181
}
182 183 184 185 186 187

QString Fact::name(void) const
{
    return _name;
}

188 189 190 191 192
int Fact::componentId(void) const
{
    return _componentId;
}

Don Gagne's avatar
Don Gagne committed
193
QVariant Fact::cookedValue(void) const
194
{
195 196 197
    if (_metaData) {
        return _metaData->rawTranslator()(_rawValue);
    } else {
198
        qWarning() << kMissingMetadata << name();
199 200 201 202
        return _rawValue;
    }
}

203
QString Fact::enumStringValue(void)
204 205 206
{
    if (_metaData) {
        int enumIndex = this->enumIndex();
Don Gagne's avatar
Don Gagne committed
207
        if (enumIndex >= 0 && enumIndex < _metaData->enumStrings().count()) {
208 209 210
            return _metaData->enumStrings()[enumIndex];
        }
    } else {
211
        qWarning() << kMissingMetadata << name();
212 213 214 215 216
    }

    return QString();
}

217
int Fact::enumIndex(void)
218
{
219
    static const double accuracy = 1.0 / 1000000.0;
220
    if (_metaData) {
221 222 223
        //-- Only enums have an index
        if(_metaData->enumValues().count()) {
            int index = 0;
224
            for (QVariant enumValue: _metaData->enumValues()) {
225
                if (enumValue == rawValue()) {
226 227
                    return index;
                }
228 229 230 231 232 233 234 235
                //-- Float comparissons don't always work
                if(type() == FactMetaData::valueTypeFloat || type() == FactMetaData::valueTypeDouble) {
                    double diff = fabs(enumValue.toDouble() - rawValue().toDouble());
                    if(diff < accuracy) {
                        return index;
                    }
                }
                index ++;
236
            }
237
            // Current value is not in list, add it manually
238
            _metaData->addEnumInfo(tr("Unknown: %1").arg(rawValue().toString()), rawValue());
239 240
            emit enumsChanged();
            return index;
241 242
        }
    } else {
243
        qWarning() << kMissingMetadata << name();
244 245 246 247 248 249 250 251 252
    }
    return -1;
}

QStringList Fact::enumStrings(void) const
{
    if (_metaData) {
        return _metaData->enumStrings();
    } else {
253
        qWarning() << kMissingMetadata << name();
254 255 256 257 258 259 260 261 262
        return QStringList();
    }
}

QVariantList Fact::enumValues(void) const
{
    if (_metaData) {
        return _metaData->enumValues();
    } else {
263
        qWarning() << kMissingMetadata << name();
264 265
        return QVariantList();
    }
266 267
}

268 269 270
void Fact::setEnumInfo(const QStringList& strings, const QVariantList& values)
{
    if (_metaData) {
271
        _metaData->setEnumInfo(strings, values);
272
    } else {
273
        qWarning() << kMissingMetadata << name();
274 275 276
    }
}

277 278 279 280 281
QStringList Fact::bitmaskStrings(void) const
{
    if (_metaData) {
        return _metaData->bitmaskStrings();
    } else {
282
        qWarning() << kMissingMetadata << name();
283 284 285 286 287 288 289 290 291
        return QStringList();
    }
}

QVariantList Fact::bitmaskValues(void) const
{
    if (_metaData) {
        return _metaData->bitmaskValues();
    } else {
292
        qWarning() << kMissingMetadata << name();
293 294 295 296
        return QVariantList();
    }
}

297
QString Fact::_variantToString(const QVariant& variant, int decimalPlaces) const
298
{
299 300 301
    QString valueString;

    switch (type()) {
Don Gagne's avatar
Don Gagne committed
302 303 304 305 306 307
    case FactMetaData::valueTypeFloat:
    {
        float fValue = variant.toFloat();
        if (qIsNaN(fValue)) {
            valueString = QStringLiteral("--.--");
        } else {
308
            valueString = QString("%1").arg(fValue, 0, 'f', decimalPlaces);
Don Gagne's avatar
Don Gagne committed
309 310 311 312 313 314 315 316 317
        }
    }
        break;
    case FactMetaData::valueTypeDouble:
    {
        double dValue = variant.toDouble();
        if (qIsNaN(dValue)) {
            valueString = QStringLiteral("--.--");
        } else {
318
            valueString = QString("%1").arg(dValue, 0, 'f', decimalPlaces);
Don Gagne's avatar
Don Gagne committed
319 320 321
        }
    }
        break;
Don Gagne's avatar
Don Gagne committed
322 323 324
    case FactMetaData::valueTypeBool:
        valueString = variant.toBool() ? tr("true") : tr("false");
        break;
325 326 327 328 329 330 331 332 333 334 335 336
    case FactMetaData::valueTypeElapsedTimeInSeconds:
    {
        double dValue = variant.toDouble();
        if (qIsNaN(dValue)) {
            valueString = QStringLiteral("--:--:--");
        } else {
            QTime time(0, 0, 0, 0);
            time = time.addSecs(dValue);
            valueString = time.toString(QStringLiteral("hh:mm:ss"));
        }
    }
        break;
Don Gagne's avatar
Don Gagne committed
337 338 339
    default:
        valueString = variant.toString();
        break;
340 341 342
    }

    return valueString;
343 344
}

345 346 347 348 349 350
QString Fact::rawValueStringFullPrecision(void) const
{
    return _variantToString(rawValue(), 18);
}


351 352
QString Fact::rawValueString(void) const
{
353
    return _variantToString(rawValue(), decimalPlaces());
354 355 356
}

QString Fact::cookedValueString(void) const
357
{
358
    return _variantToString(cookedValue(), decimalPlaces());
359 360
}

361 362 363 364 365 366 367 368
QVariant Fact::rawDefaultValue(void) const
{
    if (_metaData) {
        if (!_metaData->defaultValueAvailable()) {
            qDebug() << "Access to unavailable default value";
        }
        return _metaData->rawDefaultValue();
    } else {
369
        qWarning() << kMissingMetadata << name();
370 371 372 373 374
        return QVariant(0);
    }
}

QVariant Fact::cookedDefaultValue(void) const
375
{
Don Gagne's avatar
Don Gagne committed
376 377 378 379
    if (_metaData) {
        if (!_metaData->defaultValueAvailable()) {
            qDebug() << "Access to unavailable default value";
        }
380
        return _metaData->cookedDefaultValue();
Don Gagne's avatar
Don Gagne committed
381
    } else {
382
        qWarning() << kMissingMetadata << name();
Don Gagne's avatar
Don Gagne committed
383
        return QVariant(0);
384
    }
385 386
}

387
QString Fact::cookedDefaultValueString(void) const
388
{
389
    return _variantToString(cookedDefaultValue(), decimalPlaces());
390 391
}

392
FactMetaData::ValueType_t Fact::type(void) const
393
{
394
    return _type;
395 396
}

397
QString Fact::shortDescription(void) const
398
{
Don Gagne's avatar
Don Gagne committed
399 400 401
    if (_metaData) {
        return _metaData->shortDescription();
    } else {
402
        qWarning() << kMissingMetadata << name();
Don Gagne's avatar
Don Gagne committed
403 404
        return QString();
    }
405 406
}

407
QString Fact::longDescription(void) const
408
{
Don Gagne's avatar
Don Gagne committed
409 410 411
    if (_metaData) {
        return _metaData->longDescription();
    } else {
412
        qWarning() << kMissingMetadata << name();
Don Gagne's avatar
Don Gagne committed
413 414
        return QString();
    }
415 416
}

417 418 419 420 421
QString Fact::rawUnits(void) const
{
    if (_metaData) {
        return _metaData->rawUnits();
    } else {
422
        qWarning() << kMissingMetadata << name();
423 424 425 426 427
        return QString();
    }
}

QString Fact::cookedUnits(void) const
428
{
Don Gagne's avatar
Don Gagne committed
429
    if (_metaData) {
430
        return _metaData->cookedUnits();
Don Gagne's avatar
Don Gagne committed
431
    } else {
432
        qWarning() << kMissingMetadata << name();
Don Gagne's avatar
Don Gagne committed
433 434
        return QString();
    }
435 436
}

437
QVariant Fact::rawMin(void) const
438
{
Don Gagne's avatar
Don Gagne committed
439
    if (_metaData) {
440
        return _metaData->rawMin();
Don Gagne's avatar
Don Gagne committed
441
    } else {
442
        qWarning() << kMissingMetadata << name();
Don Gagne's avatar
Don Gagne committed
443 444
        return QVariant(0);
    }
445 446
}

447
QVariant Fact::cookedMin(void) const
448
{
449 450 451
    if (_metaData) {
        return _metaData->cookedMin();
    } else {
452
        qWarning() << kMissingMetadata << name();
453 454
        return QVariant(0);
    }
455 456
}

457 458
QString Fact::cookedMinString(void) const
{
459
    return _variantToString(cookedMin(), decimalPlaces());
460 461 462
}

QVariant Fact::rawMax(void) const
463
{
Don Gagne's avatar
Don Gagne committed
464
    if (_metaData) {
465
        return _metaData->rawMax();
Don Gagne's avatar
Don Gagne committed
466
    } else {
467
        qWarning() << kMissingMetadata << name();
Don Gagne's avatar
Don Gagne committed
468 469 470 471
        return QVariant(0);
    }
}

472
QVariant Fact::cookedMax(void) const
473
{
474 475 476
    if (_metaData) {
        return _metaData->cookedMax();
    } else {
477
        qWarning() << kMissingMetadata << name();
478 479 480 481 482 483
        return QVariant(0);
    }
}

QString Fact::cookedMaxString(void) const
{
484
    return _variantToString(cookedMax(), decimalPlaces());
485 486
}

487
bool Fact::minIsDefaultForType(void) const
Don Gagne's avatar
Don Gagne committed
488 489 490 491
{
    if (_metaData) {
        return _metaData->minIsDefaultForType();
    } else {
492
        qWarning() << kMissingMetadata << name();
Don Gagne's avatar
Don Gagne committed
493 494 495 496
        return false;
    }
}

497
bool Fact::maxIsDefaultForType(void) const
Don Gagne's avatar
Don Gagne committed
498 499 500 501
{
    if (_metaData) {
        return _metaData->maxIsDefaultForType();
    } else {
502
        qWarning() << kMissingMetadata << name();
Don Gagne's avatar
Don Gagne committed
503 504
        return false;
    }
505 506
}

507 508 509 510 511
int Fact::decimalPlaces(void) const
{
    if (_metaData) {
        return _metaData->decimalPlaces();
    } else {
512
        qWarning() << kMissingMetadata << name();
513 514 515 516
        return FactMetaData::defaultDecimalPlaces;
    }
}

517 518 519 520 521 522 523 524 525 526
QString Fact::category(void) const
{
    if (_metaData) {
        return _metaData->category();
    } else {
        qWarning() << kMissingMetadata << name();
        return QString();
    }
}

527
QString Fact::group(void) const
528
{
Don Gagne's avatar
Don Gagne committed
529 530 531
    if (_metaData) {
        return _metaData->group();
    } else {
532
        qWarning() << kMissingMetadata << name();
Don Gagne's avatar
Don Gagne committed
533 534
        return QString();
    }
535 536
}

537
void Fact::setMetaData(FactMetaData* metaData, bool setDefaultFromMetaData)
538 539
{
    _metaData = metaData;
540 541 542
    if (setDefaultFromMetaData) {
        setRawValue(rawDefaultValue());
    }
Don Gagne's avatar
Don Gagne committed
543
    emit valueChanged(cookedValue());
544
}
545

546
bool Fact::valueEqualsDefault(void) const
547
{
Don Gagne's avatar
Don Gagne committed
548 549
    if (_metaData) {
        if (_metaData->defaultValueAvailable()) {
550
            return _metaData->rawDefaultValue() == rawValue();
Don Gagne's avatar
Don Gagne committed
551 552 553
        } else {
            return false;
        }
554
    } else {
555
        qWarning() << kMissingMetadata << name();
556 557 558 559
        return false;
    }
}

560
bool Fact::defaultValueAvailable(void) const
561
{
Don Gagne's avatar
Don Gagne committed
562 563 564
    if (_metaData) {
        return _metaData->defaultValueAvailable();
    } else {
565
        qWarning() << kMissingMetadata << name();
Don Gagne's avatar
Don Gagne committed
566 567 568 569
        return false;
    }
}

570
QString Fact::validate(const QString& cookedValue, bool convertOnly)
Don Gagne's avatar
Don Gagne committed
571 572 573 574 575
{
    if (_metaData) {
        QVariant    typedValue;
        QString     errorString;
        
576
        _metaData->convertAndValidateCooked(cookedValue, convertOnly, typedValue, errorString);
Don Gagne's avatar
Don Gagne committed
577 578 579
        
        return errorString;
    } else {
580
        qWarning() << kMissingMetadata << name();
Don Gagne's avatar
Don Gagne committed
581 582 583
        return QString("Internal error: Meta data pointer missing");
    }
}
584

585 586 587 588 589 590 591 592 593 594 595
QVariant Fact::clamp(const QString& cookedValue)
{
    if (_metaData) {
        QVariant typedValue;
        if(_metaData->clampValue(cookedValue, typedValue)) {
            return typedValue;
        } else {
            //-- If conversion failed, return current value
            return rawValue();
        }
    } else {
596
        qWarning() << kMissingMetadata << name();
597 598 599 600
    }
    return QVariant();
}

601
bool Fact::vehicleRebootRequired(void) const
602 603
{
    if (_metaData) {
604 605 606 607 608 609 610 611 612 613 614
        return _metaData->vehicleRebootRequired();
    } else {
        qWarning() << kMissingMetadata << name();
        return false;
    }
}

bool Fact::qgcRebootRequired(void) const
{
    if (_metaData) {
        return _metaData->qgcRebootRequired();
615
    } else {
616
        qWarning() << kMissingMetadata << name();
617 618 619
        return false;
    }
}
Don Gagne's avatar
Don Gagne committed
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645

void Fact::setSendValueChangedSignals (bool sendValueChangedSignals)
{
    if (sendValueChangedSignals != _sendValueChangedSignals) {
        _sendValueChangedSignals = sendValueChangedSignals;
        emit sendValueChangedSignalsChanged(_sendValueChangedSignals);
    }
}

void Fact::_sendValueChangedSignal(QVariant value)
{
    if (_sendValueChangedSignals) {
        emit valueChanged(value);
        _deferredValueChangeSignal = false;
    } else {
        _deferredValueChangeSignal = true;
    }
}

void Fact::sendDeferredValueChangedSignal(void)
{
    if (_deferredValueChangeSignal) {
        _deferredValueChangeSignal = false;
        emit valueChanged(cookedValue());
    }
}
646 647 648 649 650 651 652 653 654 655

QString Fact::enumOrValueString(void)
{
    if (_metaData) {
        if (_metaData->enumStrings().count()) {
            return enumStringValue();
        } else {
            return cookedValueString();
        }
    } else {
656
        qWarning() << kMissingMetadata << name();
657 658 659
    }
    return QString();
}
Don Gagne's avatar
Don Gagne committed
660

661
double Fact::rawIncrement(void) const
Don Gagne's avatar
Don Gagne committed
662 663
{
    if (_metaData) {
664
        return _metaData->rawIncrement();
Don Gagne's avatar
Don Gagne committed
665
    } else {
666
        qWarning() << kMissingMetadata << name();
Don Gagne's avatar
Don Gagne committed
667 668 669
    }
    return std::numeric_limits<double>::quiet_NaN();
}
670

671 672 673 674 675 676 677 678 679 680
double Fact::cookedIncrement(void) const
{
    if (_metaData) {
        return _metaData->cookedIncrement();
    } else {
        qWarning() << kMissingMetadata << name();
    }
    return std::numeric_limits<double>::quiet_NaN();
}

681 682 683 684 685
bool Fact::hasControl(void) const
{
    if (_metaData) {
        return _metaData->hasControl();
    } else {
686
        qWarning() << kMissingMetadata << name();
687 688 689
        return false;
    }
}
690 691 692 693 694 695

bool Fact::readOnly(void) const
{
    if (_metaData) {
        return _metaData->readOnly();
    } else {
696
        qWarning() << kMissingMetadata << name();
697 698 699
        return false;
    }
}
700

701 702 703 704 705 706 707 708 709 710
bool Fact::writeOnly(void) const
{
    if (_metaData) {
        return _metaData->writeOnly();
    } else {
        qWarning() << kMissingMetadata << name();
        return false;
    }
}

711 712 713 714 715 716 717 718 719
bool Fact::volatileValue(void) const
{
    if (_metaData) {
        return _metaData->volatileValue();
    } else {
        qWarning() << kMissingMetadata << name();
        return false;
    }
}
720 721 722 723 724 725 726 727

FactValueSliderListModel* Fact::valueSliderModel(void)
{
    if (!_valueSliderModel) {
        _valueSliderModel = new FactValueSliderListModel(*this);
    }
    return _valueSliderModel;
}
728 729 730 731 732 733 734 735 736 737 738

void Fact::_checkForRebootMessaging(void)
{
    if (!qgcApp()->runningUnitTests()) {
        if (vehicleRebootRequired()) {
            qgcApp()->showMessage(tr("Change of parameter %1 requires a Vehicle reboot to take effect.").arg(name()));
        } else if (qgcRebootRequired()) {
            qgcApp()->showMessage(tr("Change of '%1' value requires restart of %2 to take effect.").arg(shortDescription()).arg(qgcApp()->applicationName()));
        }
    }
}