APMTuningComponent.cc 1.95 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (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
9 10 11 12


#include "APMTuningComponent.h"
#include "APMAutoPilotPlugin.h"
13
#include "APMAirframeComponent.h"
14
#include "ParameterManager.h"
Don Gagne's avatar
Don Gagne committed
15 16

APMTuningComponent::APMTuningComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent)
17
    : VehicleComponent(vehicle, autopilot, parent)
Don Gagne's avatar
Don Gagne committed
18
    , _name(tr("Tuning"))
Don Gagne's avatar
Don Gagne committed
19 20 21 22 23 24 25 26 27 28
{
}

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

QString APMTuningComponent::description(void) const
{
29
    return tr("Tuning Setup is used to tune the flight characteristics of the Vehicle.");
Don Gagne's avatar
Don Gagne committed
30 31 32 33
}

QString APMTuningComponent::iconResource(void) const
{
34
    return QStringLiteral("/qmlimages/TuningComponentIcon.png");
Don Gagne's avatar
Don Gagne committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
}

bool APMTuningComponent::requiresSetup(void) const
{
    return false;
}

bool APMTuningComponent::setupComplete(void) const
{
    return true;
}

QStringList APMTuningComponent::setupCompleteChangedTriggerList(void) const
{
    return QStringList();
}

QUrl APMTuningComponent::setupSource(void) const
{
    QString qmlFile;

    switch (_vehicle->vehicleType()) {
        case MAV_TYPE_QUADROTOR:
        case MAV_TYPE_COAXIAL:
        case MAV_TYPE_HELICOPTER:
        case MAV_TYPE_HEXAROTOR:
        case MAV_TYPE_OCTOROTOR:
        case MAV_TYPE_TRICOPTER:
63
            qmlFile = QStringLiteral("qrc:/qml/APMTuningComponentCopter.qml");
Don Gagne's avatar
Don Gagne committed
64
            break;
65 66 67
        case MAV_TYPE_SUBMARINE:
            qmlFile = QStringLiteral("qrc:/qml/APMTuningComponentSub.qml");
            break;
Don Gagne's avatar
Don Gagne committed
68
        default:
Don Gagne's avatar
Don Gagne committed
69
            // No tuning panel
Don Gagne's avatar
Don Gagne committed
70 71 72 73 74 75 76 77 78 79
            break;
    }

    return QUrl::fromUserInput(qmlFile);
}

QUrl APMTuningComponent::summaryQmlSource(void) const
{
    return QUrl();
}