mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-25 17:25:16 +03:00
Removed 'BLACKBOX' and 'SDCARD' features.
This commit is contained in:
parent
d2751c53db
commit
eab725ea59
4 changed files with 41 additions and 31 deletions
|
@ -1380,6 +1380,18 @@
|
|||
"blackboxButtonSave": {
|
||||
"message": "Save and reboot"
|
||||
},
|
||||
"blackboxLoggingNone": {
|
||||
"message": "No Logging"
|
||||
},
|
||||
"blackboxLoggingFlash": {
|
||||
"message": "Onboard Flash"
|
||||
},
|
||||
"blackboxLoggingSdCard": {
|
||||
"message": "SD Card"
|
||||
},
|
||||
"blackboxLoggingSerial": {
|
||||
"message": "Serial Port"
|
||||
},
|
||||
|
||||
"serialLoggingSupportedNote": {
|
||||
"message": "You can log to an external logging device (such as an OpenLog or compatible clone) by using a serial port. Configure the port on the Ports tab."
|
||||
|
|
|
@ -20,10 +20,15 @@ var Features = function (config) {
|
|||
{bit: 14, group: 'rxMode', mode: 'select', name: 'RX_MSP'},
|
||||
{bit: 15, group: 'rssi', name: 'RSSI_ADC'},
|
||||
{bit: 16, group: 'other', name: 'LED_STRIP'},
|
||||
{bit: 17, group: 'other', name: 'DISPLAY', haveTip: true},
|
||||
{bit: 19, group: 'other', name: 'BLACKBOX', haveTip: true}
|
||||
{bit: 17, group: 'other', name: 'DISPLAY', haveTip: true}
|
||||
];
|
||||
|
||||
if (!semver.gte(config.apiVersion, "1.33.0")) {
|
||||
features.push(
|
||||
{bit: 19, group: 'other', name: 'BLACKBOX', haveTip: true}
|
||||
);
|
||||
}
|
||||
|
||||
if (semver.gte(config.apiVersion, "1.12.0")) {
|
||||
features.push(
|
||||
{bit: 20, group: 'other', name: 'CHANNEL_FORWARDING'}
|
||||
|
@ -58,7 +63,7 @@ var Features = function (config) {
|
|||
features.push(
|
||||
{bit: 23, group: 'pidTuning', name: 'SUPEREXPO_RATES'}
|
||||
);
|
||||
} else {
|
||||
} else if (!semver.gte(config.apiVersion, "1.33.0")) {
|
||||
features.push(
|
||||
{bit: 23, group: 'other', name: 'SDCARD'}
|
||||
);
|
||||
|
|
6
main.js
6
main.js
|
@ -458,12 +458,6 @@ function updateTabList(features) {
|
|||
$('#tabs ul.mode-connected li.tab_logging').hide();
|
||||
}
|
||||
|
||||
if (features.isEnabled('BLACKBOX')) {
|
||||
$('#tabs ul.mode-connected li.tab_onboard_logging').show();
|
||||
} else {
|
||||
$('#tabs ul.mode-connected li.tab_onboard_logging').hide();
|
||||
}
|
||||
|
||||
if (features.isEnabled('TRANSPONDER')) {
|
||||
$('#tabs ul.mode-connected li.tab_transponder').show();
|
||||
} else {
|
||||
|
|
|
@ -16,7 +16,7 @@ TABS.onboard_logging.initialize = function (callback) {
|
|||
self = this,
|
||||
saveCancelled, eraseCancelled;
|
||||
|
||||
if (GUI.active_tab != 'onboard_logging') {
|
||||
if (GUI.active_tab !== 'onboard_logging') {
|
||||
GUI.active_tab = 'onboard_logging';
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ TABS.onboard_logging.initialize = function (callback) {
|
|||
}
|
||||
|
||||
function gcd(a, b) {
|
||||
if (b == 0)
|
||||
if (b === 0)
|
||||
return a;
|
||||
|
||||
return gcd(b, a % b);
|
||||
|
@ -125,9 +125,9 @@ TABS.onboard_logging.initialize = function (callback) {
|
|||
.toggleClass("sdcard-supported", SDCARD.supported)
|
||||
.toggleClass("blackbox-config-supported", BLACKBOX.supported)
|
||||
|
||||
.toggleClass("blackbox-supported", blackboxSupport == 'yes')
|
||||
.toggleClass("blackbox-maybe-supported", blackboxSupport == 'maybe')
|
||||
.toggleClass("blackbox-unsupported", blackboxSupport == 'no');
|
||||
.toggleClass("blackbox-supported", blackboxSupport === 'yes')
|
||||
.toggleClass("blackbox-maybe-supported", blackboxSupport === 'maybe')
|
||||
.toggleClass("blackbox-unsupported", blackboxSupport === 'no');
|
||||
|
||||
if (dataflashPresent) {
|
||||
// UI hooks
|
||||
|
@ -163,17 +163,17 @@ TABS.onboard_logging.initialize = function (callback) {
|
|||
}
|
||||
|
||||
function populateDevices() {
|
||||
var
|
||||
deviceSelect = $(".blackboxDevice select").empty();
|
||||
var deviceSelect = $(".blackboxDevice select").empty();
|
||||
|
||||
deviceSelect.append('<option value="0">Serial port</option>');
|
||||
deviceSelect.append('<option value="0">' + chrome.i18n.getMessage('blackboxLoggingNone') + '</option>');
|
||||
if (DATAFLASH.ready) {
|
||||
deviceSelect.append('<option value="1">On-board dataflash chip</option>');
|
||||
deviceSelect.append('<option value="1">' + chrome.i18n.getMessage('blackboxLoggingFlash') + '</option>');
|
||||
}
|
||||
if (SDCARD.supported) {
|
||||
deviceSelect.append('<option value="2">On-board SD card slot</option>');
|
||||
deviceSelect.append('<option value="2">' + chrome.i18n.getMessage('blackboxLoggingSdCard') + '</option>');
|
||||
}
|
||||
|
||||
deviceSelect.append('<option value="3">' + chrome.i18n.getMessage('blackboxLoggingSerial') + '</option>');
|
||||
|
||||
deviceSelect.val(BLACKBOX.blackboxDevice);
|
||||
}
|
||||
|
||||
|
@ -191,17 +191,16 @@ TABS.onboard_logging.initialize = function (callback) {
|
|||
{num: 1, denom: 7},
|
||||
{num: 1, denom: 8},
|
||||
{num: 1, denom: 16},
|
||||
{num: 1, denom: 32},
|
||||
{num: 1, denom: 32}
|
||||
],
|
||||
loggingRatesSelect = $(".blackboxRate select");
|
||||
|
||||
var addedCurrentValue = false;
|
||||
|
||||
var pidRate = 8000 / PID_ADVANCED_CONFIG.gyro_sync_denom / PID_ADVANCED_CONFIG.pid_process_denom;
|
||||
for (var i = 0; i < loggingRates.length; i++) {
|
||||
var loggingRate = Math.round(pidRate / loggingRates[i].denom);
|
||||
var loggingRateUnit = " Hz";
|
||||
if (loggingRate != Infinity) {
|
||||
if (gcd(loggingRate, 1000)==1000) {
|
||||
if (loggingRate !== Infinity) {
|
||||
if (gcd(loggingRate, 1000) === 1000) {
|
||||
loggingRate /= 1000;
|
||||
loggingRateUnit = " KHz";
|
||||
}
|
||||
|
@ -260,12 +259,12 @@ TABS.onboard_logging.initialize = function (callback) {
|
|||
update_bar_width($(".tab-onboard_logging .sdcard-other"), SDCARD.totalSizeKB - SDCARD.freeSizeKB, SDCARD.totalSizeKB, "Unavailable space", true);
|
||||
update_bar_width($(".tab-onboard_logging .sdcard-free"), SDCARD.freeSizeKB, SDCARD.totalSizeKB, "Free space for logs", true);
|
||||
|
||||
$(".btn a.erase-flash, .btn a.save-flash").toggleClass("disabled", DATAFLASH.usedSize == 0);
|
||||
$(".btn a.erase-flash, .btn a.save-flash").toggleClass("disabled", DATAFLASH.usedSize === 0);
|
||||
|
||||
$(".tab-onboard_logging")
|
||||
.toggleClass("sdcard-error", SDCARD.state == MSP.SDCARD_STATE_FATAL)
|
||||
.toggleClass("sdcard-initializing", SDCARD.state == MSP.SDCARD_STATE_CARD_INIT || SDCARD.state == MSP.SDCARD_STATE_FS_INIT)
|
||||
.toggleClass("sdcard-ready", SDCARD.state == MSP.SDCARD_STATE_READY);
|
||||
.toggleClass("sdcard-error", SDCARD.state === MSP.SDCARD_STATE_FATAL)
|
||||
.toggleClass("sdcard-initializing", SDCARD.state === MSP.SDCARD_STATE_CARD_INIT || SDCARD.state === MSP.SDCARD_STATE_FS_INIT)
|
||||
.toggleClass("sdcard-ready", SDCARD.state === MSP.SDCARD_STATE_READY);
|
||||
|
||||
switch (SDCARD.state) {
|
||||
case MSP.SDCARD_STATE_NOT_PRESENT:
|
||||
|
@ -358,7 +357,7 @@ TABS.onboard_logging.initialize = function (callback) {
|
|||
show_saving_dialog();
|
||||
|
||||
function onChunkRead(chunkAddress, chunkDataView) {
|
||||
if (chunkDataView != null) {
|
||||
if (chunkDataView !== null) {
|
||||
// Did we receive any data?
|
||||
if (chunkDataView.byteLength > 0) {
|
||||
nextAddress += chunkDataView.byteLength;
|
||||
|
@ -411,7 +410,7 @@ TABS.onboard_logging.initialize = function (callback) {
|
|||
if (error) {
|
||||
console.error(error.message);
|
||||
|
||||
if (error.message != "User cancelled") {
|
||||
if (error.message !== "User cancelled") {
|
||||
GUI.log(chrome.i18n.getMessage('dataflashFileWriteFailed'));
|
||||
}
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue