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:
parent
640d0b39a3
commit
34c13c5010
5 changed files with 31 additions and 13 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue