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

Blackbox moved to Pheripherials column

This commit is contained in:
Pawel Spychalski (DzikuVx) 2017-08-09 18:46:03 +02:00
parent 089a7d34bf
commit ccc92ac3b6
4 changed files with 62 additions and 84 deletions

View file

@ -7595,7 +7595,7 @@ var mspHelper = (function (gui) {
'BLACKBOX': 7, 'BLACKBOX': 7,
'TELEMETRY_MAVLINK': 8, 'TELEMETRY_MAVLINK': 8,
'TELEMETRY_IBUS': 9, 'TELEMETRY_IBUS': 9,
'RUNCAM_SPLIT_CONTROL' : 10, 'RUNCAM_SPLIT_CONTROL' : 10
}; };
/** /**
@ -20742,7 +20742,6 @@ TABS.ports = {};
TABS.ports.initialize = function (callback, scrollPosition) { TABS.ports.initialize = function (callback, scrollPosition) {
var board_definition = {}; var board_definition = {};
var isSupportPeripherals = semver.gte(CONFIG.flightControllerVersion, "1.7.3");
var functionRules = [ var functionRules = [
{name: 'MSP', groups: ['data', 'msp'], maxPorts: 2}, {name: 'MSP', groups: ['data', 'msp'], maxPorts: 2},
@ -20752,7 +20751,7 @@ TABS.ports.initialize = function (callback, scrollPosition) {
{name: 'TELEMETRY_SMARTPORT', groups: ['telemetry'], maxPorts: 1}, {name: 'TELEMETRY_SMARTPORT', groups: ['telemetry'], maxPorts: 1},
{name: 'TELEMETRY_LTM', groups: ['telemetry'], sharableWith: ['msp'], notSharableWith: ['blackbox'], maxPorts: 1}, {name: 'TELEMETRY_LTM', groups: ['telemetry'], sharableWith: ['msp'], notSharableWith: ['blackbox'], maxPorts: 1},
{name: 'RX_SERIAL', groups: ['rx'], maxPorts: 1}, {name: 'RX_SERIAL', groups: ['rx'], maxPorts: 1},
{name: 'BLACKBOX', groups: ['logging', 'blackbox'], sharableWith: ['msp'], notSharableWith: ['telemetry'], maxPorts: 1} {name: 'BLACKBOX', groups: ['peripherals'], sharableWith: ['msp'], notSharableWith: ['telemetry'], maxPorts: 1}
]; ];
if (semver.gte(CONFIG.flightControllerVersion, "1.2.0")) { if (semver.gte(CONFIG.flightControllerVersion, "1.2.0")) {
@ -20774,9 +20773,12 @@ TABS.ports.initialize = function (callback, scrollPosition) {
} }
// support configure RunCam Split // support configure RunCam Split
GUI.log('API version is ' + CONFIG.apiVersion); if (semver.gte(CONFIG.flightControllerVersion, "1.7.3")) {
if (isSupportPeripherals) { functionRules.push({
functionRules.push({ name: 'RUNCAM_SPLIT_CONTROL', groups: ['peripherals'], maxPorts: 1 }); name: 'RUNCAM_SPLIT_CONTROL',
groups: ['peripherals'],
maxPorts: 1 }
);
} }
for (var i = 0; i < functionRules.length; i++) { for (var i = 0; i < functionRules.length; i++) {
@ -20866,30 +20868,28 @@ TABS.ports.initialize = function (callback, scrollPosition) {
31: 'SOFTSERIAL2' 31: 'SOFTSERIAL2'
}; };
if (!isSupportPeripherals) { var i,
$('.peripherls-column').remove(); $elements;
$('.functionsCell-peripherals').remove();
$elements = $('select.gps_baudrate');
for (i = 0; i < gpsBaudRates.length; i++) {
$elements.append('<option value="' + gpsBaudRates[i] + '">' + gpsBaudRates[i] + '</option>');
} }
var gps_baudrate_e = $('select.gps_baudrate'); $elements = $('select.msp_baudrate');
for (var i = 0; i < gpsBaudRates.length; i++) { for (i = 0; i < mspBaudRates.length; i++) {
gps_baudrate_e.append('<option value="' + gpsBaudRates[i] + '">' + gpsBaudRates[i] + '</option>'); $elements.append('<option value="' + mspBaudRates[i] + '">' + mspBaudRates[i] + '</option>');
} }
var msp_baudrate_e = $('select.msp_baudrate'); $elements = $('select.telemetry_baudrate');
for (var i = 0; i < mspBaudRates.length; i++) {
msp_baudrate_e.append('<option value="' + mspBaudRates[i] + '">' + mspBaudRates[i] + '</option>');
}
var telemetry_baudrate_e = $('select.telemetry_baudrate');
var telemetryBaudRates = semver.gte(CONFIG.flightControllerVersion, "1.6.3") ? telemetryBaudRates_post1_6_3 : telemetryBaudRates_pre1_6_3; var telemetryBaudRates = semver.gte(CONFIG.flightControllerVersion, "1.6.3") ? telemetryBaudRates_post1_6_3 : telemetryBaudRates_pre1_6_3;
for (var i = 0; i < telemetryBaudRates.length; i++) { for (i = 0; i < telemetryBaudRates.length; i++) {
telemetry_baudrate_e.append('<option value="' + telemetryBaudRates[i] + '">' + telemetryBaudRates[i] + '</option>'); $elements.append('<option value="' + telemetryBaudRates[i] + '">' + telemetryBaudRates[i] + '</option>');
} }
var blackbox_baudrate_e = $('select.blackbox_baudrate'); $elements = $('select.blackbox_baudrate');
for (var i = 0; i < blackboxBaudRates.length; i++) { for (i = 0; i < blackboxBaudRates.length; i++) {
blackbox_baudrate_e.append('<option value="' + blackboxBaudRates[i] + '">' + blackboxBaudRates[i] + '</option>'); $elements.append('<option value="' + blackboxBaudRates[i] + '">' + blackboxBaudRates[i] + '</option>');
} }
var ports_e = $('.tab-ports .ports'); var ports_e = $('.tab-ports .ports');
@ -20901,17 +20901,10 @@ TABS.ports.initialize = function (callback, scrollPosition) {
port_configuration_e.data('serialPort', serialPort); port_configuration_e.data('serialPort', serialPort);
var msp_baudrate_e = port_configuration_e.find('select.msp_baudrate'); port_configuration_e.find('select.msp_baudrate').val(serialPort.msp_baudrate);
msp_baudrate_e.val(serialPort.msp_baudrate); port_configuration_e.find('select.telemetry_baudrate').val(serialPort.telemetry_baudrate);
port_configuration_e.find('select.gps_baudrate').val(serialPort.gps_baudrate);
var telemetry_baudrate_e = port_configuration_e.find('select.telemetry_baudrate'); port_configuration_e.find('select.blackbox_baudrate').val(serialPort.blackbox_baudrate);
telemetry_baudrate_e.val(serialPort.telemetry_baudrate);
var gps_baudrate_e = port_configuration_e.find('select.gps_baudrate');
gps_baudrate_e.val(serialPort.gps_baudrate);
var blackbox_baudrate_e = port_configuration_e.find('select.blackbox_baudrate');
blackbox_baudrate_e.val(serialPort.blackbox_baudrate);
port_configuration_e.find('.identifier').text(portIdentifierToNameMapping[serialPort.identifier]) port_configuration_e.find('.identifier').text(portIdentifierToNameMapping[serialPort.identifier])
@ -20924,7 +20917,7 @@ TABS.ports.initialize = function (callback, scrollPosition) {
var functions_e = $(port_configuration_e).find('.functionsCell-' + column); var functions_e = $(port_configuration_e).find('.functionsCell-' + column);
for (var i = 0; i < functionRules.length; i++) { for (i = 0; i < functionRules.length; i++) {
var functionRule = functionRules[i]; var functionRule = functionRules[i];
var functionName = functionRule.name; var functionName = functionRule.name;
@ -20998,12 +20991,10 @@ TABS.ports.initialize = function (callback, scrollPosition) {
functions.push(telemetryFunction); functions.push(telemetryFunction);
} }
if (isSupportPeripherals) {
var peripheralFunction = $(portConfiguration_e).find('select[name=function-peripherals]').val(); var peripheralFunction = $(portConfiguration_e).find('select[name=function-peripherals]').val();
if (peripheralFunction) { if (peripheralFunction) {
functions.push(peripheralFunction); functions.push(peripheralFunction);
} }
}
if (telemetryFunction.length > 0) { if (telemetryFunction.length > 0) {
googleAnalytics.sendEvent('Setting', 'Telemetry Protocol', telemetryFunction); googleAnalytics.sendEvent('Setting', 'Telemetry Protocol', telemetryFunction);

View file

@ -42,7 +42,7 @@ var mspHelper = (function (gui) {
'BLACKBOX': 7, 'BLACKBOX': 7,
'TELEMETRY_MAVLINK': 8, 'TELEMETRY_MAVLINK': 8,
'TELEMETRY_IBUS': 9, 'TELEMETRY_IBUS': 9,
'RUNCAM_SPLIT_CONTROL' : 10, 'RUNCAM_SPLIT_CONTROL' : 10
}; };
/** /**

View file

@ -17,7 +17,6 @@
<tr> <tr>
<td>Identifier</td> <td>Identifier</td>
<td>Data</td> <td>Data</td>
<td>Logging</td>
<td>Telemetry</td> <td>Telemetry</td>
<td>RX</td> <td>RX</td>
<td>GPS</td> <td>GPS</td>
@ -53,9 +52,6 @@
<td class="functionsCell-data"><select class="msp_baudrate"> <td class="functionsCell-data"><select class="msp_baudrate">
<!-- list generated here --> <!-- list generated here -->
</select></td> </select></td>
<td class="functionsCell-logging"><select class="blackbox_baudrate">
<!-- list generated here -->
</select></td>
<td class="functionsCell-telemetry"><select class="telemetry_baudrate"> <td class="functionsCell-telemetry"><select class="telemetry_baudrate">
<!-- list generated here --> <!-- list generated here -->
</select></td> </select></td>

View file

@ -4,7 +4,6 @@ TABS.ports = {};
TABS.ports.initialize = function (callback, scrollPosition) { TABS.ports.initialize = function (callback, scrollPosition) {
var board_definition = {}; var board_definition = {};
var isSupportPeripherals = semver.gte(CONFIG.flightControllerVersion, "1.7.3");
var functionRules = [ var functionRules = [
{name: 'MSP', groups: ['data', 'msp'], maxPorts: 2}, {name: 'MSP', groups: ['data', 'msp'], maxPorts: 2},
@ -14,7 +13,7 @@ TABS.ports.initialize = function (callback, scrollPosition) {
{name: 'TELEMETRY_SMARTPORT', groups: ['telemetry'], maxPorts: 1}, {name: 'TELEMETRY_SMARTPORT', groups: ['telemetry'], maxPorts: 1},
{name: 'TELEMETRY_LTM', groups: ['telemetry'], sharableWith: ['msp'], notSharableWith: ['blackbox'], maxPorts: 1}, {name: 'TELEMETRY_LTM', groups: ['telemetry'], sharableWith: ['msp'], notSharableWith: ['blackbox'], maxPorts: 1},
{name: 'RX_SERIAL', groups: ['rx'], maxPorts: 1}, {name: 'RX_SERIAL', groups: ['rx'], maxPorts: 1},
{name: 'BLACKBOX', groups: ['logging', 'blackbox'], sharableWith: ['msp'], notSharableWith: ['telemetry'], maxPorts: 1} {name: 'BLACKBOX', groups: ['peripherals'], sharableWith: ['msp'], notSharableWith: ['telemetry'], maxPorts: 1}
]; ];
if (semver.gte(CONFIG.flightControllerVersion, "1.2.0")) { if (semver.gte(CONFIG.flightControllerVersion, "1.2.0")) {
@ -36,9 +35,12 @@ TABS.ports.initialize = function (callback, scrollPosition) {
} }
// support configure RunCam Split // support configure RunCam Split
GUI.log('API version is ' + CONFIG.apiVersion); if (semver.gte(CONFIG.flightControllerVersion, "1.7.3")) {
if (isSupportPeripherals) { functionRules.push({
functionRules.push({ name: 'RUNCAM_SPLIT_CONTROL', groups: ['peripherals'], maxPorts: 1 }); name: 'RUNCAM_SPLIT_CONTROL',
groups: ['peripherals'],
maxPorts: 1 }
);
} }
for (var i = 0; i < functionRules.length; i++) { for (var i = 0; i < functionRules.length; i++) {
@ -128,30 +130,28 @@ TABS.ports.initialize = function (callback, scrollPosition) {
31: 'SOFTSERIAL2' 31: 'SOFTSERIAL2'
}; };
if (!isSupportPeripherals) { var i,
$('.peripherls-column').remove(); $elements;
$('.functionsCell-peripherals').remove();
$elements = $('select.gps_baudrate');
for (i = 0; i < gpsBaudRates.length; i++) {
$elements.append('<option value="' + gpsBaudRates[i] + '">' + gpsBaudRates[i] + '</option>');
} }
var gps_baudrate_e = $('select.gps_baudrate'); $elements = $('select.msp_baudrate');
for (var i = 0; i < gpsBaudRates.length; i++) { for (i = 0; i < mspBaudRates.length; i++) {
gps_baudrate_e.append('<option value="' + gpsBaudRates[i] + '">' + gpsBaudRates[i] + '</option>'); $elements.append('<option value="' + mspBaudRates[i] + '">' + mspBaudRates[i] + '</option>');
} }
var msp_baudrate_e = $('select.msp_baudrate'); $elements = $('select.telemetry_baudrate');
for (var i = 0; i < mspBaudRates.length; i++) {
msp_baudrate_e.append('<option value="' + mspBaudRates[i] + '">' + mspBaudRates[i] + '</option>');
}
var telemetry_baudrate_e = $('select.telemetry_baudrate');
var telemetryBaudRates = semver.gte(CONFIG.flightControllerVersion, "1.6.3") ? telemetryBaudRates_post1_6_3 : telemetryBaudRates_pre1_6_3; var telemetryBaudRates = semver.gte(CONFIG.flightControllerVersion, "1.6.3") ? telemetryBaudRates_post1_6_3 : telemetryBaudRates_pre1_6_3;
for (var i = 0; i < telemetryBaudRates.length; i++) { for (i = 0; i < telemetryBaudRates.length; i++) {
telemetry_baudrate_e.append('<option value="' + telemetryBaudRates[i] + '">' + telemetryBaudRates[i] + '</option>'); $elements.append('<option value="' + telemetryBaudRates[i] + '">' + telemetryBaudRates[i] + '</option>');
} }
var blackbox_baudrate_e = $('select.blackbox_baudrate'); $elements = $('select.blackbox_baudrate');
for (var i = 0; i < blackboxBaudRates.length; i++) { for (i = 0; i < blackboxBaudRates.length; i++) {
blackbox_baudrate_e.append('<option value="' + blackboxBaudRates[i] + '">' + blackboxBaudRates[i] + '</option>'); $elements.append('<option value="' + blackboxBaudRates[i] + '">' + blackboxBaudRates[i] + '</option>');
} }
var ports_e = $('.tab-ports .ports'); var ports_e = $('.tab-ports .ports');
@ -163,17 +163,10 @@ TABS.ports.initialize = function (callback, scrollPosition) {
port_configuration_e.data('serialPort', serialPort); port_configuration_e.data('serialPort', serialPort);
var msp_baudrate_e = port_configuration_e.find('select.msp_baudrate'); port_configuration_e.find('select.msp_baudrate').val(serialPort.msp_baudrate);
msp_baudrate_e.val(serialPort.msp_baudrate); port_configuration_e.find('select.telemetry_baudrate').val(serialPort.telemetry_baudrate);
port_configuration_e.find('select.gps_baudrate').val(serialPort.gps_baudrate);
var telemetry_baudrate_e = port_configuration_e.find('select.telemetry_baudrate'); port_configuration_e.find('select.blackbox_baudrate').val(serialPort.blackbox_baudrate);
telemetry_baudrate_e.val(serialPort.telemetry_baudrate);
var gps_baudrate_e = port_configuration_e.find('select.gps_baudrate');
gps_baudrate_e.val(serialPort.gps_baudrate);
var blackbox_baudrate_e = port_configuration_e.find('select.blackbox_baudrate');
blackbox_baudrate_e.val(serialPort.blackbox_baudrate);
port_configuration_e.find('.identifier').text(portIdentifierToNameMapping[serialPort.identifier]) port_configuration_e.find('.identifier').text(portIdentifierToNameMapping[serialPort.identifier])
@ -186,7 +179,7 @@ TABS.ports.initialize = function (callback, scrollPosition) {
var functions_e = $(port_configuration_e).find('.functionsCell-' + column); var functions_e = $(port_configuration_e).find('.functionsCell-' + column);
for (var i = 0; i < functionRules.length; i++) { for (i = 0; i < functionRules.length; i++) {
var functionRule = functionRules[i]; var functionRule = functionRules[i];
var functionName = functionRule.name; var functionName = functionRule.name;
@ -260,12 +253,10 @@ TABS.ports.initialize = function (callback, scrollPosition) {
functions.push(telemetryFunction); functions.push(telemetryFunction);
} }
if (isSupportPeripherals) {
var peripheralFunction = $(portConfiguration_e).find('select[name=function-peripherals]').val(); var peripheralFunction = $(portConfiguration_e).find('select[name=function-peripherals]').val();
if (peripheralFunction) { if (peripheralFunction) {
functions.push(peripheralFunction); functions.push(peripheralFunction);
} }
}
if (telemetryFunction.length > 0) { if (telemetryFunction.length > 0) {
googleAnalytics.sendEvent('Setting', 'Telemetry Protocol', telemetryFunction); googleAnalytics.sendEvent('Setting', 'Telemetry Protocol', telemetryFunction);