mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-15 04:15:28 +03:00
Updated mixer
- Tidied up the code a little and grouped mixer types in model.js. - Removed second motor from all fixed wing mixers that aren't differential thrust. A bug was discovered that if an FC only has a single motor output, and 2 motors are set in the mixer, the motors won't work. - Added mixer for V-Tail with differential thrust - Enhanced the new servo button. Clicking it now selects the next available servo number, rather than just 0.
This commit is contained in:
parent
a31aa128f1
commit
47a9f4b36e
3 changed files with 184 additions and 140 deletions
307
js/model.js
307
js/model.js
|
@ -44,6 +44,7 @@ const
|
||||||
|
|
||||||
// generate mixer
|
// generate mixer
|
||||||
const mixerList = [
|
const mixerList = [
|
||||||
|
// ** Multirotor
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: 'Tricopter',
|
name: 'Tricopter',
|
||||||
|
@ -60,7 +61,7 @@ const mixerList = [
|
||||||
servoMixer: [
|
servoMixer: [
|
||||||
new ServoMixRule(SERVO_RUDDER, INPUT_STABILIZED_YAW, 100, 0),
|
new ServoMixRule(SERVO_RUDDER, INPUT_STABILIZED_YAW, 100, 0),
|
||||||
]
|
]
|
||||||
}, // 1
|
}, // 1
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
name: 'Quad X',
|
name: 'Quad X',
|
||||||
|
@ -76,7 +77,7 @@ const mixerList = [
|
||||||
new MotorMixRule(1.0, 1.0, -1.0, -1.0), // FRONT_L
|
new MotorMixRule(1.0, 1.0, -1.0, -1.0), // FRONT_L
|
||||||
],
|
],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 3
|
}, // 3
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
name: 'Quad +',
|
name: 'Quad +',
|
||||||
|
@ -92,7 +93,7 @@ const mixerList = [
|
||||||
new MotorMixRule(1.0, 0.0, -1.0, -1.0), // FRONT
|
new MotorMixRule(1.0, 0.0, -1.0, -1.0), // FRONT
|
||||||
],
|
],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 2
|
}, // 2
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
name: 'Bicopter',
|
name: 'Bicopter',
|
||||||
|
@ -103,18 +104,7 @@ const mixerList = [
|
||||||
platform: PLATFORM_MULTIROTOR,
|
platform: PLATFORM_MULTIROTOR,
|
||||||
motorMixer: [],
|
motorMixer: [],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 4
|
}, // 4
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
name: 'Gimbal',
|
|
||||||
model: 'custom',
|
|
||||||
image: 'custom',
|
|
||||||
enabled: false,
|
|
||||||
legacy: true,
|
|
||||||
platform: PLATFORM_OTHER,
|
|
||||||
motorMixer: [],
|
|
||||||
servoMixer: []
|
|
||||||
}, // 5
|
|
||||||
{
|
{
|
||||||
id: 6,
|
id: 6,
|
||||||
name: 'Y6',
|
name: 'Y6',
|
||||||
|
@ -132,7 +122,7 @@ const mixerList = [
|
||||||
new MotorMixRule(1.0, 1.0, -0.666667, 1.0), // UNDER_LEFT
|
new MotorMixRule(1.0, 1.0, -0.666667, 1.0), // UNDER_LEFT
|
||||||
],
|
],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 6
|
}, // 6
|
||||||
{
|
{
|
||||||
id: 7,
|
id: 7,
|
||||||
name: 'Hex +',
|
name: 'Hex +',
|
||||||
|
@ -150,45 +140,7 @@ const mixerList = [
|
||||||
new MotorMixRule(1.0, 0.0, 1.0, -1.0), // REAR
|
new MotorMixRule(1.0, 0.0, 1.0, -1.0), // REAR
|
||||||
],
|
],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 7
|
}, // 7
|
||||||
{
|
|
||||||
id: 8,
|
|
||||||
name: 'Flying Wing',
|
|
||||||
model: 'flying_wing',
|
|
||||||
image: 'flying_wing',
|
|
||||||
enabled: true,
|
|
||||||
legacy: true,
|
|
||||||
platform: PLATFORM_AIRPLANE,
|
|
||||||
motorMixer: [
|
|
||||||
new MotorMixRule(1.0, 0.0, 0.0, 0.0),
|
|
||||||
new MotorMixRule(1.0, 0.0, 0.0, 0.0),
|
|
||||||
],
|
|
||||||
servoMixer: [
|
|
||||||
new ServoMixRule(SERVO_ELEVON_1, INPUT_STABILIZED_ROLL, 50, 0),
|
|
||||||
new ServoMixRule(SERVO_ELEVON_1, INPUT_STABILIZED_PITCH, 50, 0),
|
|
||||||
new ServoMixRule(SERVO_ELEVON_2, INPUT_STABILIZED_ROLL, -50, 0),
|
|
||||||
new ServoMixRule(SERVO_ELEVON_2, INPUT_STABILIZED_PITCH, 50, 0),
|
|
||||||
]
|
|
||||||
}, // 8
|
|
||||||
{
|
|
||||||
id: 27,
|
|
||||||
name: 'Flying Wing with differential thrust',
|
|
||||||
model: 'flying_wing',
|
|
||||||
image: 'flying_wing',
|
|
||||||
enabled: true,
|
|
||||||
legacy: false,
|
|
||||||
platform: PLATFORM_AIRPLANE,
|
|
||||||
motorMixer: [
|
|
||||||
new MotorMixRule(1.0, 0.0, 0.0, 0.1),
|
|
||||||
new MotorMixRule(1.0, 0.0, 0.0, -0.1)
|
|
||||||
],
|
|
||||||
servoMixer: [
|
|
||||||
new ServoMixRule(SERVO_ELEVON_1, INPUT_STABILIZED_ROLL, 50, 0),
|
|
||||||
new ServoMixRule(SERVO_ELEVON_1, INPUT_STABILIZED_PITCH, 50, 0),
|
|
||||||
new ServoMixRule(SERVO_ELEVON_2, INPUT_STABILIZED_ROLL, -50, 0),
|
|
||||||
new ServoMixRule(SERVO_ELEVON_2, INPUT_STABILIZED_PITCH, 50, 0),
|
|
||||||
]
|
|
||||||
}, // 27
|
|
||||||
{
|
{
|
||||||
id: 9,
|
id: 9,
|
||||||
name: 'Y4',
|
name: 'Y4',
|
||||||
|
@ -204,7 +156,7 @@ const mixerList = [
|
||||||
new MotorMixRule(1.0, 1.0, -1.0, 0.0), // FRONT_L CW
|
new MotorMixRule(1.0, 1.0, -1.0, 0.0), // FRONT_L CW
|
||||||
],
|
],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 9
|
}, // 9
|
||||||
{
|
{
|
||||||
id: 10,
|
id: 10,
|
||||||
name: 'Hex X',
|
name: 'Hex X',
|
||||||
|
@ -222,7 +174,7 @@ const mixerList = [
|
||||||
new MotorMixRule(1.0, 1.0, 0.0, 1.0), // LEFT
|
new MotorMixRule(1.0, 1.0, 0.0, 1.0), // LEFT
|
||||||
],
|
],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 10
|
}, // 10
|
||||||
{
|
{
|
||||||
id: 11,
|
id: 11,
|
||||||
name: 'Octo X8',
|
name: 'Octo X8',
|
||||||
|
@ -242,7 +194,7 @@ const mixerList = [
|
||||||
new MotorMixRule(1.0, 1.0, -1.0, 1.0), // UNDER_FRONT_L
|
new MotorMixRule(1.0, 1.0, -1.0, 1.0), // UNDER_FRONT_L
|
||||||
],
|
],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 11
|
}, // 11
|
||||||
{
|
{
|
||||||
id: 12,
|
id: 12,
|
||||||
name: 'Octo Flat +',
|
name: 'Octo Flat +',
|
||||||
|
@ -262,7 +214,7 @@ const mixerList = [
|
||||||
new MotorMixRule(1.0, 1.0, 0.0, -1.0), // LEFT
|
new MotorMixRule(1.0, 1.0, 0.0, -1.0), // LEFT
|
||||||
],
|
],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 12
|
}, // 12
|
||||||
{
|
{
|
||||||
id: 13,
|
id: 13,
|
||||||
name: 'Octo Flat X',
|
name: 'Octo Flat X',
|
||||||
|
@ -282,51 +234,7 @@ const mixerList = [
|
||||||
new MotorMixRule(1.0, 1.0, 0.414178, -1.0), // MIDREAR_L
|
new MotorMixRule(1.0, 1.0, 0.414178, -1.0), // MIDREAR_L
|
||||||
],
|
],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 13
|
}, // 13
|
||||||
{
|
|
||||||
id: 14,
|
|
||||||
name: 'Airplane',
|
|
||||||
model: 'twin_plane',
|
|
||||||
image: 'airplane',
|
|
||||||
enabled: true,
|
|
||||||
legacy: true,
|
|
||||||
platform: PLATFORM_AIRPLANE,
|
|
||||||
hasFlaps: true,
|
|
||||||
motorMixer: [
|
|
||||||
new MotorMixRule(1.0, 0.0, 0.0, 0.0),
|
|
||||||
new MotorMixRule(1.0, 0.0, 0.0, 0.0),
|
|
||||||
],
|
|
||||||
servoMixer: [
|
|
||||||
new ServoMixRule(SERVO_ELEVATOR, INPUT_STABILIZED_PITCH, 100, 0),
|
|
||||||
new ServoMixRule(SERVO_FLAPPERON_1, INPUT_STABILIZED_ROLL, 100, 0),
|
|
||||||
/*new ServoMixRule(SERVO_FLAPPERON_1, INPUT_FEATURE_FLAPS, 100, 0),*/
|
|
||||||
new ServoMixRule(SERVO_FLAPPERON_2, INPUT_STABILIZED_ROLL, 100, 0),
|
|
||||||
/*new ServoMixRule(SERVO_FLAPPERON_2, INPUT_FEATURE_FLAPS, -100, 0),*/
|
|
||||||
new ServoMixRule(SERVO_RUDDER, INPUT_STABILIZED_YAW, 100, 0),
|
|
||||||
]
|
|
||||||
}, // 14
|
|
||||||
{
|
|
||||||
id: 15,
|
|
||||||
name: 'Heli 120',
|
|
||||||
model: 'custom',
|
|
||||||
image: 'custom',
|
|
||||||
enabled: false,
|
|
||||||
legacy: true,
|
|
||||||
platform: PLATFORM_HELICOPTER,
|
|
||||||
motorMixer: [],
|
|
||||||
servoMixer: []
|
|
||||||
}, // 15
|
|
||||||
{
|
|
||||||
id: 16,
|
|
||||||
name: 'Heli 90',
|
|
||||||
model: 'custom',
|
|
||||||
image: 'custom',
|
|
||||||
enabled: false,
|
|
||||||
legacy: true,
|
|
||||||
platform: PLATFORM_HELICOPTER,
|
|
||||||
motorMixer: [],
|
|
||||||
servoMixer: []
|
|
||||||
}, // 16
|
|
||||||
{
|
{
|
||||||
id: 17,
|
id: 17,
|
||||||
name: 'V-tail Quad',
|
name: 'V-tail Quad',
|
||||||
|
@ -360,18 +268,7 @@ const mixerList = [
|
||||||
new MotorMixRule(1.0, 0.0, 0.0, 0.0), // LEFT
|
new MotorMixRule(1.0, 0.0, 0.0, 0.0), // LEFT
|
||||||
],
|
],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 18
|
}, // 18
|
||||||
{
|
|
||||||
id: 19,
|
|
||||||
name: 'PPM to SERVO',
|
|
||||||
model: 'custom',
|
|
||||||
image: 'custom',
|
|
||||||
enabled: false,
|
|
||||||
legacy: true,
|
|
||||||
platform: PLATFORM_OTHER,
|
|
||||||
motorMixer: [],
|
|
||||||
servoMixer: []
|
|
||||||
}, // 19
|
|
||||||
{
|
{
|
||||||
id: 20,
|
id: 20,
|
||||||
name: 'Dualcopter',
|
name: 'Dualcopter',
|
||||||
|
@ -382,7 +279,7 @@ const mixerList = [
|
||||||
platform: PLATFORM_MULTIROTOR,
|
platform: PLATFORM_MULTIROTOR,
|
||||||
motorMixer: [],
|
motorMixer: [],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 20
|
}, // 20
|
||||||
{
|
{
|
||||||
id: 21,
|
id: 21,
|
||||||
name: 'Singlecopter',
|
name: 'Singlecopter',
|
||||||
|
@ -393,7 +290,7 @@ const mixerList = [
|
||||||
platform: PLATFORM_MULTIROTOR,
|
platform: PLATFORM_MULTIROTOR,
|
||||||
motorMixer: [],
|
motorMixer: [],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 21
|
}, // 21
|
||||||
{
|
{
|
||||||
id: 22,
|
id: 22,
|
||||||
name: 'A-tail Quad',
|
name: 'A-tail Quad',
|
||||||
|
@ -420,18 +317,7 @@ const mixerList = [
|
||||||
platform: PLATFORM_MULTIROTOR,
|
platform: PLATFORM_MULTIROTOR,
|
||||||
motorMixer: [],
|
motorMixer: [],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 23
|
}, // 23
|
||||||
{
|
|
||||||
id: 24,
|
|
||||||
name: 'Custom Airplane',
|
|
||||||
model: 'twin_plane',
|
|
||||||
image: 'airplane',
|
|
||||||
enabled: false,
|
|
||||||
legacy: true,
|
|
||||||
platform: PLATFORM_AIRPLANE,
|
|
||||||
motorMixer: [],
|
|
||||||
servoMixer: []
|
|
||||||
}, // 24
|
|
||||||
{
|
{
|
||||||
id: 25,
|
id: 25,
|
||||||
name: 'Custom Tricopter',
|
name: 'Custom Tricopter',
|
||||||
|
@ -442,7 +328,67 @@ const mixerList = [
|
||||||
platform: PLATFORM_TRICOPTER,
|
platform: PLATFORM_TRICOPTER,
|
||||||
motorMixer: [],
|
motorMixer: [],
|
||||||
servoMixer: []
|
servoMixer: []
|
||||||
}, // 25
|
}, // 25
|
||||||
|
|
||||||
|
// ** Fixed Wing **
|
||||||
|
{
|
||||||
|
id: 8,
|
||||||
|
name: 'Flying Wing',
|
||||||
|
model: 'flying_wing',
|
||||||
|
image: 'flying_wing',
|
||||||
|
enabled: true,
|
||||||
|
legacy: true,
|
||||||
|
platform: PLATFORM_AIRPLANE,
|
||||||
|
motorMixer: [
|
||||||
|
new MotorMixRule(1.0, 0.0, 0.0, 0.0),
|
||||||
|
],
|
||||||
|
servoMixer: [
|
||||||
|
new ServoMixRule(SERVO_ELEVON_1, INPUT_STABILIZED_ROLL, 50, 0),
|
||||||
|
new ServoMixRule(SERVO_ELEVON_1, INPUT_STABILIZED_PITCH, 50, 0),
|
||||||
|
new ServoMixRule(SERVO_ELEVON_2, INPUT_STABILIZED_ROLL, -50, 0),
|
||||||
|
new ServoMixRule(SERVO_ELEVON_2, INPUT_STABILIZED_PITCH, 50, 0),
|
||||||
|
]
|
||||||
|
}, // 8
|
||||||
|
{
|
||||||
|
id: 27,
|
||||||
|
name: 'Flying Wing with differential thrust',
|
||||||
|
model: 'flying_wing',
|
||||||
|
image: 'flying_wing',
|
||||||
|
enabled: true,
|
||||||
|
legacy: false,
|
||||||
|
platform: PLATFORM_AIRPLANE,
|
||||||
|
motorMixer: [
|
||||||
|
new MotorMixRule(1.0, 0.0, 0.0, 0.1),
|
||||||
|
new MotorMixRule(1.0, 0.0, 0.0, -0.1)
|
||||||
|
],
|
||||||
|
servoMixer: [
|
||||||
|
new ServoMixRule(SERVO_ELEVON_1, INPUT_STABILIZED_ROLL, 50, 0),
|
||||||
|
new ServoMixRule(SERVO_ELEVON_1, INPUT_STABILIZED_PITCH, 50, 0),
|
||||||
|
new ServoMixRule(SERVO_ELEVON_2, INPUT_STABILIZED_ROLL, -50, 0),
|
||||||
|
new ServoMixRule(SERVO_ELEVON_2, INPUT_STABILIZED_PITCH, 50, 0),
|
||||||
|
]
|
||||||
|
}, // 27
|
||||||
|
{
|
||||||
|
id: 14,
|
||||||
|
name: 'Airplane',
|
||||||
|
model: 'twin_plane',
|
||||||
|
image: 'airplane',
|
||||||
|
enabled: true,
|
||||||
|
legacy: true,
|
||||||
|
platform: PLATFORM_AIRPLANE,
|
||||||
|
hasFlaps: true,
|
||||||
|
motorMixer: [
|
||||||
|
new MotorMixRule(1.0, 0.0, 0.0, 0.0),
|
||||||
|
],
|
||||||
|
servoMixer: [
|
||||||
|
new ServoMixRule(SERVO_ELEVATOR, INPUT_STABILIZED_PITCH, 100, 0),
|
||||||
|
new ServoMixRule(SERVO_FLAPPERON_1, INPUT_STABILIZED_ROLL, 100, 0),
|
||||||
|
/*new ServoMixRule(SERVO_FLAPPERON_1, INPUT_FEATURE_FLAPS, 100, 0),*/
|
||||||
|
new ServoMixRule(SERVO_FLAPPERON_2, INPUT_STABILIZED_ROLL, 100, 0),
|
||||||
|
/*new ServoMixRule(SERVO_FLAPPERON_2, INPUT_FEATURE_FLAPS, -100, 0),*/
|
||||||
|
new ServoMixRule(SERVO_RUDDER, INPUT_STABILIZED_YAW, 100, 0),
|
||||||
|
]
|
||||||
|
}, // 14
|
||||||
{
|
{
|
||||||
id: 26,
|
id: 26,
|
||||||
name: 'Airplane with differential thrust',
|
name: 'Airplane with differential thrust',
|
||||||
|
@ -464,10 +410,10 @@ const mixerList = [
|
||||||
/*new ServoMixRule(SERVO_FLAPPERON_2, INPUT_FEATURE_FLAPS, -100, 0),*/
|
/*new ServoMixRule(SERVO_FLAPPERON_2, INPUT_FEATURE_FLAPS, -100, 0),*/
|
||||||
new ServoMixRule(SERVO_RUDDER, INPUT_STABILIZED_YAW, 100, 0),
|
new ServoMixRule(SERVO_RUDDER, INPUT_STABILIZED_YAW, 100, 0),
|
||||||
]
|
]
|
||||||
},
|
}, // 26
|
||||||
{
|
{
|
||||||
id: 28,
|
id: 28,
|
||||||
name: 'Airplane V-tail (individual aileron servos)',
|
name: 'Airplane V-tail',
|
||||||
model: 'vtail_plane',
|
model: 'vtail_plane',
|
||||||
image: 'airplane_vtail',
|
image: 'airplane_vtail',
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
@ -487,7 +433,31 @@ const mixerList = [
|
||||||
new ServoMixRule(4, INPUT_STABILIZED_PITCH, -50, 0),
|
new ServoMixRule(4, INPUT_STABILIZED_PITCH, -50, 0),
|
||||||
new ServoMixRule(4, INPUT_STABILIZED_YAW, -50, 0)
|
new ServoMixRule(4, INPUT_STABILIZED_YAW, -50, 0)
|
||||||
]
|
]
|
||||||
},
|
}, // 28
|
||||||
|
{
|
||||||
|
id: 34,
|
||||||
|
name: 'Airplane V-tail with differential thrust',
|
||||||
|
model: 'vtail_plane',
|
||||||
|
image: 'airplane_vtail',
|
||||||
|
enabled: true,
|
||||||
|
legacy: false,
|
||||||
|
platform: PLATFORM_AIRPLANE,
|
||||||
|
hasFlaps: true,
|
||||||
|
motorMixer: [
|
||||||
|
new MotorMixRule(1.0, 0.0, 0.0, 0.3),
|
||||||
|
new MotorMixRule(1.0, 0.0, 0.0, -0.3)
|
||||||
|
],
|
||||||
|
servoMixer: [
|
||||||
|
new ServoMixRule(1, INPUT_STABILIZED_ROLL, 100, 0),
|
||||||
|
/*new ServoMixRule(1, INPUT_FEATURE_FLAPS, 100, 0),*/
|
||||||
|
new ServoMixRule(2, INPUT_STABILIZED_ROLL, 100, 0),
|
||||||
|
/*new ServoMixRule(2, INPUT_FEATURE_FLAPS, 100, 0),*/
|
||||||
|
new ServoMixRule(3, INPUT_STABILIZED_PITCH, 50, 0),
|
||||||
|
new ServoMixRule(3, INPUT_STABILIZED_YAW, -50, 0),
|
||||||
|
new ServoMixRule(4, INPUT_STABILIZED_PITCH, -50, 0),
|
||||||
|
new ServoMixRule(4, INPUT_STABILIZED_YAW, -50, 0)
|
||||||
|
]
|
||||||
|
}, // 34
|
||||||
{
|
{
|
||||||
id: 29,
|
id: 29,
|
||||||
name: 'Airplane V-tail (single aileron servo)',
|
name: 'Airplane V-tail (single aileron servo)',
|
||||||
|
@ -506,7 +476,7 @@ const mixerList = [
|
||||||
new ServoMixRule(3, INPUT_STABILIZED_PITCH, -50, 0),
|
new ServoMixRule(3, INPUT_STABILIZED_PITCH, -50, 0),
|
||||||
new ServoMixRule(3, INPUT_STABILIZED_YAW, -50, 0),
|
new ServoMixRule(3, INPUT_STABILIZED_YAW, -50, 0),
|
||||||
]
|
]
|
||||||
},
|
}, //29
|
||||||
{
|
{
|
||||||
id: 30,
|
id: 30,
|
||||||
name: 'Airplane without rudder',
|
name: 'Airplane without rudder',
|
||||||
|
@ -526,7 +496,44 @@ const mixerList = [
|
||||||
new ServoMixRule(SERVO_FLAPPERON_2, INPUT_STABILIZED_ROLL, 100, 0),
|
new ServoMixRule(SERVO_FLAPPERON_2, INPUT_STABILIZED_ROLL, 100, 0),
|
||||||
/*new ServoMixRule(SERVO_FLAPPERON_2, INPUT_FEATURE_FLAPS, 100, 0),*/
|
/*new ServoMixRule(SERVO_FLAPPERON_2, INPUT_FEATURE_FLAPS, 100, 0),*/
|
||||||
]
|
]
|
||||||
},
|
}, // 30
|
||||||
|
{
|
||||||
|
id: 24,
|
||||||
|
name: 'Custom Airplane',
|
||||||
|
model: 'twin_plane',
|
||||||
|
image: 'airplane',
|
||||||
|
enabled: false,
|
||||||
|
legacy: true,
|
||||||
|
platform: PLATFORM_AIRPLANE,
|
||||||
|
motorMixer: [],
|
||||||
|
servoMixer: []
|
||||||
|
}, // 24
|
||||||
|
|
||||||
|
// ** Helicopter **
|
||||||
|
{
|
||||||
|
id: 15,
|
||||||
|
name: 'Heli 120',
|
||||||
|
model: 'custom',
|
||||||
|
image: 'custom',
|
||||||
|
enabled: false,
|
||||||
|
legacy: true,
|
||||||
|
platform: PLATFORM_HELICOPTER,
|
||||||
|
motorMixer: [],
|
||||||
|
servoMixer: []
|
||||||
|
}, // 15
|
||||||
|
{
|
||||||
|
id: 16,
|
||||||
|
name: 'Heli 90',
|
||||||
|
model: 'custom',
|
||||||
|
image: 'custom',
|
||||||
|
enabled: false,
|
||||||
|
legacy: true,
|
||||||
|
platform: PLATFORM_HELICOPTER,
|
||||||
|
motorMixer: [],
|
||||||
|
servoMixer: []
|
||||||
|
}, // 16
|
||||||
|
|
||||||
|
// ** Other platforms **
|
||||||
{
|
{
|
||||||
id: 31,
|
id: 31,
|
||||||
name: 'Rover',
|
name: 'Rover',
|
||||||
|
@ -556,8 +563,8 @@ const mixerList = [
|
||||||
servoMixer: [
|
servoMixer: [
|
||||||
new ServoMixRule(3, INPUT_STABILIZED_YAW, 100, 0),
|
new ServoMixRule(3, INPUT_STABILIZED_YAW, 100, 0),
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
,
|
// ** Misc **
|
||||||
{
|
{
|
||||||
id: 33,
|
id: 33,
|
||||||
name: 'Other',
|
name: 'Other',
|
||||||
|
@ -572,7 +579,29 @@ const mixerList = [
|
||||||
servoMixer: [
|
servoMixer: [
|
||||||
new ServoMixRule(3, INPUT_STABILIZED_YAW, 100, 0),
|
new ServoMixRule(3, INPUT_STABILIZED_YAW, 100, 0),
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
name: 'Gimbal',
|
||||||
|
model: 'custom',
|
||||||
|
image: 'custom',
|
||||||
|
enabled: false,
|
||||||
|
legacy: true,
|
||||||
|
platform: PLATFORM_OTHER,
|
||||||
|
motorMixer: [],
|
||||||
|
servoMixer: []
|
||||||
|
}, // 5
|
||||||
|
{
|
||||||
|
id: 19,
|
||||||
|
name: 'PPM to SERVO',
|
||||||
|
model: 'custom',
|
||||||
|
image: 'custom',
|
||||||
|
enabled: false,
|
||||||
|
legacy: true,
|
||||||
|
platform: PLATFORM_OTHER,
|
||||||
|
motorMixer: [],
|
||||||
|
servoMixer: []
|
||||||
|
}, // 19
|
||||||
];
|
];
|
||||||
|
|
||||||
const platformList = [
|
const platformList = [
|
||||||
|
|
|
@ -99,5 +99,20 @@ let ServoMixerRuleCollection = function () {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.getNextUnusedIndex = function() {
|
||||||
|
let nextTarget = 0;
|
||||||
|
|
||||||
|
for (let ruleIndex in data) {
|
||||||
|
if (data.hasOwnProperty(ruleIndex)) {
|
||||||
|
let target = data[ruleIndex].getTarget();
|
||||||
|
if (target > nextTarget) {
|
||||||
|
nextTarget = target;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nextTarget+1;
|
||||||
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
|
@ -438,7 +438,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
$("[data-role='role-servo-add']").click(function () {
|
$("[data-role='role-servo-add']").click(function () {
|
||||||
if (SERVO_RULES.hasFreeSlots()) {
|
if (SERVO_RULES.hasFreeSlots()) {
|
||||||
SERVO_RULES.put(new ServoMixRule(0, 0, 100, 0));
|
SERVO_RULES.put(new ServoMixRule(SERVO_RULES.getNextUnusedIndex(), 0, 100, 0));
|
||||||
renderServoMixRules();
|
renderServoMixRules();
|
||||||
renderOutputMapping();
|
renderOutputMapping();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue