You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
3.3 KiB
73 lines
3.3 KiB
10 years ago
|
/*=====================================================================
|
||
|
|
||
|
QGroundControl Open Source Ground Control Station
|
||
|
|
||
|
(c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
|
||
|
|
||
|
This file is part of the QGROUNDCONTROL project
|
||
|
|
||
|
QGROUNDCONTROL is free software: you can redistribute it and/or modify
|
||
|
it under the terms of the GNU General Public License as published by
|
||
|
the Free Software Foundation, either version 3 of the License, or
|
||
|
(at your option) any later version.
|
||
|
|
||
|
QGROUNDCONTROL is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
GNU General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU General Public License
|
||
|
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
|
||
|
|
||
|
======================================================================*/
|
||
|
|
||
|
/// @file
|
||
|
/// @author Pritam Ghanghas <pritam.ghanghas@gmail.com>
|
||
|
|
||
|
#include "ArduPlaneFirmwarePlugin.h"
|
||
|
#include "Generic/GenericFirmwarePlugin.h"
|
||
|
|
||
|
IMPLEMENT_QGC_SINGLETON(ArduPlaneFirmwarePlugin, ArduPlaneFirmwarePlugin)
|
||
|
|
||
|
APMPlaneMode::APMPlaneMode(uint32_t mode, bool settable) : APMCustomMode(mode, settable)
|
||
|
{
|
||
|
QMap<uint32_t,QString> enumToString;
|
||
|
enumToString.insert(MANUAL, "Manual");
|
||
|
enumToString.insert(CIRCLE, "Circle");
|
||
|
enumToString.insert(STABILIZE, "Stabilize");
|
||
|
enumToString.insert(TRAINING, "Training");
|
||
|
enumToString.insert(ACRO, "Acro");
|
||
|
enumToString.insert(FLY_BY_WIRE_A, "FWB A");
|
||
|
enumToString.insert(FLY_BY_WIRE_B, "FWB B");
|
||
|
enumToString.insert(CRUISE, "Cruise");
|
||
|
enumToString.insert(AUTOTUNE, "Autotune");
|
||
|
enumToString.insert(AUTO, "Auto");
|
||
|
enumToString.insert(RTL, "RTL");
|
||
|
enumToString.insert(LOITER, "Loiter");
|
||
|
enumToString.insert(GUIDED, "Guided");
|
||
|
enumToString.insert(INITIALIZING, "Initializing");
|
||
|
|
||
|
setEnumToStringMapping(enumToString);
|
||
|
}
|
||
|
|
||
|
ArduPlaneFirmwarePlugin::ArduPlaneFirmwarePlugin(QObject* parent) :
|
||
|
APMFirmwarePlugin(parent)
|
||
|
{
|
||
|
QList<APMCustomMode> supportedFlightModes;
|
||
|
supportedFlightModes << APMPlaneMode(APMPlaneMode::MANUAL ,true);
|
||
|
supportedFlightModes << APMPlaneMode(APMPlaneMode::CIRCLE ,true);
|
||
|
supportedFlightModes << APMPlaneMode(APMPlaneMode::STABILIZE ,true);
|
||
|
supportedFlightModes << APMPlaneMode(APMPlaneMode::TRAINING ,true);
|
||
|
supportedFlightModes << APMPlaneMode(APMPlaneMode::ACRO ,true);
|
||
|
supportedFlightModes << APMPlaneMode(APMPlaneMode::FLY_BY_WIRE_A ,true);
|
||
|
supportedFlightModes << APMPlaneMode(APMPlaneMode::FLY_BY_WIRE_B ,true);
|
||
|
supportedFlightModes << APMPlaneMode(APMPlaneMode::CRUISE ,true);
|
||
|
supportedFlightModes << APMPlaneMode(APMPlaneMode::AUTOTUNE ,true);
|
||
|
supportedFlightModes << APMPlaneMode(APMPlaneMode::AUTO ,true);
|
||
|
supportedFlightModes << APMPlaneMode(APMPlaneMode::RTL ,true);
|
||
|
supportedFlightModes << APMPlaneMode(APMPlaneMode::LOITER ,true);
|
||
|
supportedFlightModes << APMPlaneMode(APMPlaneMode::GUIDED ,true);
|
||
|
supportedFlightModes << APMPlaneMode(APMPlaneMode::INITIALIZING ,false);
|
||
|
setSupportedModes(supportedFlightModes);
|
||
|
}
|