1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-13 11:29:53 +03:00

chainer for motors tab

This commit is contained in:
Pawel Spychalski (DzikuVx) 2018-02-01 15:45:23 +01:00
parent 80dfe85930
commit eb208af39d
5 changed files with 42 additions and 17 deletions

View file

@ -6,6 +6,16 @@ var MotorMixerRuleCollection = function () {
var self = {};
var data = [];
self.motorCount = 0;
self.setMotorCount = function (value) {
self.motorCount = value;
};
self.getMotorCount = function () {
return self.motorCount;
};
self.put = function (element) {
data.push(element);
};
@ -42,7 +52,7 @@ var MotorMixerRuleCollection = function () {
};
self.hasFreeSlots = function () {
return data.length < 8;
return data.length < self.getMotorCount();
};
return self;