1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-25 09:15:49 +03:00

Merge pull request #1012 from mikeller/fix_blackbox_write_error

Added abort / error message when writing of downloaded blackbox log fails.
This commit is contained in:
Michael Keller 2018-05-04 21:48:13 +12:00 committed by GitHub
commit cbd4c30857
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -6,6 +6,9 @@
"message": "Betaflight Configurator", "message": "Betaflight Configurator",
"description": "Title of the application window, usually not translated" "description": "Title of the application window, usually not translated"
}, },
"error": {
"message": "Error: {{errorMessage}}"
},
"warningTitle": { "warningTitle": {
"message": "Warning" "message": "Warning"
}, },

View file

@ -5,6 +5,7 @@ var
TABS.onboard_logging = { TABS.onboard_logging = {
blockSize: 128, blockSize: 128,
writeError: false,
BLOCK_SIZE: 4096, BLOCK_SIZE: 4096,
VCP_BLOCK_SIZE_3_0: 512, VCP_BLOCK_SIZE_3_0: 512,
@ -409,7 +410,11 @@ TABS.onboard_logging.initialize = function (callback) {
mark_saving_dialog_done(startTime, nextAddress, totalBytesCompressed); mark_saving_dialog_done(startTime, nextAddress, totalBytesCompressed);
} }
} else { } else {
if (!self.writeError) {
mspHelper.dataflashRead(nextAddress, self.blockSize, onChunkRead); mspHelper.dataflashRead(nextAddress, self.blockSize, onChunkRead);
} else {
dismiss_saving_dialog();
}
} }
}; };
@ -459,9 +464,12 @@ TABS.onboard_logging.initialize = function (callback) {
fileEntry.createWriter(function (fileWriter) { fileEntry.createWriter(function (fileWriter) {
fileWriter.onerror = function (e) { fileWriter.onerror = function (e) {
GUI.log('<strong><span class="message-negative">' + i18n.getMessage('error', { errorMessage: e.target.error.message }) + '</span class="message-negative></strong>');
console.error(e); console.error(e);
// stop logging if the procedure was/is still running // stop logging if the procedure was/is still running
self.writeError = true;
}; };
onComplete(fileWriter); onComplete(fileWriter);