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

add runcam split suport

add peripherals column on ports page

fixed ports page will show the rcsplit with apiversion less 1.27.0

move the modeName adjust function to peripherals.js, and add failsafe modename not update when rcsplit available

cleanup

clean up
This commit is contained in:
azol 2017-08-04 18:36:40 +08:00 committed by azolyoung
parent e394d4fd86
commit 73f324e4c1
9 changed files with 152 additions and 13 deletions

32
js/peripherals.js Normal file
View file

@ -0,0 +1,32 @@
'use strict';
// return true if user has choose a special peripheral
function isPeripheralSelected(peripheralName) {
for (var portIndex = 0; portIndex < SERIAL_CONFIG.ports.length; portIndex++) {
var serialPort = SERIAL_CONFIG.ports[portIndex];
if (serialPort.functions.indexOf(peripheralName) >= 0) {
return true;
}
}
return false;
}
// Adjust the real name for a modeId. Useful if it belongs to a peripheral
function adjustBoxNameIfPeripheralWithModeID(modeId, defaultName) {
if (isPeripheralSelected("RUNCAM_SPLIT_CONTROL")) {
switch (modeId) {
case 39: // BOXCAMERA1
return "CAMERA WI-FI";
case 40: // BOXCAMERA2
return "CAMERA POWER";
case 41: // BOXCAMERA3
return "CAMERA CHANGE MODE";
default:
return defaultName;
}
}
return defaultName;
}