Change the extension of blackbox saved files to BBL and add as prefix

the flight controller identifier.
10.3.x-maintenance
Miguel 2017-04-11 13:10:26 +02:00 committed by Michael Keller
parent 780451cd38
commit 445b9931bb
4 changed files with 11 additions and 5 deletions

View File

@ -161,7 +161,7 @@ function configuration_backup(callback) {
function save() { function save() {
var chosenFileEntry = null; var chosenFileEntry = null;
var prefix = CONFIG.flightControllerIdentifier + '_backup'; var prefix = 'backup';
var suffix = 'json'; var suffix = 'json';
var filename = generateFilename(prefix, suffix); var filename = generateFilename(prefix, suffix);

View File

@ -493,8 +493,13 @@ function generateFilename(prefix, suffix) {
var date = new Date(); var date = new Date();
var filename = prefix; var filename = prefix;
if (CONFIG && CONFIG.name && CONFIG.name.trim() !== '') { if (CONFIG) {
filename = filename + '_' + CONFIG.name.trim().replace(' ', '_'); if (CONFIG.flightControllerIdentifier) {
filename = CONFIG.flightControllerIdentifier + '_' + filename;
}
if(CONFIG.name && CONFIG.name.trim() !== '') {
filename = filename + '_' + CONFIG.name.trim().replace(' ', '_');
}
} }
filename = filename + '_' + date.getFullYear() filename = filename + '_' + date.getFullYear()

View File

@ -230,7 +230,7 @@ TABS.logging.initialize = function (callback) {
function prepare_file() { function prepare_file() {
var prefix = CONFIG.flightControllerIdentifier + '_log'; var prefix = 'log';
var suffix = 'csv'; var suffix = 'csv';
var filename = generateFilename(prefix, suffix); var filename = generateFilename(prefix, suffix);

View File

@ -392,8 +392,9 @@ TABS.onboard_logging.initialize = function (callback) {
} }
function prepare_file(onComplete) { function prepare_file(onComplete) {
var suffix = 'BFL';
var prefix = 'BLACKBOX_LOG'; var prefix = 'BLACKBOX_LOG';
var suffix = 'BBL';
var filename = generateFilename(prefix, suffix); var filename = generateFilename(prefix, suffix);