Merge pull request #687 from DanNixon/clarify_arming_disable_string

Clarify arming disable readout in setup tab
10.3.x-maintenance
Michael Keller 2017-10-15 11:52:38 +13:00 committed by GitHub
commit 055d701bdd
3 changed files with 20 additions and 2 deletions

View File

@ -457,6 +457,9 @@
"initialSetupArmingAllowed": {
"message": "Arming Allowed"
},
"initialSetupArmingDisableFlagsTooltip": {
"message": "List of flags indicating why arming is currently not allowed. Please refer to the Wiki for a description of what these flags mean."
},
"initialSetupGPSHead": {
"message": "GPS"
},

View File

@ -95,7 +95,7 @@
<div class="spacer_box">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cf_table">
<tbody>
<tr>
<tr id="arming-disable-flag-row" class="cf_tip">
<td i18n="initialSetupArmingDisableFlags"></td>
<td class="arming-disable-flags">0</td>
</tr>

View File

@ -59,6 +59,9 @@ TABS.setup.initialize = function (callback) {
self.initializeInstruments();
$('#arming-disable-flag-row').attr('title', chrome.i18n.getMessage('initialSetupArmingDisableFlagsTooltip'));
// UI Hooks
$('a.calibrateAccel').click(function () {
var self = $(this);
@ -182,7 +185,19 @@ TABS.setup.initialize = function (callback) {
function get_slow_data() {
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));
var armingString = '';
if (CONFIG.armingDisableFlags == 0) {
armingString = chrome.i18n.getMessage('initialSetupArmingAllowed');
} else {
var flagIndicies = [];
for (var i = 0; i < 32; i++) {
if (CONFIG.armingDisableFlags & (1 << i)) {
flagIndicies.push(i);
}
}
armingString = flagIndicies;
}
arming_disable_flags_e.text(armingString);
});
MSP.send_message(MSPCodes.MSP_ANALOG, false, false, function () {