1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-23 16:25:19 +03:00

Mixer tab, first elements

This commit is contained in:
Pawel Spychalski (DzikuVx) 2018-03-29 22:24:37 +02:00
parent 48c67874f9
commit 4f48ecff1b
8 changed files with 270 additions and 20 deletions

View file

@ -60,23 +60,6 @@ const mixerList = [
new ServoMixRule(SERVO_RUDDER, INPUT_STABILIZED_YAW, 100, 0)
]
}, // 1
{
id: 2,
name: 'Quad +',
model: 'quad_x',
image: 'quad_p',
hasCustomServoMixer: false,
enabled: true,
legacy: true,
platform: PLATFORM_MULTIROTOR,
motorMixer: [
new MotorMixRule(1.0, 0.0, 1.0, -1.0), // REAR
new MotorMixRule(1.0, -1.0, 0.0, 1.0), // RIGHT
new MotorMixRule(1.0, 1.0, 0.0, 1.0), // LEFT
new MotorMixRule(1.0, 0.0, -1.0, -1.0) // FRONT
],
servoMixer: []
}, // 2
{
id: 3,
name: 'Quad X',
@ -94,6 +77,23 @@ const mixerList = [
],
servoMixer: []
}, // 3
{
id: 2,
name: 'Quad +',
model: 'quad_x',
image: 'quad_p',
hasCustomServoMixer: false,
enabled: true,
legacy: true,
platform: PLATFORM_MULTIROTOR,
motorMixer: [
new MotorMixRule(1.0, 0.0, 1.0, -1.0), // REAR
new MotorMixRule(1.0, -1.0, 0.0, 1.0), // RIGHT
new MotorMixRule(1.0, 1.0, 0.0, 1.0), // LEFT
new MotorMixRule(1.0, 0.0, -1.0, -1.0) // FRONT
],
servoMixer: []
}, // 2
{
id: 4,
name: 'Bicopter',
@ -448,6 +448,51 @@ const mixerList = [
} // 25
];
const platformList = [
{
id: 0,
name: "Multirotor",
enabled: true,
flapsPossible: false
},
{
id: 1,
name: "Airplane",
enabled: true,
flapsPossible: true
},
{
id: 2,
name: "Helicopter",
enabled: false,
flapsPossible: false
},
{
id: 3,
name: "Tricopter",
enabled: true,
flapsPossible: false
},
{
id: 4,
name: "Rover",
enabled: false,
flapsPossible: false
},
{
id: 5,
name: "Boat",
enabled: false,
flapsPossible: false
},
{
id: 6,
name: "Other",
enabled: false,
flapsPossible: false
}
];
var helper = helper || {};
helper.mixer = (function (mixerList) {
@ -506,4 +551,36 @@ helper.mixer = (function (mixerList) {
};
return publicScope;
})(mixerList);
})(mixerList);
helper.platform = (function (platforms) {
let publicScope = {},
privateScope = {};
publicScope.getList = function () {
let retVal = [];
for (const i in platforms) {
if (platforms.hasOwnProperty(i)) {
let element = platforms[i];
if (element.enabled) {
retVal.push(element);
}
}
}
return retVal;
};
publicScope.getById = function (id) {
for (const i in platforms) {
if (platforms.hasOwnProperty(i)) {
let element = platforms[i];
if (element.id === id) {
return element;
}
}
}
return false;
}
return publicScope;
})(platformList);