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

Waypoint OOP version 1.3

This commit is contained in:
ArnoTlse 2021-04-05 20:03:34 +02:00
parent 739caeb49b
commit 84de6011c9
10 changed files with 910 additions and 211 deletions

View file

@ -32,7 +32,7 @@ let SafehomeCollection = function () {
self.inflate = function () {
while (self.hasFreeSlots()) {
self.put(new Safehome(0, 0, 0, 0));
self.put(new Safehome(data.length, 0, 0, 0));
}
};
@ -80,6 +80,21 @@ let SafehomeCollection = function () {
return a-b;
});
}
self.getSafehome = function(safehomeId) {
for (let safehomeIndex in data) {
if (data.hasOwnProperty(safehomeIndex)) {
let safehome = data[safehomeIndex];
if (safehome.getNumber() == safehomeId ) {
return safehome;
}
}
}
};
self.updateSafehome = function(newSafehome) {
data[newSafehome.getNumber()] = newSafehome;
};
return self;
};