Commit a19f5cfb authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #3628 from DonLakeFlyer/HoverTuner

Support both THR_MID and MOT_THST_HOVER
parents 57d0abc7 d304cb11
...@@ -26,14 +26,20 @@ QGCView { ...@@ -26,14 +26,20 @@ QGCView {
QGCPalette { id: palette; colorGroupEnabled: enabled } QGCPalette { id: palette; colorGroupEnabled: enabled }
property Fact _throttleMid: controller.getParameterFact(-1, "THR_MID") // Older firmwares use THR_MODE, newer use MOT_THST_HOVER
property Fact _rcFeel: controller.getParameterFact(-1, "RC_FEEL_RP") property bool _throttleMidExists: controller.parameterExists(-1, "THR_MID")
property Fact _rateRollP: controller.getParameterFact(-1, "r.ATC_RAT_RLL_P") property Fact _hoverTuneParam: controller.getParameterFact(-1, _throttleMidExists ? "THR_MID" : "MOT_THST_HOVER")
property Fact _rateRollI: controller.getParameterFact(-1, "r.ATC_RAT_RLL_I") property real _hoverTuneMin: _throttleMidExists ? 200 : 0
property Fact _ratePitchP: controller.getParameterFact(-1, "r.ATC_RAT_PIT_P") property real _hoverTuneMax: _throttleMidExists ? 800 : 1
property Fact _ratePitchI: controller.getParameterFact(-1, "r.ATC_RAT_PIT_I") property real _hoverTuneStep: _throttleMidExists ? 10 : 0.01
property Fact _rateClimbP: controller.getParameterFact(-1, "ACCEL_Z_P")
property Fact _rateClimbI: controller.getParameterFact(-1, "ACCEL_Z_I") 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 Fact _ch7Opt: controller.getParameterFact(-1, "CH7_OPT") property Fact _ch7Opt: controller.getParameterFact(-1, "CH7_OPT")
property Fact _ch8Opt: controller.getParameterFact(-1, "CH8_OPT") property Fact _ch8Opt: controller.getParameterFact(-1, "CH8_OPT")
...@@ -63,7 +69,7 @@ QGCView { ...@@ -63,7 +69,7 @@ QGCView {
// handler which updates your property with the new value, this first value change will trash // handler which updates your property with the new value, this first value change will trash
// your bound values. In order to work around this we don't set the values into the Sliders until // your bound values. In order to work around this we don't set the values into the Sliders until
// after Qml load is done. We also don't track value changes until Qml load completes. // after Qml load is done. We also don't track value changes until Qml load completes.
throttleHover.value = _throttleMid.value throttleHover.value = _hoverTuneParam.value
rollPitch.value = _rateRollP.value rollPitch.value = _rateRollP.value
climb.value = _rateClimbP.value climb.value = _rateClimbP.value
rcFeel.value = _rcFeel.value rcFeel.value = _rcFeel.value
...@@ -159,14 +165,14 @@ QGCView { ...@@ -159,14 +165,14 @@ QGCView {
id: throttleHover id: throttleHover
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
minimumValue: 200 minimumValue: _hoverTuneMin
maximumValue: 800 maximumValue: _hoverTuneMax
stepSize: 10.0 stepSize: _hoverTuneStep
tickmarksEnabled: true tickmarksEnabled: true
onValueChanged: { onValueChanged: {
if (_loadComplete) { if (_loadComplete) {
_throttleMid.value = value _hoverTuneParam.value = value
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment