Skip to content

Commit ad73674

Browse files
authored
Add custom osd msg support from external device (#4281)
Add custom osd msg support
1 parent 486b382 commit ad73674

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed

locales/en/messages.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5596,7 +5596,38 @@
55965596
"message": "ASL without decimals",
55975597
"description": "One of the variants of the altitude element of the OSD"
55985598
},
5599-
5599+
"osdTextElementCustomMsg0": {
5600+
"message": "Custom message 1",
5601+
"description": "One of the elements of the OSD"
5602+
},
5603+
"osdTextElementCustomMsg1": {
5604+
"message": "Custom message 2",
5605+
"description": "One of the elements of the OSD"
5606+
},
5607+
"osdTextElementCustomMsg2": {
5608+
"message": "Custom message 3",
5609+
"description": "One of the elements of the OSD"
5610+
},
5611+
"osdTextElementCustomMsg3": {
5612+
"message": "Custom message 4",
5613+
"description": "One of the elements of the OSD"
5614+
},
5615+
"osdDescElementCustomMsg0": {
5616+
"message": "Custom message 1 from external device",
5617+
"description": "Description of the custom message 1 element of the OSD"
5618+
},
5619+
"osdDescElementCustomMsg1": {
5620+
"message": "Custom message 2 from external device",
5621+
"description": "Description of the custom message 2 element of the OSD"
5622+
},
5623+
"osdDescElementCustomMsg2": {
5624+
"message": "Custom message 3 from external device",
5625+
"description": "Description of the custom message 3 element of the OSD"
5626+
},
5627+
"osdDescElementCustomMsg3": {
5628+
"message": "Custom message 4 from external device",
5629+
"description": "Description of the custom message 4 element of the OSD"
5630+
},
56005631
"osdTextElementOnTime": {
56015632
"message": "On time",
56025633
"description": "One of the elements of the OSD"

src/js/tabs/osd.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,6 +1522,42 @@ OSD.loadDisplayFields = function() {
15221522
positionable: true,
15231523
preview: 'DBG2 0 0 0 0',
15241524
},
1525+
CUSTOM_MSG0: {
1526+
name: 'CUSTOM_MSG1',
1527+
text: 'osdTextElementCustomMsg0',
1528+
desc: 'osdDescElementCustomMsg0',
1529+
defaultPosition: -1,
1530+
draw_order: 570,
1531+
positionable: true,
1532+
preview: 'CUSTOM MSG1',
1533+
},
1534+
CUSTOM_MSG1: {
1535+
name: 'CUSTOM_MSG2',
1536+
text: 'osdTextElementCustomMsg1',
1537+
desc: 'osdDescElementCustomMsg1',
1538+
defaultPosition: -1,
1539+
draw_order: 580,
1540+
positionable: true,
1541+
preview: 'CUSTOM MSG2',
1542+
},
1543+
CUSTOM_MSG2: {
1544+
name: 'CUSTOM_MSG3',
1545+
text: 'osdTextElementCustomMsg2',
1546+
desc: 'osdDescElementCustomMsg2',
1547+
defaultPosition: -1,
1548+
draw_order: 590,
1549+
positionable: true,
1550+
preview: 'CUSTOM MSG3',
1551+
},
1552+
CUSTOM_MSG3: {
1553+
name: 'CUSTOM_MSG4',
1554+
text: 'osdTextElementCustomMsg3',
1555+
desc: 'osdDescElementCustomMsg3',
1556+
defaultPosition: -1,
1557+
draw_order: 600,
1558+
positionable: true,
1559+
preview: 'CUSTOM MSG4',
1560+
},
15251561
};
15261562

15271563
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47) && have_sensor(FC.CONFIG.activeSensors, 'gps')) {
@@ -1972,6 +2008,10 @@ OSD.chooseFields = function() {
19722008
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
19732009
OSD.constants.DISPLAY_FIELDS = OSD.constants.DISPLAY_FIELDS.concat([
19742010
F.DEBUG2,
2011+
F.CUSTOM_MSG0,
2012+
F.CUSTOM_MSG1,
2013+
F.CUSTOM_MSG2,
2014+
F.CUSTOM_MSG3,
19752015
]);
19762016
}
19772017
// Choose statistic fields

0 commit comments

Comments
 (0)