1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-25 01:05:12 +03:00

Merge branch 'master' into feature/uiunits

This commit is contained in:
Elgan Sayer 2021-11-11 19:51:13 +00:00 committed by GitHub
commit 1a05df71da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 1197 additions and 572 deletions

View file

@ -214,7 +214,11 @@ helper.defaultsDialog = (function () {
value: 10
},
{
key: "d_boost_factor",
key: "d_boost_min",
value: 1
},
{
key: "d_boost_max",
value: 1
},
{
@ -263,7 +267,7 @@ helper.defaultsDialog = (function () {
},
{
key: "nav_fw_pos_z_p",
value: 20
value: 15
},
{
key: "nav_fw_pos_z_d",
@ -279,7 +283,7 @@ helper.defaultsDialog = (function () {
},
{
key: "max_angle_inclination_rll",
value: 350
value: 450
},
{
key: "nav_fw_bank_angle",
@ -291,7 +295,11 @@ helper.defaultsDialog = (function () {
},
{
key: "fw_i_pitch",
value: 10
value: 5
},
{
key: "fw_d_pitch",
value: 5
},
{
key: "fw_ff_pitch",
@ -299,15 +307,19 @@ helper.defaultsDialog = (function () {
},
{
key: "fw_p_roll",
value: 10
value: 15
},
{
key: "fw_i_roll",
value: 8
value: 3
},
{
key: "fw_d_roll",
value: 7
},
{
key: "fw_ff_roll",
value: 40
value: 50
},
{
key: "fw_p_yaw",
@ -315,7 +327,7 @@ helper.defaultsDialog = (function () {
},
{
key: "fw_i_yaw",
value: 5
value: 0
},
{
key: "fw_ff_yaw",
@ -355,7 +367,7 @@ helper.defaultsDialog = (function () {
},
{
key: "nav_wp_radius",
value: 1500
value: 5000
},
],
"features": [
@ -392,7 +404,11 @@ helper.defaultsDialog = (function () {
value: 10
},
{
key: "d_boost_factor",
key: "d_boost_min",
value: 1
},
{
key: "d_boost_max",
value: 1
},
{
@ -441,7 +457,7 @@ helper.defaultsDialog = (function () {
},
{
key: "nav_fw_pos_z_p",
value: 20
value: 15
},
{
key: "nav_fw_pos_z_d",
@ -457,7 +473,7 @@ helper.defaultsDialog = (function () {
},
{
key: "max_angle_inclination_rll",
value: 450
value: 550
},
{
key: "nav_fw_bank_angle",
@ -465,11 +481,15 @@ helper.defaultsDialog = (function () {
},
{
key: "fw_p_pitch",
value: 10
value: 15
},
{
key: "fw_i_pitch",
value: 15
value: 5
},
{
key: "fw_d_pitch",
value: 5
},
{
key: "fw_ff_pitch",
@ -477,15 +497,15 @@ helper.defaultsDialog = (function () {
},
{
key: "fw_p_roll",
value: 5
value: 15
},
{
key: "fw_i_roll",
value: 8
value: 3
},
{
key: "fw_ff_roll",
value: 35
value: 50
},
{
key: "imu_acc_ignore_rate",
@ -521,7 +541,7 @@ helper.defaultsDialog = (function () {
},
{
key: "nav_wp_radius",
value: 1500
value: 5000
},
],
"features": [

View file

@ -1243,6 +1243,17 @@ var FC = {
hasOperand: [true, true],
output: "boolean"
},
41: {
name: "LOITER RADIUS OVERRIDE",
hasOperand: [true, false],
output: "boolean"
},
42: {
name: "SET PROFILE",
hasOperand: [true, false],
output: "boolean"
},
}
},
getOperandTypes: function () {
@ -1301,6 +1312,8 @@ var FC = {
32: "CRSF LQ",
33: "CRSF SNR",
34: "GPS Valid Fix",
35: "Loiter Radius [cm]",
36: "Active Profile",
}
},
3: {

View file

@ -455,7 +455,8 @@ var mspHelper = (function (gui) {
data.getInt32(10, true),
data.getInt16(14, true),
data.getInt16(16, true),
data.getInt16(18, true)
data.getInt16(18, true),
data.getUint8(20)
));
break;
case MSPCodes.MSP_BOXIDS:
@ -519,7 +520,7 @@ var mspHelper = (function (gui) {
));
}
}
break;
case MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_STATUS:
@ -1297,7 +1298,7 @@ var mspHelper = (function (gui) {
CALIBRATION_DATA.magZero.Y = data.getInt16(15, true);
CALIBRATION_DATA.magZero.Z = data.getInt16(17, true);
CALIBRATION_DATA.opflow.Scale = (data.getInt16(19, true) / 256.0);
if (semver.gte(CONFIG.flightControllerVersion, "2.6.0")) {
CALIBRATION_DATA.magGain.X = data.getInt16(21, true);
CALIBRATION_DATA.magGain.Y = data.getInt16(23, true);
@ -1513,8 +1514,8 @@ var mspHelper = (function (gui) {
break;
case MSPCodes.MSP2_INAV_SET_SAFEHOME:
console.log('Safehome points saved');
break;
break;
default:
console.log('Unknown code detected: ' + dataHandler.code);
} else {
@ -2125,7 +2126,7 @@ var mspHelper = (function (gui) {
buffer.push(SENSOR_CONFIG.opflow);
break;
case MSPCodes.MSP_WP_MISSION_SAVE:
// buffer.push(0);
console.log(buffer);
@ -2985,51 +2986,50 @@ var mspHelper = (function (gui) {
self.getMissionInfo = function (callback) {
MSP.send_message(MSPCodes.MSP_WP_GETINFO, false, false, callback);
};
self.loadWaypoints = function (callback) {
MISSION_PLANER.reinit();
let waypointId = 1;
MSP.send_message(MSPCodes.MSP_WP_GETINFO, false, false, getFirstWP);
function getFirstWP() {
MSP.send_message(MSPCodes.MSP_WP, [waypointId], false, nextWaypoint)
};
function nextWaypoint() {
let waypointId = 0;
let startTime = new Date().getTime();
MSP.send_message(MSPCodes.MSP_WP_GETINFO, false, false, loadWaypoint);
function loadWaypoint() {
waypointId++;
if (waypointId < MISSION_PLANER.getCountBusyPoints()) {
MSP.send_message(MSPCodes.MSP_WP, [waypointId], false, nextWaypoint);
}
else {
MSP.send_message(MSPCodes.MSP_WP, [waypointId], false, loadWaypoint);
} else {
GUI.log('Receive time: ' + (new Date().getTime() - startTime) + 'ms');
MSP.send_message(MSPCodes.MSP_WP, [waypointId], false, callback);
}
};
};
self.saveWaypoints = function (callback) {
let waypointId = 1;
MSP.send_message(MSPCodes.MSP_SET_WP, MISSION_PLANER.extractBuffer(waypointId), false, nextWaypoint)
function nextWaypoint() {
self.saveWaypoints = function (callback) {
let waypointId = 0;
let startTime = new Date().getTime();
sendWaypoint();
function sendWaypoint() {
waypointId++;
if (waypointId < MISSION_PLANER.get().length) {
MSP.send_message(MSPCodes.MSP_SET_WP, MISSION_PLANER.extractBuffer(waypointId), false, nextWaypoint);
MSP.send_message(MSPCodes.MSP_SET_WP, MISSION_PLANER.extractBuffer(waypointId), false, sendWaypoint);
}
else {
MSP.send_message(MSPCodes.MSP_SET_WP, MISSION_PLANER.extractBuffer(waypointId), false, endMission);
}
};
function endMission() {
GUI.log('Send time: ' + (new Date().getTime() - startTime) + 'ms');
MSP.send_message(MSPCodes.MSP_WP_GETINFO, false, false, callback);
}
};
self.loadSafehomes = function (callback) {
SAFEHOMES.flush();
let safehomeId = 0;
MSP.send_message(MSPCodes.MSP2_INAV_SAFEHOME, [safehomeId], false, nextSafehome);
function nextSafehome() {
safehomeId++;
if (safehomeId < SAFEHOMES.getMaxSafehomeCount()-1) {
@ -3040,11 +3040,11 @@ var mspHelper = (function (gui) {
}
};
};
self.saveSafehomes = function (callback) {
let safehomeId = 0;
MSP.send_message(MSPCodes.MSP2_INAV_SET_SAFEHOME, SAFEHOMES.extractBuffer(safehomeId), false, nextSendSafehome);
function nextSendSafehome() {
safehomeId++;
if (safehomeId < SAFEHOMES.getMaxSafehomeCount()-1) {
@ -3208,9 +3208,9 @@ var mspHelper = (function (gui) {
});
};
self.setSetting = function (name, value) {
self.setSetting = function (name, value, callback) {
this.encodeSetting(name, value).then(function (data) {
return MSP.promise(MSPCodes.MSPV2_SET_SETTING, data);
return MSP.promise(MSPCodes.MSPV2_SET_SETTING, data).then(callback);
});
};

View file

@ -72,7 +72,7 @@ let WaypointCollection = function () {
};
self.isEmpty = function () {
return data == [];
return data.length == 0;
};
self.flush = function () {
@ -149,7 +149,7 @@ let WaypointCollection = function () {
data = tmpData;
};
self.update = function (bMWPfile=false, bReverse=false) {
self.update = function (updateEndFlag = true, bMWPfile=false, bReverse=false) {
let oldWPNumber = 0;
let optionIdx = 0;
let idx = 0;
@ -180,11 +180,15 @@ let WaypointCollection = function () {
optionIdx = 0;
idx++;
}
if (element.getNumber() == ((bMWPfile && bReverse) ? self.get().length : self.get().length-1)) {
element.setEndMission(0xA5);
}
else {
element.setEndMission(0);
/* only update EndMission flag when required and only if single mission loaded on map */
if (updateEndFlag) {
if (element.getNumber() == self.get().length - 1) {
element.setEndMission(0xA5);
}
else if ((element.getNumber() == self.get().length - 2) && element.getEndMission() == 0xA5) {
element.setEndMission(0);
}
}
}
});