From 1811b5f1fd39b9118c114c9c0110514bc1e89814 Mon Sep 17 00:00:00 2001 From: samguns Date: Fri, 20 Mar 2015 16:23:26 +0800 Subject: [PATCH] OP-1781 Make sure the vehicle type is correct, next step will be acro, heli tests and minor modifications. --- .../src/plugins/config/configinputwidget.cpp | 15 +++++++++++---- .../src/plugins/config/configinputwidget.h | 4 ++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index f34a95e46..64ce1b056 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -72,6 +72,7 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : accessoryDesiredObj1 = AccessoryDesired::GetInstance(getObjectManager(), 1); accessoryDesiredObj2 = AccessoryDesired::GetInstance(getObjectManager(), 2); actuatorSettingsObj = ActuatorSettings::GetInstance(getObjectManager()); + systemSettingsObj = SystemSettings::GetInstance(getObjectManager()); // Only instance 0 is present if the board is not connected. // The other instances are populated lazily. @@ -351,9 +352,7 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : groundChannelOrder << ManualControlSettings::CHANNELGROUPS_THROTTLE << ManualControlSettings::CHANNELGROUPS_YAW << - ManualControlSettings::CHANNELGROUPS_ACCESSORY0 << - ManualControlSettings::CHANNELGROUPS_ACCESSORY1 << - ManualControlSettings::CHANNELGROUPS_ACCESSORY2; + ManualControlSettings::CHANNELGROUPS_ACCESSORY0; updateEnableControls(); } @@ -770,7 +769,11 @@ void ConfigInputWidget::wizardTearDownStep(enum wizardSteps step) if (wizardUi->typeAcro->isChecked()) { transmitterType = acro; } else if (wizardUi->typeGround->isChecked()) { - transmitterType = ground; + transmitterType = ground; + /* Make sure to tell controller, this is really a ground vehicle. */ + systemSettingsData = systemSettingsObj->getData(); + systemSettingsData.AirframeType = SystemSettings::AIRFRAMETYPE_GROUNDVEHICLECAR; + systemSettingsObj->setData(systemSettingsData); } else { transmitterType = heli; } @@ -1688,6 +1691,10 @@ void ConfigInputWidget::simpleCalibration(bool enable) transmitterType = ground; manualSettingsData.ChannelNeutral[ManualControlSettings::CHANNELNEUTRAL_THROTTLE] = manualCommandData.Channel[ManualControlSettings::CHANNELNUMBER_THROTTLE]; + /* Make sure to tell controller, this is really a ground vehicle. */ + systemSettingsData = systemSettingsObj->getData(); + systemSettingsData.AirframeType = SystemSettings::AIRFRAMETYPE_GROUNDVEHICLECAR; + systemSettingsObj->setData(systemSettingsData); } restoreMdataSingle(manualCommandObj, &manualControlMdata); diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.h b/ground/openpilotgcs/src/plugins/config/configinputwidget.h index 756e56c78..013a60c62 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.h @@ -50,6 +50,7 @@ #include "flightstatus.h" #include "accessorydesired.h" #include +#include "systemsettings.h" class Ui_InputWidget; @@ -139,6 +140,9 @@ private: ReceiverActivity *receiverActivityObj; ReceiverActivity::DataFields receiverActivityData; + SystemSettings *systemSettingsObj; + SystemSettings::DataFields systemSettingsData; + QSvgRenderer *m_renderer; // Background: background