forked from iNavFlight/inav-configurator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservoMixRule.js
54 lines (39 loc) · 937 Bytes
/
servoMixRule.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
'use strict';
var ServoMixRule = function (target, input, rate, speed, condition) {
var self = {};
self.getTarget = function () {
return target;
};
self.setTarget = function (data) {
target = data;
};
self.getInput = function () {
return input;
};
self.setInput = function (data) {
input = data;
};
self.getRate = function () {
return rate;
};
self.setRate = function (data) {
rate = data;
};
self.getSpeed = function () {
return speed;
};
self.setSpeed = function (data) {
speed = data;
};
self.isUsed = function () {
return rate !== 0;
};
self.getConditionId = function () {
return (condition == undefined) ? -1 : condition;
};
self.setConditionId = function (data) {
condition = data;
};
return self;
};
module.exports = ServoMixRule;