From 184ac1e4e7a76350ad0bbe5ef7645c5bfadd5a18 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sun, 22 Jan 2017 00:00:14 +0100 Subject: [PATCH] LP-478 Set default flightmode number to 1 and remove unneeded forceOneFlightMode() --- .../gcs/src/plugins/config/configinputwidget.cpp | 26 ++-------------------- ground/gcs/src/plugins/config/configinputwidget.h | 1 - 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/ground/gcs/src/plugins/config/configinputwidget.cpp b/ground/gcs/src/plugins/config/configinputwidget.cpp index 9df7c0906..54fa301b1 100644 --- a/ground/gcs/src/plugins/config/configinputwidget.cpp +++ b/ground/gcs/src/plugins/config/configinputwidget.cpp @@ -58,7 +58,7 @@ #define MAX_INPUT_US 2500 #define CHANNEL_NUMBER_NONE 0 -#define DEFAULT_FLIGHT_MODE_NUMBER 0 +#define DEFAULT_FLIGHT_MODE_NUMBER 1 ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent), @@ -662,12 +662,8 @@ void ConfigInputWidget::wzNext() throttleError = false; checkThrottleRange(); - // Force flight mode number to be 1 if 2 CH ground vehicle was selected - if (transmitterType == ground) { - forceOneFlightMode(); - } - manualSettingsObj->setData(manualSettingsData); + // move to Arming Settings tab ui->stackedWidget->setCurrentIndex(0); ui->tabWidget->setCurrentIndex(3); @@ -917,12 +913,6 @@ void ConfigInputWidget::wizardTearDownStep(enum wizardSteps step) disconnect(receiverActivityObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(identifyControls())); wizardUi->wzNext->setEnabled(true); setTxMovement(nothing); - /* If flight mode stick isn't identified, force flight mode number to be 1 */ - manualSettingsData = manualSettingsObj->getData(); - if (manualSettingsData.ChannelGroups[ManualControlSettings::CHANNELNUMBER_FLIGHTMODE] == - ManualControlSettings::CHANNELGROUPS_NONE) { - forceOneFlightMode(); - } break; case wizardIdentifyCenter: manualCommandData = manualCommandObj->getData(); @@ -2013,11 +2003,6 @@ void ConfigInputWidget::simpleCalibration(bool enable) restoreMdataSingle(manualCommandObj, &manualControlMdata); - // Force flight mode number to be 1 if 2 channel ground vehicle was confirmed - if (transmitterType == ground) { - forceOneFlightMode(); - } - for (unsigned int i = 0; i < ManualControlSettings::CHANNELNUMBER_RSSI; i++) { if ((i == ManualControlSettings::CHANNELNUMBER_FLIGHTMODE) || (i == ManualControlSettings::CHANNELNUMBER_THROTTLE)) { adjustSpecialNeutrals(); @@ -2148,13 +2133,6 @@ void ConfigInputWidget::resetActuatorSettings() } } -void ConfigInputWidget::forceOneFlightMode() -{ - manualSettingsData = manualSettingsObj->getData(); - manualSettingsData.FlightModeNumber = 1; - manualSettingsObj->setData(manualSettingsData); -} - void ConfigInputWidget::updateReceiverActivityStatus() { ReceiverActivity *receiverActivity = ReceiverActivity::GetInstance(getObjectManager()); diff --git a/ground/gcs/src/plugins/config/configinputwidget.h b/ground/gcs/src/plugins/config/configinputwidget.h index ddbc65c93..458744024 100644 --- a/ground/gcs/src/plugins/config/configinputwidget.h +++ b/ground/gcs/src/plugins/config/configinputwidget.h @@ -228,7 +228,6 @@ private slots: void resetChannelSettings(); void resetFlightModeSettings(); void resetActuatorSettings(); - void forceOneFlightMode(); void updateReceiverActivityStatus(); void failsafeFlightModeChanged(int index); -- 2.11.4.GIT