mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-15 12:25:13 +03:00
Arming status reporting
This commit is contained in:
parent
9db2fec934
commit
a5bc3e56ab
6 changed files with 145 additions and 25 deletions
|
@ -1864,5 +1864,29 @@
|
||||||
},
|
},
|
||||||
"manualEnablingTemplate": {
|
"manualEnablingTemplate": {
|
||||||
"message": "To enable via CLI use <strong>feature {name}</strong> command"
|
"message": "To enable via CLI use <strong>feature {name}</strong> command"
|
||||||
|
},
|
||||||
|
"armingFailureReasonTitle": {
|
||||||
|
"message": "Arming status"
|
||||||
|
},
|
||||||
|
"BLOCKED_UAV_NOT_LEVEL": {
|
||||||
|
"message": "UAV level"
|
||||||
|
},
|
||||||
|
"BLOCKED_SENSORS_CALIBRATING": {
|
||||||
|
"message": "Boot calibration"
|
||||||
|
},
|
||||||
|
"BLOCKED_SYSTEM_OVERLOADED": {
|
||||||
|
"message": "CPU load"
|
||||||
|
},
|
||||||
|
"BLOCKED_NAVIGATION_SAFETY": {
|
||||||
|
"message": "Navigation safety"
|
||||||
|
},
|
||||||
|
"BLOCKED_COMPASS_NOT_CALIBRATED": {
|
||||||
|
"message": "Compass calibrated"
|
||||||
|
},
|
||||||
|
"BLOCKED_ACCELEROMETER_NOT_CALIBRATED": {
|
||||||
|
"message": "Accelerometer calibrated"
|
||||||
|
},
|
||||||
|
"BLOCKED_HARDWARE_FAILURE": {
|
||||||
|
"message": "Hardware healthy"
|
||||||
}
|
}
|
||||||
}
|
}
|
43
js/fc.js
43
js/fc.js
|
@ -85,7 +85,8 @@ var FC = {
|
||||||
mode: 0,
|
mode: 0,
|
||||||
profile: 0,
|
profile: 0,
|
||||||
uid: [0, 0, 0],
|
uid: [0, 0, 0],
|
||||||
accelerometerTrims: [0, 0]
|
accelerometerTrims: [0, 0],
|
||||||
|
armingFlags: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
BF_CONFIG = {
|
BF_CONFIG = {
|
||||||
|
@ -648,5 +649,45 @@ var FC = {
|
||||||
},
|
},
|
||||||
getRangefinderNames: function () {
|
getRangefinderNames: function () {
|
||||||
return ["NONE", "AUTO", "HCSR04", "SRF10"];
|
return ["NONE", "AUTO", "HCSR04", "SRF10"];
|
||||||
|
},
|
||||||
|
getArmingFlags: function () {
|
||||||
|
return {
|
||||||
|
0: "OK_TO_ARM",
|
||||||
|
1: "PREVENT_ARMING",
|
||||||
|
2: "ARMED",
|
||||||
|
3: "WAS_EVER_ARMED",
|
||||||
|
8: "BLOCKED_UAV_NOT_LEVEL",
|
||||||
|
9: "BLOCKED_SENSORS_CALIBRATING",
|
||||||
|
10: "BLOCKED_SYSTEM_OVERLOADED",
|
||||||
|
11: "BLOCKED_NAVIGATION_SAFETY",
|
||||||
|
12: "BLOCKED_COMPASS_NOT_CALIBRATED",
|
||||||
|
13: "BLOCKED_ACCELEROMETER_NOT_CALIBRATED",
|
||||||
|
14: null,
|
||||||
|
15: "BLOCKED_HARDWARE_FAILURE"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getArmingBlockingFlags: function() {
|
||||||
|
var allFlags = this.getArmingFlags(),
|
||||||
|
retVal = {};
|
||||||
|
|
||||||
|
for (var i in allFlags) {
|
||||||
|
if (allFlags.hasOwnProperty(i) && parseInt(i, 10) >= 8 && allFlags[i] !== null) {
|
||||||
|
retVal[i] = allFlags[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retVal;
|
||||||
|
},
|
||||||
|
processArmingFlags: function (flag) {
|
||||||
|
var retVal = [],
|
||||||
|
flagNames = this.getArmingFlags();
|
||||||
|
|
||||||
|
for (var bit in flagNames) {
|
||||||
|
if (flagNames.hasOwnProperty(bit) && bit_check(flag, bit)) {
|
||||||
|
retVal.push(flagNames[bit]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retVal;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -58,7 +58,7 @@ var mspHelper = (function (gui) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Update sensor status only for older firmwares
|
* Update sensor status only for older firmwares
|
||||||
* Newer firmwares use MSP_STATUS_EX instead
|
* Newer firmwares use MSP_SENSOR_STATUS instead
|
||||||
*/
|
*/
|
||||||
if (semver.lt(CONFIG.flightControllerVersion, "1.5.0")) {
|
if (semver.lt(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
sensor_status(CONFIG.activeSensors);
|
sensor_status(CONFIG.activeSensors);
|
||||||
|
@ -73,6 +73,10 @@ var mspHelper = (function (gui) {
|
||||||
CONFIG.profile = data.getUint8(10);
|
CONFIG.profile = data.getUint8(10);
|
||||||
CONFIG.cpuload = data.getUint16(11, 1);
|
CONFIG.cpuload = data.getUint16(11, 1);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
|
CONFIG.armingFlags = data.getUint16(13, 2);
|
||||||
|
}
|
||||||
|
|
||||||
if (semver.lt(CONFIG.flightControllerVersion, "1.5.0")) {
|
if (semver.lt(CONFIG.flightControllerVersion, "1.5.0")) {
|
||||||
sensor_status(CONFIG.activeSensors);
|
sensor_status(CONFIG.activeSensors);
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,3 +250,14 @@
|
||||||
transition: all ease 0.2s;
|
transition: all ease 0.2s;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.armin-status-element {
|
||||||
|
margin: 4px 0;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #37a8db;
|
||||||
|
font-size: 1.1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.armin-status-failed {
|
||||||
|
color: red;
|
||||||
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="content_wrapper initialstyle">
|
<div class="content_wrapper initialstyle">
|
||||||
<!-- should be the first DIV on each tab -->
|
<!-- should be the first DIV on each tab -->
|
||||||
<div class="cf_column full spacerbottom">
|
<div class="cf_column full spacerbottom">
|
||||||
<div class="tab_title" i18n="tabSetup">Setup</div>
|
<div class="tab_title" data-i18n="tabSetup">Setup</div>
|
||||||
<div class="cf_doc_version_bt">
|
<div class="cf_doc_version_bt">
|
||||||
<a id="button-documentation" href="" target="_blank"></a>
|
<a id="button-documentation" href="" target="_blank"></a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
<div class="default_btn">
|
<div class="default_btn">
|
||||||
<div id="accel_calib_rest">
|
<div id="accel_calib_rest">
|
||||||
<a class="calibrateAccel" id="default_btn green" href="#"
|
<a class="calibrateAccel" id="default_btn green" href="#"
|
||||||
i18n="initialSetupButtonCalibrateAccel"></a>
|
data-i18n="initialSetupButtonCalibrateAccel"></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="accel_calib_running">
|
<div id="accel_calib_running">
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="default_btn">
|
<div class="default_btn">
|
||||||
<div id="mag_calib_rest">
|
<div id="mag_calib_rest">
|
||||||
<a class="calibrateMag" href="#" i18n="initialSetupButtonCalibrateMag"></a>
|
<a class="calibrateMag" href="#" data-i18n="initialSetupButtonCalibrateMag"></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="mag_calib_running">
|
<div id="mag_calib_running">
|
||||||
|
@ -32,34 +32,34 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="default_btn">
|
<div class="default_btn">
|
||||||
<a class="resetSettings" href="#" i18n="initialSetupButtonReset"></a>
|
<a class="resetSettings" href="#" data-i18n="initialSetupButtonReset"></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="half">
|
<div class="half">
|
||||||
<div class="spacer_right halfbuttons">
|
<div class="spacer_right halfbuttons">
|
||||||
<div class="default_btn half">
|
<div class="default_btn half">
|
||||||
<a class="backup" href="#" i18n="initialSetupButtonBackup"></a>
|
<a class="backup" href="#" data-i18n="initialSetupButtonBackup"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="half">
|
<div class="half">
|
||||||
<div class="default_btn half">
|
<div class="default_btn half">
|
||||||
<a class="restore" href="#" i18n="initialSetupButtonRestore"></a>
|
<a class="restore" href="#" data-i18n="initialSetupButtonRestore"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="threefourth_right setupinfo">
|
<div class="threefourth_right setupinfo">
|
||||||
<div class="cell_setup">
|
<div class="cell_setup">
|
||||||
<span i18n="initialSetupCalibrateAccelText"></span>
|
<span data-i18n="initialSetupCalibrateAccelText"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="cell_setup">
|
<div class="cell_setup">
|
||||||
<span i18n="initialSetupCalibrateMagText"></span>
|
<span data-i18n="initialSetupCalibrateMagText"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="cell_setup">
|
<div class="cell_setup">
|
||||||
<span i18n="initialSetupResetText"></span>
|
<span data-i18n="initialSetupResetText"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="cell_setup">
|
<div class="cell_setup">
|
||||||
<span i18n="initialSetupBackupRestoreText"></span>
|
<span data-i18n="initialSetupBackupRestoreText"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -81,34 +81,46 @@
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a class="reset" href="#" i18n="initialSetupButtonResetZaxis"></a>
|
<a class="reset" href="#" data-i18n="initialSetupButtonResetZaxis"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cf_column fourth">
|
<div class="cf_column fourth">
|
||||||
<div class="spacer_left">
|
<div class="spacer_left">
|
||||||
|
|
||||||
<div class="gui_box grey">
|
<div class="gui_box grey">
|
||||||
<div class="gui_box_titlebar">
|
<div class="gui_box_titlebar">
|
||||||
<div class="spacer_box_title" i18n="initialSetupInfoHead"></div>
|
<div class="spacer_box_title" data-i18n="armingFailureReasonTitle"></div>
|
||||||
|
</div>
|
||||||
|
<div class="spacer_box">
|
||||||
|
<ul id="armingFailuresList">
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="gui_box grey">
|
||||||
|
<div class="gui_box_titlebar">
|
||||||
|
<div class="spacer_box_title" data-i18n="initialSetupInfoHead"></div>
|
||||||
</div>
|
</div>
|
||||||
<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>
|
<tr>
|
||||||
<td i18n="initialSetupBattery"></td>
|
<td data-i18n="initialSetupBattery"></td>
|
||||||
<td class="bat-voltage">0 V</td>
|
<td class="bat-voltage">0 V</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="initialSetupDrawn"></td>
|
<td data-i18n="initialSetupDrawn"></td>
|
||||||
<td class="bat-mah-drawn">0 mAh</td>
|
<td class="bat-mah-drawn">0 mAh</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="initialSetupDrawing"></td>
|
<td data-i18n="initialSetupDrawing"></td>
|
||||||
<td class="bat-mah-drawing">0.00 A</td>
|
<td class="bat-mah-drawing">0.00 A</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="noboarder">
|
<tr class="noboarder">
|
||||||
<td i18n="initialSetupRSSI"></td>
|
<td data-i18n="initialSetupRSSI"></td>
|
||||||
<td class="rssi">0 %</td>
|
<td class="rssi">0 %</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -119,25 +131,25 @@
|
||||||
<div class="spacer_left">
|
<div class="spacer_left">
|
||||||
<div class="gui_box grey">
|
<div class="gui_box grey">
|
||||||
<div class="gui_box_titlebar">
|
<div class="gui_box_titlebar">
|
||||||
<div class="spacer_box_title" i18n="initialSetupGPSHead"></div>
|
<div class="spacer_box_title" data-i18n="initialSetupGPSHead"></div>
|
||||||
</div>
|
</div>
|
||||||
<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>
|
<tr>
|
||||||
<td i18n="gpsFix"></td>
|
<td data-i18n="gpsFix"></td>
|
||||||
<td class="gpsFixType"></td>
|
<td class="gpsFixType"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="gpsSats"></td>
|
<td data-i18n="gpsSats"></td>
|
||||||
<td class="gpsSats"></td>
|
<td class="gpsSats"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td i18n="gpsLat"></td>
|
<td data-i18n="gpsLat"></td>
|
||||||
<td class="gpsLat"></td>
|
<td class="gpsLat"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="noboarder">
|
<tr class="noboarder">
|
||||||
<td i18n="gpsLon"></td>
|
<td data-i18n="gpsLon"></td>
|
||||||
<td class="gpsLon"></td>
|
<td class="gpsLon"></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -148,7 +160,7 @@
|
||||||
<div class="spacer_left">
|
<div class="spacer_left">
|
||||||
<div class="gui_box grey instrumentsbox" align="center">
|
<div class="gui_box grey instrumentsbox" align="center">
|
||||||
<div class="gui_box_titlebar" align="left">
|
<div class="gui_box_titlebar" align="left">
|
||||||
<div class="spacer_box_title" i18n="initialSetupInstrumentsHead"></div>
|
<div class="spacer_box_title" data-i18n="initialSetupInstrumentsHead"></div>
|
||||||
</div>
|
</div>
|
||||||
<span id="attitude"></span> <span id="heading"></span>
|
<span id="attitude"></span> <span id="heading"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -211,6 +211,34 @@ TABS.setup.initialize = function (callback) {
|
||||||
GUI.interval_add('setup_data_pull_fast', get_fast_data, 33, true); // 30 fps
|
GUI.interval_add('setup_data_pull_fast', get_fast_data, 33, true); // 30 fps
|
||||||
GUI.interval_add('setup_data_pull_slow', get_slow_data, 250, true); // 4 fps
|
GUI.interval_add('setup_data_pull_slow', get_slow_data, 250, true); // 4 fps
|
||||||
|
|
||||||
|
var $armingFailuresList = $('#armingFailuresList');
|
||||||
|
|
||||||
|
var reasons = FC.getArmingBlockingFlags();
|
||||||
|
|
||||||
|
for (var i in reasons) {
|
||||||
|
if (reasons.hasOwnProperty(i)) {
|
||||||
|
$armingFailuresList.append("<li id='reason-" + reasons[i] + "' class='armin-status-element'>" + chrome.i18n.getMessage(reasons[i]) + "</li>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateArminFailure() {
|
||||||
|
var armingReasons = FC.processArmingFlags(CONFIG.armingFlags & 0xff00);
|
||||||
|
|
||||||
|
$armingFailuresList.find('*').removeClass("armin-status-failed");
|
||||||
|
|
||||||
|
for (var reason in armingReasons) {
|
||||||
|
if (armingReasons.hasOwnProperty(reason)) {
|
||||||
|
$('#reason-' + armingReasons[reason]).addClass("armin-status-failed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 1fps update rate will be fully enough
|
||||||
|
*/
|
||||||
|
GUI.interval_add('updateArminFailure', updateArminFailure, 500, true);
|
||||||
|
|
||||||
GUI.content_ready(callback);
|
GUI.content_ready(callback);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue