Skip to content

Commit 501b95b

Browse files
demvladhaslinghuis
andauthored
Added virtual blackbox option for SITL firmwares build (#4409)
* Added virtual blackbox option for SITL firmwares build * Removed non english caption Co-authored-by: Mark Haslinghuis <[email protected]> * Removed non english caption Co-authored-by: Mark Haslinghuis <[email protected]> * Removed non english caption Co-authored-by: Mark Haslinghuis <[email protected]> * The comment is improved Co-authored-by: Mark Haslinghuis <[email protected]> * virtual blackbox item caption is changet at 'To File' --------- Co-authored-by: Mark Haslinghuis <[email protected]>
1 parent 4180448 commit 501b95b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

locales/en/messages.json

+3
Original file line numberDiff line numberDiff line change
@@ -3435,6 +3435,9 @@
34353435
"blackboxLoggingSerial": {
34363436
"message": "Serial Port"
34373437
},
3438+
"blackboxLoggingVirtual": {
3439+
"message": "To File"
3440+
},
34383441
"serialLoggingSupportedNote": {
34393442
"message": "You can log to an external logging device (such as an OpenLager) by using a serial port. Configure the port on the Ports tab."
34403443
},

src/js/tabs/onboard_logging.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { mspHelper } from "../msp/MSPHelper";
55
import FC from "../fc";
66
import MSP from "../msp";
77
import MSPCodes from "../msp/MSPCodes";
8-
import CONFIGURATOR, { API_VERSION_1_45 } from "../data_storage";
8+
import CONFIGURATOR, { API_VERSION_1_45, API_VERSION_1_47 } from "../data_storage";
99
import { gui_log } from "../gui_log";
1010
import { generateFilename } from "../utils/generate_filename";
1111
import semver from "semver";
@@ -16,6 +16,7 @@ import FileSystem from "../FileSystem";
1616
import { isExpertModeEnabled } from "../utils/isExportModeEnabled";
1717
import NotificationManager from "../../js/utils/notifications";
1818
import { get as getConfig } from "../ConfigStorage";
19+
import { sensorTypes } from "../sensor_types";
1920

2021
let sdcardTimer;
2122

@@ -197,6 +198,14 @@ onboard_logging.initialize = function (callback) {
197198
}
198199
deviceSelect.append(`<option value="3">${i18n.getMessage("blackboxLoggingSerial")}</option>`);
199200

201+
if (
202+
semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47) &&
203+
FC.SENSOR_CONFIG_ACTIVE.gyro_hardware == sensorTypes().gyro.elements.indexOf("VIRTUAL")
204+
) {
205+
// If the gyro sensor is virtual, it means SITL is built
206+
deviceSelect.append(`<option value="4">${i18n.getMessage("blackboxLoggingVirtual")}</option>`);
207+
}
208+
200209
deviceSelect.val(FC.BLACKBOX.blackboxDevice);
201210
}
202211

0 commit comments

Comments
 (0)