Skip to content

Commit fb0605d

Browse files
committed
Add support for the new value FS_ONLY in nav_rth_allow_landing
1 parent ada14ed commit fb0605d

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

js/fc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,13 @@ var FC = {
887887
getRthAltControlMode: function () {
888888
return ["Current", "Extra", "Fixed", "Max", "At Least"];
889889
},
890+
getRthAllowLanding: function() {
891+
var values = ["Never", "Always"];
892+
if (semver.gt(CONFIG.flightControllerVersion, '1.7.3')) {
893+
values.push("Only on failsafe");
894+
}
895+
return values;
896+
},
890897
getFailsafeProcedure: function () {
891898
return {
892899
0: "Land",

tabs/advanced_tuning.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@
9797
</label>
9898
</div>
9999

100-
<div class="checkbox">
101-
<input type="checkbox" id="rthAllowLanding" class="toggle" />
100+
<div class="select">
101+
<select id="rthAllowLanding"></select>
102102
<label for="rthAllowLanding">
103103
<span data-i18n="rthAllowLanding"></span>
104104
</label>

tabs/advanced_tuning.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,17 @@ TABS.advanced_tuning.initialize = function (callback) {
9191
});
9292
$rthTailFirst.change();
9393

94-
$rthAllowLanding.prop("checked", RTH_AND_LAND_CONFIG.rthAllowLanding);
95-
$rthAllowLanding.change(function () {
96-
if ($(this).is(":checked")) {
97-
RTH_AND_LAND_CONFIG.rthAllowLanding = 1;
98-
} else {
99-
RTH_AND_LAND_CONFIG.rthAllowLanding = 0;
100-
}
101-
});
102-
$rthAllowLanding.change();
103-
10494
GUI.fillSelect($rthAltControlMode, FC.getRthAltControlMode(), RTH_AND_LAND_CONFIG.rthAltControlMode);
10595
$rthAltControlMode.val(RTH_AND_LAND_CONFIG.rthAltControlMode);
10696
$rthAltControlMode.change(function () {
10797
RTH_AND_LAND_CONFIG.rthAltControlMode = $rthAltControlMode.val();
10898
});
99+
GUI.fillSelect($rthAllowLanding, FC.getRthAllowLanding(), RTH_AND_LAND_CONFIG.rthAllowLanding);
100+
console.log("VAL", RTH_AND_LAND_CONFIG.rthAllowLanding);
101+
$rthAllowLanding.val(RTH_AND_LAND_CONFIG.rthAllowLanding);
102+
$rthAllowLanding.change(function () {
103+
RTH_AND_LAND_CONFIG.rthAllowLanding = $rthAllowLanding.val();
104+
});
109105

110106
$('.requires-v1_7_1').show();
111107
} else {

0 commit comments

Comments
 (0)