Skip to content

Commit

Permalink
Add DEBUG2 OSD element (#4124)
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis authored Aug 13, 2024
1 parent d8fcab2 commit 43f3996
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -5605,6 +5605,13 @@
"osdDescElementDebug": {
"message": "Debug variables"
},
"osdTextElementDebug2": {
"message": "Debug2",
"description": "One of the elements of the OSD"
},
"osdDescElementDebug2": {
"message": "Debug variables for debug 4-7"
},
"osdTextElementPIDRoll": {
"message": "PID roll",
"description": "One of the elements of the OSD"
Expand Down
14 changes: 14 additions & 0 deletions src/js/tabs/osd.js
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,15 @@ OSD.loadDisplayFields = function() {
positionable: true,
preview: '1:23.456',
},
DEBUG2: {
name: 'DEBUG2',
text: 'osdTextElementDebug2',
desc: 'osdDescElementDebug2',
defaultPosition: -1,
draw_order: 560,
positionable: true,
preview: 'DBG2 0 0 0 0',
},
};

if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47) && have_sensor(FC.CONFIG.activeSensors, 'gps')) {
Expand Down Expand Up @@ -1960,6 +1969,11 @@ OSD.chooseFields = function() {
]);
}

if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
OSD.constants.DISPLAY_FIELDS = OSD.constants.DISPLAY_FIELDS.concat([
F.DEBUG2,
]);
}
// Choose statistic fields
// Nothing much to do here, I'm preempting there being new statistics
F = OSD.constants.ALL_STATISTIC_FIELDS;
Expand Down

0 comments on commit 43f3996

Please sign in to comment.