1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 08:45:26 +03:00

Waypoint OOP version 1.9

This commit is contained in:
ArnoTlse 2021-04-14 21:10:45 +02:00
parent 3265158791
commit 0a8d4f81cf
6 changed files with 88 additions and 296 deletions

View file

@ -180,7 +180,6 @@ let WaypointCollection = function () {
optionIdx = 0;
idx++;
}
console.log(((bMWPfile && bReverse) ? self.get().length : self.get().length-1));
if (element.getNumber() == ((bMWPfile && bReverse) ? self.get().length : self.get().length-1)) {
element.setEndMission(0xA5);
}
@ -191,7 +190,16 @@ let WaypointCollection = function () {
});
};
self.getNonAttachedList = function () {
let tmpData = [];
data.forEach(function (element) {
if (!element.isAttached()) {
tmpData.push(element);
}
});
return tmpData;
}
self.getAttachedList = function () {
let tmpData = [];
@ -292,6 +300,16 @@ let WaypointCollection = function () {
self.setVersion(mission.getVersion());
self.setCenter(mission.getCenter());
}
self.convertJumpNumberToWaypoint = function(jumpId) {
let outputNumber = 0;
self.getNonAttachedList().forEach(function (element) {
if (element.getLayerNumber() == jumpId) {
outputNumber = element.getNumber();
}
});
return outputNumber;
}
return self;
};