AirframeComponent.cc 1.7 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.
 *
 ****************************************************************************/

10 11 12 13 14

/// @file
///     @author Don Gagne <don@thegagnes.com>

#include "AirframeComponent.h"
15
#include "ParameterManager.h"
16

17
AirframeComponent::AirframeComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) :
18
    VehicleComponent(vehicle, autopilot, parent),
19 20
    _name(tr("Airframe"))
{
DonLakeFlyer's avatar
DonLakeFlyer committed
21

22 23 24 25 26 27 28 29 30
}

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

QString AirframeComponent::description(void) const
{
Gus Grubba's avatar
Gus Grubba committed
31
    return tr("Airframe Setup is used to select the airframe that matches your vehicle. "
nopeppermint's avatar
nopeppermint committed
32
              "This will in turn set up the various tuning values for flight parameters.");
33 34
}

35
QString AirframeComponent::iconResource(void) const
36
{
37
    return "/qmlimages/AirframeComponentIcon.png";
38 39 40 41 42 43 44 45 46
}

bool AirframeComponent::requiresSetup(void) const
{
    return true;
}

bool AirframeComponent::setupComplete(void) const
{
Don Gagne's avatar
Don Gagne committed
47
    return _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, QStringLiteral("SYS_AUTOSTART"))->rawValue().toInt() != 0;
48 49
}

Don Gagne's avatar
Don Gagne committed
50
QStringList AirframeComponent::setupCompleteChangedTriggerList(void) const
51
{
Don Gagne's avatar
Don Gagne committed
52
    return QStringList(QStringLiteral("SYS_AUTOSTART"));
53 54
}

55
QUrl AirframeComponent::setupSource(void) const
56
{
57
    return QUrl::fromUserInput("qrc:/qml/AirframeComponent.qml");
58 59
}

60
QUrl AirframeComponent::summaryQmlSource(void) const
61
{
62
    return QUrl::fromUserInput("qrc:/qml/AirframeComponentSummary.qml");
63
}