1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

initial support for tab UI setup

This commit is contained in:
cTn 2013-04-08 21:10:47 +02:00
parent 3c67b3d9dc
commit 9fda14b5f2
8 changed files with 108 additions and 9 deletions

View file

@ -49,7 +49,8 @@ var CONFIG = {
mode: 0,
gyroscope: [0, 0, 0],
accelerometer: [0, 0, 0],
magnetometer: [0, 0, 0]
magnetometer: [0, 0, 0],
altitude: 0
};
$(document).ready(function() {
@ -140,7 +141,11 @@ function onOpen(openInfo) {
function onClosed(result) {
if (result) { // All went as expected
connectionId = -1; // reset connection id
sensor_status(sensors_detected = 0); // reset active sensor indicators
$('#content').empty(); // empty content
$('#tabs > ul li').removeClass('active'); // de-select any selected tabs
console.log('Connection closed successfully.');
} else { // Something went wrong
if (connectionId > 0) {
@ -281,6 +286,8 @@ function process_message(code, data) {
case MSP_codes.MSP_IDENT:
CONFIG.version = view.getUint8(0);
CONFIG.multiType = view.getUint8(1);
$('#tabs li a:first').click();
break;
case MSP_codes.MSP_STATUS:
CONFIG.cycleTime = view.getUint16(0, 1);
@ -322,7 +329,7 @@ function process_message(code, data) {
console.log(data);
break;
case MSP_codes.MSP_ALTITUDE:
console.log(data);
CONFIG.altitude = view.getUint32(0, 1);
break;
case MSP_codes.MSP_BAT:
console.log(data);