Merge pull request #599 from DanNixon/arming_disable_flags_setup_tab

Add arming disable flags to setup tab
10.3.x-maintenance
Martin Budden 2017-08-12 09:41:12 +01:00 committed by GitHub
commit ec847228d5
5 changed files with 31 additions and 1 deletions

View File

@ -436,6 +436,12 @@
"initialSetupRSSIValue": {
"message": "$1 %"
},
"initialSetupArmingDisableFlags": {
"message": "Arming Disable Flags:"
},
"initialSetupArmingAllowed": {
"message": "Arming Allowed"
},
"initialSetupGPSHead": {
"message": "GPS"
},

View File

@ -79,6 +79,7 @@ var FC = {
numProfiles: 3,
rateProfile: 0,
boardType: 0,
armingDisableFlags: 0,
};
BF_CONFIG = {

View File

@ -83,6 +83,18 @@ MspHelper.prototype.process_data = function(dataHandler) {
CONFIG.numProfiles = 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);
}

View File

@ -95,6 +95,10 @@
<div class="spacer_box">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cf_table">
<tbody>
<tr>
<td i18n="initialSetupArmingDisableFlags"></td>
<td class="arming-disable-flags">0</td>
</tr>
<tr>
<td i18n="initialSetupBattery"></td>
<td class="bat-voltage">0 V</td>

View File

@ -156,6 +156,7 @@ TABS.setup.initialize = function (callback) {
bat_mah_drawn_e = $('.bat-mah-drawn'),
bat_mah_drawing_e = $('.bat-mah-drawing'),
rssi_e = $('.rssi'),
arming_disable_flags_e = $('.arming-disable-flags'),
gpsFix_e = $('.gpsFix'),
gpsSats_e = $('.gpsSats'),
gpsLat_e = $('.gpsLat'),
@ -164,8 +165,14 @@ TABS.setup.initialize = function (callback) {
pitch_e = $('dd.pitch'),
heading_e = $('dd.heading');
if (semver.lt(CONFIG.apiVersion, "1.36.0")) {
arming_disable_flags_e.hide();
}
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 () {
bat_voltage_e.text(chrome.i18n.getMessage('initialSetupBatteryValue', [ANALOG.voltage]));