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:
parent
739caeb49b
commit
84de6011c9
10 changed files with 910 additions and 211 deletions
|
@ -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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue