1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-14 11:59:51 +03:00

Merge branch 'master' into abo_mission_cont_multimissions

This commit is contained in:
breadoven 2021-11-02 13:51:07 +00:00 committed by GitHub
commit 76c0392eea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 443 additions and 398 deletions

View file

@ -2989,20 +2989,15 @@ var mspHelper = (function (gui) {
self.loadWaypoints = function (callback) {
MISSION_PLANER.reinit();
let waypointId = 1;
let waypointId = 0;
let startTime = new Date().getTime();
MSP.send_message(MSPCodes.MSP_WP_GETINFO, false, false, getFirstWP);
MSP.send_message(MSPCodes.MSP_WP_GETINFO, false, false, loadWaypoint);
function getFirstWP() {
MSP.send_message(MSPCodes.MSP_WP, [waypointId], false, nextWaypoint)
};
function nextWaypoint() {
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);
}
@ -3010,14 +3005,14 @@ var mspHelper = (function (gui) {
};
self.saveWaypoints = function (callback) {
let waypointId = 1;
let waypointId = 0;
let startTime = new Date().getTime();
MSP.send_message(MSPCodes.MSP_SET_WP, MISSION_PLANER.extractBuffer(waypointId), false, nextWaypoint)
sendWaypoint();
function nextWaypoint() {
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);