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

correctly set number of motors and servos

This commit is contained in:
Pawel Spychalski (DzikuVx) 2018-04-04 19:42:14 +02:00
parent 640d0b39a3
commit 34c13c5010
5 changed files with 31 additions and 13 deletions

View file

@ -3,8 +3,21 @@
var ServoMixerRuleCollection = function () {
var self = {};
var data = [];
let self = {},
data = [],
maxServoCount = 8;
self.setServoCount = function (value) {
maxServoCount = value;
};
self.getServoCount = function () {
return maxServoCount;
}
self.getServoRulesCount = function () {
return self.getServoCount() * 2;
}
self.put = function (element) {
data.push(element);
@ -42,7 +55,7 @@ var ServoMixerRuleCollection = function () {
};
self.hasFreeSlots = function () {
return data.length < 16;
return data.length < self.getServoRulesCount();
};
return self;