From a9cd4fb190f5e42f3002034b7e900a2324819a05 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Sat, 26 May 2018 11:30:39 -0700 Subject: [PATCH] ArduCopter 3.6 tuning page fixes --- .../APM/APMTuningComponentCopter.qml | 56 ++++++++++++++++--- .../APMParameterFactMetaData.Copter.3.6.xml | 20 +++---- .../APM/ArduCopterFirmwarePlugin.cc | 10 ++-- 3 files changed, 64 insertions(+), 22 deletions(-) diff --git a/src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml b/src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml index 64faea8ac..f11ee8560 100644 --- a/src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml +++ b/src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml @@ -39,13 +39,16 @@ SetupPage { property real _hoverTuneMax: _throttleMidExists ? 800 : 1 property real _hoverTuneStep: _throttleMidExists ? 10 : 0.01 - property Fact _rcFeel: controller.getParameterFact(-1, "RC_FEEL_RP") - property Fact _rateRollP: controller.getParameterFact(-1, "r.ATC_RAT_RLL_P") - property Fact _rateRollI: controller.getParameterFact(-1, "r.ATC_RAT_RLL_I") - property Fact _ratePitchP: controller.getParameterFact(-1, "r.ATC_RAT_PIT_P") - property Fact _ratePitchI: controller.getParameterFact(-1, "r.ATC_RAT_PIT_I") - property Fact _rateClimbP: controller.getParameterFact(-1, "ACCEL_Z_P") - property Fact _rateClimbI: controller.getParameterFact(-1, "ACCEL_Z_I") + property bool _rcFeelAvailable: controller.parameterExists(-1, "RC_FEEL") + property bool _atcInputTCAvailable: controller.parameterExists(-1, "ATC_INPUT_TC") + property Fact _rcFeel: controller.getParameterFact(-1, "RC_FEEL", false) + property Fact _atcInputTC: controller.getParameterFact(-1, "ATC_INPUT_TC", false) + property Fact _rateRollP: controller.getParameterFact(-1, "r.ATC_RAT_RLL_P") + property Fact _rateRollI: controller.getParameterFact(-1, "r.ATC_RAT_RLL_I") + property Fact _ratePitchP: controller.getParameterFact(-1, "r.ATC_RAT_PIT_P") + property Fact _ratePitchI: controller.getParameterFact(-1, "r.ATC_RAT_PIT_I") + property Fact _rateClimbP: controller.getParameterFact(-1, "r.PSC_ACCZ_P") + property Fact _rateClimbI: controller.getParameterFact(-1, "r.PSC_ACCZ_I") property Fact _ch7Opt: controller.getParameterFact(-1, "CH7_OPT") property Fact _ch8Opt: controller.getParameterFact(-1, "CH8_OPT") @@ -78,7 +81,12 @@ SetupPage { throttleHover.value = _hoverTuneParam.value rollPitch.value = _rateRollP.value climb.value = _rateClimbP.value - rcFeel.value = _rcFeel.value + if (_rcFeelAvailable) { + rcFeel.value = _rcFeel.value + } + if (_atcInputTCAvailable) { + atcInputTC.value = _atcInputTC.value + } _loadComplete = true calcAutoTuneChannel() @@ -240,6 +248,7 @@ SetupPage { Column { anchors.left: parent.left anchors.right: parent.right + visible: _rcFeelAvailable QGCLabel { text: qsTr("RC Roll/Pitch Feel") @@ -266,6 +275,37 @@ SetupPage { } } } + + Column { + anchors.left: parent.left + anchors.right: parent.right + visible: _atcInputTCAvailable + + QGCLabel { + text: qsTr("RC Roll/Pitch Feel") + font.family: ScreenTools.demiboldFontFamily + } + + QGCLabel { + text: qsTr("Slide to the left for soft control, slide to the right for crisp control") + } + + Slider { + id: atcInputTC + anchors.left: parent.left + anchors.right: parent.right + minimumValue: _atcInputTC.min + maximumValue: _atcInputTC.max + stepSize: _atcInputTC.increment + tickmarksEnabled: true + + onValueChanged: { + if (_loadComplete) { + _atcInputTC.value = value + } + } + } + } } } // Rectangle - Basic tuning diff --git a/src/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.6.xml b/src/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.6.xml index 1d6ffda00..c1a96770e 100644 --- a/src/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.6.xml +++ b/src/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.6.xml @@ -1684,7 +1684,7 @@ 50 -mA.h +mAh milliampere hour @@ -1713,7 +1713,7 @@ 50 -mA.h +mAh milliampere hour @@ -1723,12 +1723,12 @@ 50 -mA.h +mAh milliampere hour -Nothing +None Land RTL SmartRTL @@ -1738,7 +1738,7 @@ -Nothing +None Land RTL SmartRTL @@ -1791,7 +1791,7 @@ 50 -mA.h +mAh milliampere hour @@ -1820,7 +1820,7 @@ 50 -mA.h +mAh milliampere hour @@ -1830,12 +1830,12 @@ 50 -mA.h +mAh milliampere hour -Nothing +None Land RTL SmartRTL @@ -1845,7 +1845,7 @@ -Nothing +None Land RTL SmartRTL diff --git a/src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.cc b/src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.cc index 68a86e559..9a20e4400 100644 --- a/src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.cc +++ b/src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.cc @@ -150,11 +150,13 @@ ArduCopterFirmwarePlugin::ArduCopterFirmwarePlugin(void) FirmwarePlugin::remapParamNameMap_t& remapV3_6 = _remapParamName[3][6]; - remapV3_6["BATT_AMP_PERVLT"] = QStringLiteral("BATT_AMP_PERVOL"); + remapV3_6["BATT_AMP_PERVLT"] = QStringLiteral("BATT_AMP_PERVOL"); remapV3_6["BATT2_AMP_PERVLT"] = QStringLiteral("BATT2_AMP_PERVOL"); - remapV3_6["BATT_LOW_MAH"] = QStringLiteral("FS_BATT_MAH"); - remapV3_6["BATT_LOW_VOLT"] = QStringLiteral("FS_BATT_VOLTAGE"); - remapV3_6["BATT_FS_LOW_ACT"] = QStringLiteral("FS_BATT_ENABLE"); + remapV3_6["BATT_LOW_MAH"] = QStringLiteral("FS_BATT_MAH"); + remapV3_6["BATT_LOW_VOLT"] = QStringLiteral("FS_BATT_VOLTAGE"); + remapV3_6["BATT_FS_LOW_ACT"] = QStringLiteral("FS_BATT_ENABLE"); + remapV3_6["PSC_ACCZ_P"] = QStringLiteral("ACCEL_Z_P"); + remapV3_6["PSC_ACCZ_I"] = QStringLiteral("ACCEL_Z_I"); _remapParamNameIntialized = true; } -- 2.22.0