AirframeComponent.cc 1.73 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 "QGCQmlWidgetHolder.h"
16
#include "ParameterManager.h"
17

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

23 24 25 26 27 28 29 30 31
}

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

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

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

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

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

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

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

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