1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-15 04:15:28 +03:00

planer to planner

This commit is contained in:
breadoven 2021-11-26 23:16:02 +00:00
parent bf3fc89e6d
commit d0e1788318
5 changed files with 53 additions and 53 deletions

View file

@ -447,7 +447,7 @@ var mspHelper = (function (gui) {
}
break;
case MSPCodes.MSP_WP:
MISSION_PLANER.put(new Waypoint(
MISSION_PLANNER.put(new Waypoint(
data.getUint8(0),
data.getUint8(1),
data.getInt32(2, true),
@ -1422,9 +1422,9 @@ var mspHelper = (function (gui) {
break;
case MSPCodes.MSP_WP_GETINFO:
// Reserved for waypoint capabilities data.getUint8(0);
MISSION_PLANER.setMaxWaypoints(data.getUint8(1));
MISSION_PLANER.setValidMission(data.getUint8(2));
MISSION_PLANER.setCountBusyPoints(data.getUint8(3));
MISSION_PLANNER.setMaxWaypoints(data.getUint8(1));
MISSION_PLANNER.setValidMission(data.getUint8(2));
MISSION_PLANNER.setCountBusyPoints(data.getUint8(3));
break;
case MSPCodes.MSP_SET_WP:
console.log('Point saved');
@ -2988,14 +2988,14 @@ var mspHelper = (function (gui) {
};
self.loadWaypoints = function (callback) {
MISSION_PLANER.reinit();
MISSION_PLANNER.reinit();
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()) {
if (waypointId < MISSION_PLANNER.getCountBusyPoints()) {
MSP.send_message(MSPCodes.MSP_WP, [waypointId], false, loadWaypoint);
} else {
GUI.log('Receive time: ' + (new Date().getTime() - startTime) + 'ms');
@ -3011,11 +3011,11 @@ var mspHelper = (function (gui) {
function sendWaypoint() {
waypointId++;
if (waypointId < MISSION_PLANER.get().length) {
MSP.send_message(MSPCodes.MSP_SET_WP, MISSION_PLANER.extractBuffer(waypointId), false, sendWaypoint);
if (waypointId < MISSION_PLANNER.get().length) {
MSP.send_message(MSPCodes.MSP_SET_WP, MISSION_PLANNER.extractBuffer(waypointId), false, sendWaypoint);
}
else {
MSP.send_message(MSPCodes.MSP_SET_WP, MISSION_PLANER.extractBuffer(waypointId), false, endMission);
MSP.send_message(MSPCodes.MSP_SET_WP, MISSION_PLANNER.extractBuffer(waypointId), false, endMission);
}
};