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": {
|
"blackboxButtonSave": {
|
||||||
"message": "Save and reboot"
|
"message": "Save and reboot"
|
||||||
},
|
},
|
||||||
|
"blackboxLoggingNone": {
|
||||||
|
"message": "No Logging"
|
||||||
|
},
|
||||||
|
"blackboxLoggingFlash": {
|
||||||
|
"message": "Onboard Flash"
|
||||||
|
},
|
||||||
|
"blackboxLoggingSdCard": {
|
||||||
|
"message": "SD Card"
|
||||||
|
},
|
||||||
|
"blackboxLoggingSerial": {
|
||||||
|
"message": "Serial Port"
|
||||||
|
},
|
||||||
|
|
||||||
"serialLoggingSupportedNote": {
|
"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."
|
"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: 14, group: 'rxMode', mode: 'select', name: 'RX_MSP'},
|
||||||
{bit: 15, group: 'rssi', name: 'RSSI_ADC'},
|
{bit: 15, group: 'rssi', name: 'RSSI_ADC'},
|
||||||
{bit: 16, group: 'other', name: 'LED_STRIP'},
|
{bit: 16, group: 'other', name: 'LED_STRIP'},
|
||||||
{bit: 17, group: 'other', name: 'DISPLAY', haveTip: true},
|
{bit: 17, group: 'other', name: 'DISPLAY', haveTip: true}
|
||||||
{bit: 19, group: 'other', name: 'BLACKBOX', 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")) {
|
if (semver.gte(config.apiVersion, "1.12.0")) {
|
||||||
features.push(
|
features.push(
|
||||||
{bit: 20, group: 'other', name: 'CHANNEL_FORWARDING'}
|
{bit: 20, group: 'other', name: 'CHANNEL_FORWARDING'}
|
||||||
|
@ -58,7 +63,7 @@ var Features = function (config) {
|
||||||
features.push(
|
features.push(
|
||||||
{bit: 23, group: 'pidTuning', name: 'SUPEREXPO_RATES'}
|
{bit: 23, group: 'pidTuning', name: 'SUPEREXPO_RATES'}
|
||||||
);
|
);
|
||||||
} else {
|
} else if (!semver.gte(config.apiVersion, "1.33.0")) {
|
||||||
features.push(
|
features.push(
|
||||||
{bit: 23, group: 'other', name: 'SDCARD'}
|
{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();
|
$('#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')) {
|
if (features.isEnabled('TRANSPONDER')) {
|
||||||
$('#tabs ul.mode-connected li.tab_transponder').show();
|
$('#tabs ul.mode-connected li.tab_transponder').show();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -16,7 +16,7 @@ TABS.onboard_logging.initialize = function (callback) {
|
||||||
self = this,
|
self = this,
|
||||||
saveCancelled, eraseCancelled;
|
saveCancelled, eraseCancelled;
|
||||||
|
|
||||||
if (GUI.active_tab != 'onboard_logging') {
|
if (GUI.active_tab !== 'onboard_logging') {
|
||||||
GUI.active_tab = 'onboard_logging';
|
GUI.active_tab = 'onboard_logging';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ TABS.onboard_logging.initialize = function (callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function gcd(a, b) {
|
function gcd(a, b) {
|
||||||
if (b == 0)
|
if (b === 0)
|
||||||
return a;
|
return a;
|
||||||
|
|
||||||
return gcd(b, a % b);
|
return gcd(b, a % b);
|
||||||
|
@ -125,9 +125,9 @@ TABS.onboard_logging.initialize = function (callback) {
|
||||||
.toggleClass("sdcard-supported", SDCARD.supported)
|
.toggleClass("sdcard-supported", SDCARD.supported)
|
||||||
.toggleClass("blackbox-config-supported", BLACKBOX.supported)
|
.toggleClass("blackbox-config-supported", BLACKBOX.supported)
|
||||||
|
|
||||||
.toggleClass("blackbox-supported", blackboxSupport == 'yes')
|
.toggleClass("blackbox-supported", blackboxSupport === 'yes')
|
||||||
.toggleClass("blackbox-maybe-supported", blackboxSupport == 'maybe')
|
.toggleClass("blackbox-maybe-supported", blackboxSupport === 'maybe')
|
||||||
.toggleClass("blackbox-unsupported", blackboxSupport == 'no');
|
.toggleClass("blackbox-unsupported", blackboxSupport === 'no');
|
||||||
|
|
||||||
if (dataflashPresent) {
|
if (dataflashPresent) {
|
||||||
// UI hooks
|
// UI hooks
|
||||||
|
@ -163,17 +163,17 @@ TABS.onboard_logging.initialize = function (callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function populateDevices() {
|
function populateDevices() {
|
||||||
var
|
var deviceSelect = $(".blackboxDevice select").empty();
|
||||||
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) {
|
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) {
|
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);
|
deviceSelect.val(BLACKBOX.blackboxDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,17 +191,16 @@ TABS.onboard_logging.initialize = function (callback) {
|
||||||
{num: 1, denom: 7},
|
{num: 1, denom: 7},
|
||||||
{num: 1, denom: 8},
|
{num: 1, denom: 8},
|
||||||
{num: 1, denom: 16},
|
{num: 1, denom: 16},
|
||||||
{num: 1, denom: 32},
|
{num: 1, denom: 32}
|
||||||
],
|
],
|
||||||
loggingRatesSelect = $(".blackboxRate select");
|
loggingRatesSelect = $(".blackboxRate select");
|
||||||
|
|
||||||
var addedCurrentValue = false;
|
|
||||||
var pidRate = 8000 / PID_ADVANCED_CONFIG.gyro_sync_denom / PID_ADVANCED_CONFIG.pid_process_denom;
|
var pidRate = 8000 / PID_ADVANCED_CONFIG.gyro_sync_denom / PID_ADVANCED_CONFIG.pid_process_denom;
|
||||||
for (var i = 0; i < loggingRates.length; i++) {
|
for (var i = 0; i < loggingRates.length; i++) {
|
||||||
var loggingRate = Math.round(pidRate / loggingRates[i].denom);
|
var loggingRate = Math.round(pidRate / loggingRates[i].denom);
|
||||||
var loggingRateUnit = " Hz";
|
var loggingRateUnit = " Hz";
|
||||||
if (loggingRate != Infinity) {
|
if (loggingRate !== Infinity) {
|
||||||
if (gcd(loggingRate, 1000)==1000) {
|
if (gcd(loggingRate, 1000) === 1000) {
|
||||||
loggingRate /= 1000;
|
loggingRate /= 1000;
|
||||||
loggingRateUnit = " KHz";
|
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-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);
|
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")
|
$(".tab-onboard_logging")
|
||||||
.toggleClass("sdcard-error", SDCARD.state == MSP.SDCARD_STATE_FATAL)
|
.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-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-ready", SDCARD.state === MSP.SDCARD_STATE_READY);
|
||||||
|
|
||||||
switch (SDCARD.state) {
|
switch (SDCARD.state) {
|
||||||
case MSP.SDCARD_STATE_NOT_PRESENT:
|
case MSP.SDCARD_STATE_NOT_PRESENT:
|
||||||
|
@ -358,7 +357,7 @@ TABS.onboard_logging.initialize = function (callback) {
|
||||||
show_saving_dialog();
|
show_saving_dialog();
|
||||||
|
|
||||||
function onChunkRead(chunkAddress, chunkDataView) {
|
function onChunkRead(chunkAddress, chunkDataView) {
|
||||||
if (chunkDataView != null) {
|
if (chunkDataView !== null) {
|
||||||
// Did we receive any data?
|
// Did we receive any data?
|
||||||
if (chunkDataView.byteLength > 0) {
|
if (chunkDataView.byteLength > 0) {
|
||||||
nextAddress += chunkDataView.byteLength;
|
nextAddress += chunkDataView.byteLength;
|
||||||
|
@ -411,7 +410,7 @@ TABS.onboard_logging.initialize = function (callback) {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(error.message);
|
console.error(error.message);
|
||||||
|
|
||||||
if (error.message != "User cancelled") {
|
if (error.message !== "User cancelled") {
|
||||||
GUI.log(chrome.i18n.getMessage('dataflashFileWriteFailed'));
|
GUI.log(chrome.i18n.getMessage('dataflashFileWriteFailed'));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue