mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-22 15:55:28 +03:00
Do not use MSP_BOXNAMES
This commit is contained in:
parent
71ac169df6
commit
7f731bb1f3
4 changed files with 98 additions and 29 deletions
85
js/fc.js
85
js/fc.js
|
@ -85,6 +85,7 @@ var FC = {
|
||||||
FEATURES: null,
|
FEATURES: null,
|
||||||
RATE_DYNAMICS: null,
|
RATE_DYNAMICS: null,
|
||||||
EZ_TUNE: null,
|
EZ_TUNE: null,
|
||||||
|
FLIGHT_MODES: null,
|
||||||
|
|
||||||
restartRequired: false,
|
restartRequired: false,
|
||||||
MAX_SERVO_RATE: 125,
|
MAX_SERVO_RATE: 125,
|
||||||
|
@ -198,8 +199,88 @@ var FC = {
|
||||||
manual_yaw_rate: 0,
|
manual_yaw_rate: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.AUX_CONFIG = [];
|
this.AUX_CONFIG = [
|
||||||
this.AUX_CONFIG_IDS = [];
|
"ARM",
|
||||||
|
"PREARM",
|
||||||
|
"MULTI FUNCTION",
|
||||||
|
"ANGLE",
|
||||||
|
"HORIZON",
|
||||||
|
"TURN ASSIST",
|
||||||
|
"HEADING HOLD",
|
||||||
|
"CAMSTAB",
|
||||||
|
"HEADFREE",
|
||||||
|
"HEADADJ",
|
||||||
|
"FPV ANGLE MIX",
|
||||||
|
"NAV POSHOLD",
|
||||||
|
"NAV RTH",
|
||||||
|
"NAV WP",
|
||||||
|
"NAV CRUISE",
|
||||||
|
"NAV COURSE HOLD",
|
||||||
|
"HOME RESET",
|
||||||
|
"GCS NAV",
|
||||||
|
"WP PLANNER",
|
||||||
|
"MISSION CHANGE",
|
||||||
|
"MC BRAKING",
|
||||||
|
"NAV ALTHOLD",
|
||||||
|
"BEEPER",
|
||||||
|
"BEEPER MUTE",
|
||||||
|
"OSD OFF",
|
||||||
|
"BLACKBOX",
|
||||||
|
"FAILSAFE",
|
||||||
|
"CAMERA CONTROL 1",
|
||||||
|
"CAMERA CONTROL 2",
|
||||||
|
"CAMERA CONTROL 3",
|
||||||
|
"USER1",
|
||||||
|
"USER2",
|
||||||
|
"USER3",
|
||||||
|
"USER4",
|
||||||
|
"OSD ALT 1",
|
||||||
|
"OSD ALT 2",
|
||||||
|
"OSD ALT 3",
|
||||||
|
"MIXER PROFILE 2",
|
||||||
|
"MIXER TRANSITION"
|
||||||
|
];
|
||||||
|
this.AUX_CONFIG_IDS = [
|
||||||
|
0,
|
||||||
|
51,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
45,
|
||||||
|
53,
|
||||||
|
11,
|
||||||
|
10,
|
||||||
|
28,
|
||||||
|
31,
|
||||||
|
3,
|
||||||
|
5,
|
||||||
|
35,
|
||||||
|
32,
|
||||||
|
46,
|
||||||
|
6,
|
||||||
|
7,
|
||||||
|
19,
|
||||||
|
42,
|
||||||
|
43,
|
||||||
|
44,
|
||||||
|
8,
|
||||||
|
39,
|
||||||
|
40,
|
||||||
|
41,
|
||||||
|
13,
|
||||||
|
30,
|
||||||
|
55,
|
||||||
|
59,
|
||||||
|
26,
|
||||||
|
27,
|
||||||
|
47,
|
||||||
|
48,
|
||||||
|
57,
|
||||||
|
58,
|
||||||
|
61,
|
||||||
|
60,
|
||||||
|
62,
|
||||||
|
63
|
||||||
|
];
|
||||||
|
|
||||||
this.MODE_RANGES = [];
|
this.MODE_RANGES = [];
|
||||||
this.ADJUSTMENT_RANGES = [];
|
this.ADJUSTMENT_RANGES = [];
|
||||||
|
|
|
@ -460,27 +460,22 @@ var SerialBackend = (function () {
|
||||||
$('#dataflash_wrapper_global').show();
|
$('#dataflash_wrapper_global').show();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get BOXNAMES since it is used for some reason....
|
* Init PIDs bank with a length that depends on the version
|
||||||
*/
|
*/
|
||||||
MSP.send_message(MSPCodes.MSP_BOXNAMES, false, false, function () {
|
let pidCount = 11;
|
||||||
/*
|
|
||||||
* Init PIDs bank with a length that depends on the version
|
|
||||||
*/
|
|
||||||
let pidCount = 11;
|
|
||||||
|
|
||||||
for (let i = 0; i < pidCount; i++) {
|
for (let i = 0; i < pidCount; i++) {
|
||||||
FC.PIDs.push(new Array(4));
|
FC.PIDs.push(new Array(4));
|
||||||
}
|
}
|
||||||
|
|
||||||
interval.add('msp-load-update', function () {
|
interval.add('msp-load-update', function () {
|
||||||
$('#msp-version').text("MSP version: " + MSP.protocolVersion.toFixed(0));
|
$('#msp-version').text("MSP version: " + MSP.protocolVersion.toFixed(0));
|
||||||
$('#msp-load').text("MSP load: " + mspQueue.getLoad().toFixed(1));
|
$('#msp-load').text("MSP load: " + mspQueue.getLoad().toFixed(1));
|
||||||
$('#msp-roundtrip').text("MSP round trip: " + mspQueue.getRoundtrip().toFixed(0));
|
$('#msp-roundtrip').text("MSP round trip: " + mspQueue.getRoundtrip().toFixed(0));
|
||||||
$('#hardware-roundtrip').text("HW round trip: " + mspQueue.getHardwareRoundtrip().toFixed(0));
|
$('#hardware-roundtrip').text("HW round trip: " + mspQueue.getHardwareRoundtrip().toFixed(0));
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
interval.add('global_data_refresh', periodicStatusUpdater.run, periodicStatusUpdater.getUpdateInterval(CONFIGURATOR.connection.bitrate), false);
|
interval.add('global_data_refresh', periodicStatusUpdater.run, periodicStatusUpdater.getUpdateInterval(CONFIGURATOR.connection.bitrate), false);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,7 @@ TABS.adjustments.initialize = function (callback) {
|
||||||
GUI.active_tab_ref = this;
|
GUI.active_tab_ref = this;
|
||||||
GUI.active_tab = 'adjustments';
|
GUI.active_tab = 'adjustments';
|
||||||
|
|
||||||
function get_adjustment_ranges() {
|
MSP.send_message(MSPCodes.MSP_ADJUSTMENT_RANGES, false, false, get_box_ids);
|
||||||
MSP.send_message(MSPCodes.MSP_ADJUSTMENT_RANGES, false, false, get_box_ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_box_ids() {
|
function get_box_ids() {
|
||||||
MSP.send_message(MSPCodes.MSP_BOXIDS, false, false, get_rc_data);
|
MSP.send_message(MSPCodes.MSP_BOXIDS, false, false, get_rc_data);
|
||||||
|
@ -33,8 +31,6 @@ TABS.adjustments.initialize = function (callback) {
|
||||||
GUI.load(path.join(__dirname, "adjustments.html"), process_html);
|
GUI.load(path.join(__dirname, "adjustments.html"), process_html);
|
||||||
}
|
}
|
||||||
|
|
||||||
MSP.send_message(MSPCodes.MSP_BOXNAMES, false, false, get_adjustment_ranges);
|
|
||||||
|
|
||||||
function addAdjustment(adjustmentIndex, adjustmentRange, auxChannelCount) {
|
function addAdjustment(adjustmentIndex, adjustmentRange, auxChannelCount) {
|
||||||
|
|
||||||
var template = $('#tab-adjustments-templates').find('.adjustments .adjustment');
|
var template = $('#tab-adjustments-templates').find('.adjustments .adjustment');
|
||||||
|
|
|
@ -22,9 +22,8 @@ TABS.auxiliary = {};
|
||||||
TABS.auxiliary.initialize = function (callback) {
|
TABS.auxiliary.initialize = function (callback) {
|
||||||
GUI.active_tab_ref = this;
|
GUI.active_tab_ref = this;
|
||||||
GUI.active_tab = 'auxiliary';
|
GUI.active_tab = 'auxiliary';
|
||||||
function get_mode_ranges() {
|
|
||||||
MSP.send_message(MSPCodes.MSP_MODE_RANGES, false, false, get_box_ids);
|
MSP.send_message(MSPCodes.MSP_MODE_RANGES, false, false, get_box_ids);
|
||||||
}
|
|
||||||
|
|
||||||
function get_box_ids() {
|
function get_box_ids() {
|
||||||
MSP.send_message(MSPCodes.MSP_BOXIDS, false, false, get_rc_data);
|
MSP.send_message(MSPCodes.MSP_BOXIDS, false, false, get_rc_data);
|
||||||
|
@ -47,8 +46,6 @@ TABS.auxiliary.initialize = function (callback) {
|
||||||
GUI.load(path.join(__dirname, "auxiliary.html"), process_html);
|
GUI.load(path.join(__dirname, "auxiliary.html"), process_html);
|
||||||
}
|
}
|
||||||
|
|
||||||
MSP.send_message(MSPCodes.MSP_BOXNAMES, false, false, get_mode_ranges);
|
|
||||||
|
|
||||||
// This object separates out the dividers. This is also used to order the modes
|
// This object separates out the dividers. This is also used to order the modes
|
||||||
const modeSections = {};
|
const modeSections = {};
|
||||||
modeSections["Arming"] = ["ARM", "PREARM"];
|
modeSections["Arming"] = ["ARM", "PREARM"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue