2014-08-09 17:38:46 +00:00
|
|
|
'use strict';
|
|
|
|
|
2014-08-10 04:01:44 +00:00
|
|
|
var CONFIGURATOR = {
|
2014-09-29 18:48:28 +00:00
|
|
|
'releaseDate': 1412016413051, // new Date().getTime() - 09.29.2014
|
2014-08-10 04:01:44 +00:00
|
|
|
'firmwareVersionAccepted': 2.3,
|
|
|
|
'connectionValid': false,
|
|
|
|
'cliActive': false,
|
|
|
|
'cliValid': false
|
|
|
|
};
|
2014-02-25 13:37:34 +00:00
|
|
|
|
2014-01-28 00:33:25 +00:00
|
|
|
var CONFIG = {
|
|
|
|
version: 0,
|
2014-09-24 13:35:20 +00:00
|
|
|
buildInfo: '',
|
2014-01-28 00:33:25 +00:00
|
|
|
multiType: 0,
|
|
|
|
msp_version: 0,
|
|
|
|
capability: 0,
|
|
|
|
cycleTime: 0,
|
|
|
|
i2cError: 0,
|
|
|
|
activeSensors: 0,
|
|
|
|
mode: 0,
|
|
|
|
profile: 0,
|
2014-03-08 05:25:15 +00:00
|
|
|
|
2014-01-28 00:33:25 +00:00
|
|
|
uid: [0, 0, 0],
|
|
|
|
accelerometerTrims: [0, 0]
|
|
|
|
};
|
|
|
|
|
2014-09-16 12:48:36 +00:00
|
|
|
var BF_CONFIG = {
|
2014-09-17 18:13:13 +00:00
|
|
|
mixerConfiguration: 0,
|
|
|
|
features: 0,
|
|
|
|
serialrx_type: 0,
|
|
|
|
board_align_roll: 0,
|
|
|
|
board_align_pitch: 0,
|
2014-09-18 11:21:48 +00:00
|
|
|
board_align_yaw: 0,
|
|
|
|
currentscale: 0,
|
|
|
|
currentoffset: 0
|
2014-09-16 12:48:36 +00:00
|
|
|
// TBD
|
|
|
|
};
|
|
|
|
|
2014-05-03 20:42:11 +00:00
|
|
|
var PID_names = [];
|
2014-01-28 00:33:25 +00:00
|
|
|
var PIDs = new Array(10);
|
|
|
|
for (var i = 0; i < 10; i++) {
|
|
|
|
PIDs[i] = new Array(3);
|
|
|
|
}
|
|
|
|
|
2014-09-16 12:48:36 +00:00
|
|
|
var RC_MAP = [];
|
|
|
|
|
2014-05-15 11:12:13 +00:00
|
|
|
// defaults
|
|
|
|
// roll, pitch, yaw, throttle, aux 1, ... aux n
|
2014-01-28 00:33:25 +00:00
|
|
|
var RC = {
|
2014-05-15 11:12:13 +00:00
|
|
|
active_channels: 0,
|
|
|
|
channels: new Array(32)
|
2014-01-28 00:33:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
var RC_tuning = {
|
|
|
|
RC_RATE: 0,
|
|
|
|
RC_EXPO: 0,
|
|
|
|
roll_pitch_rate: 0,
|
|
|
|
yaw_rate: 0,
|
|
|
|
dynamic_THR_PID: 0,
|
|
|
|
throttle_MID: 0,
|
|
|
|
throttle_EXPO: 0,
|
|
|
|
};
|
|
|
|
|
2014-06-07 15:54:51 +00:00
|
|
|
var AUX_CONFIG = [];
|
|
|
|
var AUX_CONFIG_values = [];
|
2014-07-11 15:52:56 +00:00
|
|
|
var AUX_CONFIG_IDS = [];
|
2014-01-28 00:33:25 +00:00
|
|
|
|
2014-06-07 15:54:51 +00:00
|
|
|
var SERVO_CONFIG = [];
|
2014-01-28 00:33:25 +00:00
|
|
|
|
|
|
|
var SENSOR_DATA = {
|
|
|
|
gyroscope: [0, 0, 0],
|
|
|
|
accelerometer: [0, 0, 0],
|
|
|
|
magnetometer: [0, 0, 0],
|
|
|
|
altitude: 0,
|
2014-06-20 10:39:42 +00:00
|
|
|
kinematics: [0.0, 0.0, 0.0],
|
2014-06-08 15:16:44 +00:00
|
|
|
debug: [0, 0, 0, 0]
|
2014-01-28 00:33:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
var MOTOR_DATA = new Array(8);
|
|
|
|
var SERVO_DATA = new Array(8);
|
|
|
|
|
|
|
|
var GPS_DATA = {
|
|
|
|
fix: 0,
|
|
|
|
numSat: 0,
|
|
|
|
lat: 0,
|
|
|
|
lon: 0,
|
|
|
|
alt: 0,
|
|
|
|
speed: 0,
|
|
|
|
ground_course: 0,
|
|
|
|
distanceToHome: 0,
|
|
|
|
ditectionToHome: 0,
|
|
|
|
update: 0,
|
2014-03-08 05:25:15 +00:00
|
|
|
|
2014-01-28 00:33:25 +00:00
|
|
|
// baseflight specific gps stuff
|
2014-06-07 15:54:51 +00:00
|
|
|
chn: [],
|
|
|
|
svid: [],
|
|
|
|
quality: [],
|
|
|
|
cno: []
|
2014-01-28 00:33:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
var ANALOG = {
|
|
|
|
voltage: 0,
|
2014-05-29 18:16:32 +00:00
|
|
|
mAhdrawn: 0,
|
2014-01-28 00:33:25 +00:00
|
|
|
rssi: 0,
|
|
|
|
amperage: 0
|
|
|
|
};
|
|
|
|
|
|
|
|
var MISC = {
|
2014-09-18 10:24:38 +00:00
|
|
|
midrc: 0,
|
|
|
|
minthrottle: 0,
|
|
|
|
maxthrottle: 0,
|
|
|
|
mincommand: 0,
|
|
|
|
failsafe_throttle: 0,
|
|
|
|
gps_type: 0,
|
|
|
|
gps_baudrate: 0,
|
|
|
|
gps_ubx_sbas: 0,
|
|
|
|
multiwiicurrentoutput: 0,
|
2014-09-24 13:09:09 +00:00
|
|
|
rssi_aux_channel: 0,
|
2014-09-18 10:24:38 +00:00
|
|
|
placeholder2: 0,
|
|
|
|
mag_declination: 0, // not checked
|
|
|
|
vbatscale: 0,
|
|
|
|
vbatmincellvoltage: 0,
|
|
|
|
vbatmaxcellvoltage: 0,
|
|
|
|
placeholder3: 0
|
2014-01-28 00:33:25 +00:00
|
|
|
};
|