mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-17 13:25:24 +03:00
Add arming disable flags to setup tab
This commit is contained in:
parent
9622988631
commit
be70860172
5 changed files with 31 additions and 1 deletions
|
@ -436,6 +436,12 @@
|
||||||
"initialSetupRSSIValue": {
|
"initialSetupRSSIValue": {
|
||||||
"message": "$1 %"
|
"message": "$1 %"
|
||||||
},
|
},
|
||||||
|
"initialSetupArmingDisableFlags": {
|
||||||
|
"message": "Arming Disable Flags:"
|
||||||
|
},
|
||||||
|
"initialSetupArmingAllowed": {
|
||||||
|
"message": "Arming Allowed"
|
||||||
|
},
|
||||||
"initialSetupGPSHead": {
|
"initialSetupGPSHead": {
|
||||||
"message": "GPS"
|
"message": "GPS"
|
||||||
},
|
},
|
||||||
|
|
1
js/fc.js
1
js/fc.js
|
@ -78,6 +78,7 @@ var FC = {
|
||||||
numProfiles: 3,
|
numProfiles: 3,
|
||||||
rateProfile: 0,
|
rateProfile: 0,
|
||||||
boardType: 0,
|
boardType: 0,
|
||||||
|
armingDisableFlags: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
BF_CONFIG = {
|
BF_CONFIG = {
|
||||||
|
|
|
@ -83,6 +83,18 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
||||||
CONFIG.numProfiles = data.readU8();
|
CONFIG.numProfiles = data.readU8();
|
||||||
CONFIG.rateProfile = data.readU8();
|
CONFIG.rateProfile = data.readU8();
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
|
||||||
|
// Read flight mode flags
|
||||||
|
var byteCount = data.readU8();
|
||||||
|
for (var i = 0; i < byteCount; i++) {
|
||||||
|
data.readU8();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read arming disable flags
|
||||||
|
data.readU8(); // Flag count
|
||||||
|
CONFIG.armingDisableFlags = data.readU32();
|
||||||
|
}
|
||||||
|
|
||||||
TABS.pid_tuning.checkUpdateProfile(true);
|
TABS.pid_tuning.checkUpdateProfile(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,10 @@
|
||||||
<div class="spacer_box">
|
<div class="spacer_box">
|
||||||
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cf_table">
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cf_table">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td i18n="initialSetupArmingDisableFlags"></td>
|
||||||
|
<td class="arming-disable-flags">0</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="initialSetupBattery"></td>
|
<td i18n="initialSetupBattery"></td>
|
||||||
<td class="bat-voltage">0 V</td>
|
<td class="bat-voltage">0 V</td>
|
||||||
|
|
|
@ -156,6 +156,7 @@ TABS.setup.initialize = function (callback) {
|
||||||
bat_mah_drawn_e = $('.bat-mah-drawn'),
|
bat_mah_drawn_e = $('.bat-mah-drawn'),
|
||||||
bat_mah_drawing_e = $('.bat-mah-drawing'),
|
bat_mah_drawing_e = $('.bat-mah-drawing'),
|
||||||
rssi_e = $('.rssi'),
|
rssi_e = $('.rssi'),
|
||||||
|
arming_disable_flags_e = $('.arming-disable-flags'),
|
||||||
gpsFix_e = $('.gpsFix'),
|
gpsFix_e = $('.gpsFix'),
|
||||||
gpsSats_e = $('.gpsSats'),
|
gpsSats_e = $('.gpsSats'),
|
||||||
gpsLat_e = $('.gpsLat'),
|
gpsLat_e = $('.gpsLat'),
|
||||||
|
@ -164,8 +165,14 @@ TABS.setup.initialize = function (callback) {
|
||||||
pitch_e = $('dd.pitch'),
|
pitch_e = $('dd.pitch'),
|
||||||
heading_e = $('dd.heading');
|
heading_e = $('dd.heading');
|
||||||
|
|
||||||
|
if (semver.lt(CONFIG.apiVersion, "1.36.0")) {
|
||||||
|
arming_disable_flags_e.hide();
|
||||||
|
}
|
||||||
|
|
||||||
function get_slow_data() {
|
function get_slow_data() {
|
||||||
MSP.send_message(MSPCodes.MSP_STATUS);
|
MSP.send_message(MSPCodes.MSP_STATUS, false, false, function() {
|
||||||
|
arming_disable_flags_e.text(CONFIG.armingDisableFlags == 0 ? chrome.i18n.getMessage('initialSetupArmingAllowed') : CONFIG.armingDisableFlags.toString(2));
|
||||||
|
});
|
||||||
|
|
||||||
MSP.send_message(MSPCodes.MSP_ANALOG, false, false, function () {
|
MSP.send_message(MSPCodes.MSP_ANALOG, false, false, function () {
|
||||||
bat_voltage_e.text(chrome.i18n.getMessage('initialSetupBatteryValue', [ANALOG.voltage]));
|
bat_voltage_e.text(chrome.i18n.getMessage('initialSetupBatteryValue', [ANALOG.voltage]));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue