Add runcam split support, the user can setup runcam split control with mixer in remote control

1. Remove the RunCam split tab
2. Remove the apiVersion check for runcam split control

1. Remove four "rcsplit" msp message codes that are no longer needed
2. Add the name-covert logic for runcam split. When users choose the runcam split as a peripheral, in the Modes tab, the boxes:CAMERA1, CAMERA2, CAMERA3 will rename to CAMERA WI-FI, CAMERA POWER, CAMERA CHANGE MODE.

fix the wrong comments  in adjustRunCamSplitBoxNameWithModeID()

remove the codes and resources that are no longer needed.

cleanup up the codes.

Cleanup

Cleanup

Fix the box name error(POWERE - > POWER)

remove the variables for runcam split that no longer needed.

Add runcam split support, the user can setup runcam split control with mixer in remote control

1. Remove the RunCam split tab
2. Remove the apiVersion check for runcam split control

1. Remove four "rcsplit" msp message codes that are no longer needed
2. Add the name-covert logic for runcam split. When users choose the runcam split as a peripheral, in the Modes tab, the boxes:CAMERA1, CAMERA2, CAMERA3 will rename to CAMERA WI-FI, CAMERA POWER, CAMERA CHANGE MODE.

fix the wrong comments  in adjustRunCamSplitBoxNameWithModeID()

remove the codes and resources that are no longer needed.

cleanup up the codes.

Cleanup

Cleanup

Fix the box name error(POWERE - > POWER)

remove the variables for runcam split that no longer needed.

add apiVersion check for runcam split support(show runcam split peripheral option in Ports tab)

Use 1.3.7 of apiVersion to check whether the runcam split supported
10.3.x-maintenance
azol 2017-06-06 20:41:50 +08:00 committed by Andrey Mironov
parent e67dbc0971
commit 808b42b41b
4 changed files with 41 additions and 2 deletions

View File

@ -824,6 +824,9 @@
"portsFunction_IRC_TRAMP": {
"message": "IRC Tramp"
},
"portsFunction_RUNCAM_SPLIT_CONTROL": {
"message": "RunCam Split"
},
"pidTuningUpgradeFirmwareToChangePidController": {
"message": "<span style=\"color: red\">Changing PID controller disabled - you can change it via the CLI.</span> You have firmware with API version <span style=\"color: red\">$1</span>, but this functionality requires requires <span style=\"color: #ffbb00\">$2</span>."
},

View File

@ -23,7 +23,8 @@ function MspHelper () {
'ESC_SENSOR': 10,
'TBS_SMARTAUDIO': 11,
'TELEMETRY_IBUS': 12,
'IRC_TRAMP': 13
'IRC_TRAMP': 13,
'RUNCAM_SPLIT_CONTROL': 14 // support communitate with RunCam Split
};
}

View File

@ -24,11 +24,41 @@ TABS.auxiliary.initialize = function (callback) {
MSP.send_message(MSPCodes.MSP_BOXNAMES, false, false, get_mode_ranges);
// 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;
}
function adjustRunCamSplitBoxNameWithModeID(modeId, originalModeName) {
switch (modeId) {
case 32: // BOXCAMERA1
return "CAMERA WI-FI";
case 33: // BOXCAMERA2
return "CAMERA POWER";
case 34: // BOXCAMERA3
return "CAMERA CHANGE MODE"
default:
return originalModeName;
}
}
function createMode(modeIndex, modeId) {
var modeTemplate = $('#tab-auxiliary-templates .mode');
var newMode = modeTemplate.clone();
var modeName = AUX_CONFIG[modeIndex];
// if user choose the runcam split at peripheral column, then adjust the boxname(BOXCAMERA1, BOXCAMERA2, BOXCAMERA3)
if (isPeripheralSelected("RUNCAM_SPLIT_CONTROL")) {
modeName = adjustRunCamSplitBoxNameWithModeID(modeId, modeName);
}
$(newMode).attr('id', 'mode-' + modeIndex);
$(newMode).find('.name').text(modeName);
@ -109,7 +139,7 @@ TABS.auxiliary.initialize = function (callback) {
$(rangeElement).find('.channel').val(auxChannelIndex);
}
function process_html() {
var auxChannelCount = RC.active_channels - 4;

View File

@ -43,6 +43,11 @@ TABS.ports.initialize = function (callback, scrollPosition) {
functionRules.push({ name: 'TELEMETRY_IBUS', groups: ['telemetry'], maxPorts: 1 });
}
// support configure RunCam Split
if (semver.gte(CONFIG.apiVersion, "1.37.0")) {
functionRules.push({ name: 'RUNCAM_SPLIT_CONTROL', groups: ['peripherals'], maxPorts: 1 });
}
for (var i = 0; i < functionRules.length; i++) {
functionRules[i].displayName = chrome.i18n.getMessage('portsFunction_' + functionRules[i].name);
}