mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-26 01:35:23 +03:00
Working dropdown for minimum distance procedure.
* Needs to look tidier * Needs help annotations * needs controlling checkbox
This commit is contained in:
parent
b61d20323d
commit
2ddcd38a48
3 changed files with 47 additions and 21 deletions
9
js/fc.js
9
js/fc.js
|
@ -378,7 +378,6 @@ var FC = {
|
||||||
failsafe_throttle_low_delay: 0,
|
failsafe_throttle_low_delay: 0,
|
||||||
failsafe_procedure: 0,
|
failsafe_procedure: 0,
|
||||||
failsafe_recovery_delay: 0,
|
failsafe_recovery_delay: 0,
|
||||||
|
|
||||||
failsafe_fw_roll_angle: 0,
|
failsafe_fw_roll_angle: 0,
|
||||||
failsafe_fw_pitch_angle: 0,
|
failsafe_fw_pitch_angle: 0,
|
||||||
failsafe_fw_yaw_rate: 0,
|
failsafe_fw_yaw_rate: 0,
|
||||||
|
@ -895,5 +894,13 @@ var FC = {
|
||||||
},
|
},
|
||||||
getRthAltControlMode: function () {
|
getRthAltControlMode: function () {
|
||||||
return ["Current", "Extra", "Fixed", "Max", "At Least"];
|
return ["Current", "Extra", "Fixed", "Max", "At Least"];
|
||||||
|
},
|
||||||
|
getFailsafeProcedure: function () {
|
||||||
|
return [
|
||||||
|
"Land",
|
||||||
|
"Drop",
|
||||||
|
"RTH",
|
||||||
|
"Do Nothing",
|
||||||
|
];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -111,23 +111,19 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="radioarea pro6 stage2 requires-v1_7">
|
<div class="radioarea requires-v1_7">
|
||||||
|
|
||||||
<div class="proceduresettings">
|
<div class="number">
|
||||||
<div class="number">
|
<label> <input type="number" name="failsafe_min_distance" min="0" max="6000" /> <span
|
||||||
<label> <input type="number" name="failsafe_min_distance" min="0" max="6000" /> <span
|
data-i18n="failsafeMinDistanceItem"></span>
|
||||||
data-i18n="failsafeMinDistanceItem"></span>
|
</label>
|
||||||
</label>
|
<div class="helpicon cf_tip" data-i18n_title="failsafeMinDistanceHelp"></div>
|
||||||
<div class="helpicon cf_tip" data-i18n_title="failsafeMinDistanceHelp"></div>
|
|
||||||
</div>
|
|
||||||
<div class="number">
|
|
||||||
<label> <input type="number" name="failsafe_min_distance_procedure" min="0" max="3" /> <span
|
|
||||||
data-i18n="failsafeMinDistanceProcedureItem"></span>
|
|
||||||
</label>
|
|
||||||
<div class="helpicon cf_tip" data-i18n_title="failsafeMinDistanceProcedureHelp"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="select">
|
||||||
|
<select id="failsafe_min_distance_procedure"></select>
|
||||||
|
<label for="failsafe_min_distance_procedure"> <span data-i18n="failsafeMinDistanceProcedureItem"></span></label>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -189,7 +185,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="content_toolbar">
|
<div class="content_toolbar">
|
||||||
<div class="btn save_btn">
|
<div class="btn save_btn">
|
||||||
|
|
|
@ -75,6 +75,8 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
|
||||||
// translate to user-selected language
|
// translate to user-selected language
|
||||||
localize();
|
localize();
|
||||||
|
|
||||||
|
var $failsafeMinDistanceProcedure = $('#failsafe_min_distance_procedure');
|
||||||
|
|
||||||
// generate labels for assigned aux modes
|
// generate labels for assigned aux modes
|
||||||
var auxAssignment = [],
|
var auxAssignment = [],
|
||||||
i,
|
i,
|
||||||
|
@ -228,12 +230,11 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
|
||||||
$('input[name="failsafe_delay"]').val(FAILSAFE_CONFIG.failsafe_delay);
|
$('input[name="failsafe_delay"]').val(FAILSAFE_CONFIG.failsafe_delay);
|
||||||
|
|
||||||
// Raw basics; needs a lot of treatment to be better -- SLG
|
// Raw basics; needs a lot of treatment to be better -- SLG
|
||||||
alert('failsafe_stick_motion_threshold: ' + FAILSAFE_CONFIG.failsafe_stick_motion_threshold);
|
//alert('failsafe_stick_motion_threshold: ' + FAILSAFE_CONFIG.failsafe_stick_motion_threshold);
|
||||||
alert('failsafe_min_distance: ' + FAILSAFE_CONFIG.failsafe_min_distance);
|
//alert('failsafe_min_distance: ' + FAILSAFE_CONFIG.failsafe_min_distance);
|
||||||
|
|
||||||
$('input[name="failsafe_min_distance"]').val(FAILSAFE_CONFIG.failsafe_min_distance);
|
$('input[name="failsafe_min_distance"]').val(FAILSAFE_CONFIG.failsafe_min_distance);
|
||||||
$('input[name="failsafe_min_distance_procedure"]').val(FAILSAFE_CONFIG.failsafe_min_distance_procedure);
|
//$('input[name="failsafe_min_distance_procedure"]').val(FAILSAFE_CONFIG.failsafe_min_distance_procedure);
|
||||||
|
|
||||||
|
|
||||||
// set stage 2 failsafe procedure
|
// set stage 2 failsafe procedure
|
||||||
$('input[type="radio"].procedure').change(function () {
|
$('input[type="radio"].procedure').change(function () {
|
||||||
|
@ -284,6 +285,28 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
|
||||||
// set stage 2 kill switch option
|
// set stage 2 kill switch option
|
||||||
$('input[name="failsafe_kill_switch"]').prop('checked', FAILSAFE_CONFIG.failsafe_kill_switch);
|
$('input[name="failsafe_kill_switch"]').prop('checked', FAILSAFE_CONFIG.failsafe_kill_switch);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Alternate, minimum distance failsafe procedure
|
||||||
|
GUI.fillSelect($failsafeMinDistanceProcedure, FC.getFailsafeProcedure(), FAILSAFE_CONFIG.failsafe_min_distance_procedure);
|
||||||
|
$failsafeMinDistanceProcedure.val(FAILSAFE_CONFIG.failsafe_min_distance_procedure);
|
||||||
|
$failsafeMinDistanceProcedure.change(function () {
|
||||||
|
FAILSAFE_CONFIG.failsafe_min_distance_procedure = $failsafeMinDistanceProcedure.val();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('a.save').click(function () {
|
$('a.save').click(function () {
|
||||||
// gather data that doesn't have automatic change event bound
|
// gather data that doesn't have automatic change event bound
|
||||||
RX_CONFIG.rx_min_usec = parseInt($('input[name="rx_min_usec"]').val());
|
RX_CONFIG.rx_min_usec = parseInt($('input[name="rx_min_usec"]').val());
|
||||||
|
@ -303,7 +326,7 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
|
||||||
FAILSAFE_CONFIG.failsafe_delay = parseInt($('input[name="failsafe_delay"]').val());
|
FAILSAFE_CONFIG.failsafe_delay = parseInt($('input[name="failsafe_delay"]').val());
|
||||||
|
|
||||||
FAILSAFE_CONFIG.failsafe_min_distance = parseInt($('input[name="failsafe_min_distance"]').val());
|
FAILSAFE_CONFIG.failsafe_min_distance = parseInt($('input[name="failsafe_min_distance"]').val());
|
||||||
FAILSAFE_CONFIG.failsafe_min_distance_procedure = parseInt($('input[name="failsafe_min_distance_procedure"]').val());
|
//FAILSAFE_CONFIG.failsafe_min_distance_procedure = parseInt($('input[name="failsafe_min_distance_procedure"]').val());
|
||||||
|
|
||||||
|
|
||||||
if ($('input[id="land"]').is(':checked')) {
|
if ($('input[id="land"]').is(':checked')) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue