From 73aceb6a376abca6080857ef455133b0443edd19 Mon Sep 17 00:00:00 2001 From: Robert Cisneros Date: Fri, 1 Jan 2021 15:03:09 -0600 Subject: [PATCH 1/3] Added OSD Up/Down reference element Added control for OSD up/down reference to OSD tab. --- locales/en/messages.json | 8 +++++++- src/js/tabs/osd.js | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/locales/en/messages.json b/locales/en/messages.json index 424eca72..0a68de42 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -4965,7 +4965,13 @@ "osdDescTotalFlights": { "message": "Approximate total number of flights" }, - + "osdTextElementUpDownReference": { + "message": "Up (Pitch 90 deg)/Down (Pitch -90 deg) Reference", + "description": "OSD Symbol to show when pitch is approaching vertical (90 deg, U) and D for nose down (-90 deg, D)" + }, + "osdDescUpDownReference": { + "message": "OSD Symbol to show when pitch is approaching vertical (90 deg, U) and D for nose down (-90 deg, D)" + }, "osdTextElementUnknown": { "message": "Unknown $1", "description": "One of the elements of the OSD" diff --git a/src/js/tabs/osd.js b/src/js/tabs/osd.js index 7926e808..f96eb1b5 100644 --- a/src/js/tabs/osd.js +++ b/src/js/tabs/osd.js @@ -1181,6 +1181,21 @@ OSD.loadDisplayFields = function() { positionable: true, preview: "#9876", }, + UP_DOWN_REFERENCE: { + name: 'UP_DOWN_REFERENCE', + text: 'osdTextElementUpDownReference', + desc: 'osdDescUpDownReference', + defaultPosition() { + let position = 238; + if (OSD.constants.VIDEO_TYPES[OSD.data.video_system] !== 'NTSC') { + position += FONT.constants.SIZES.LINE; + } + return position; + }, + draw_order: 465, + positionable: true, + preview: 'U', + }, }; }; @@ -1602,6 +1617,7 @@ OSD.chooseFields = function() { if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) { OSD.constants.DISPLAY_FIELDS = OSD.constants.DISPLAY_FIELDS.concat([ F.TOTAL_FLIGHTS, + F.UP_DOWN_REFERENCE, ]); } } From 56fec5cbec73bdae4cb6a97120e4e4d694a20b19 Mon Sep 17 00:00:00 2001 From: Robert Cisneros Date: Sat, 13 Feb 2021 22:25:47 -0600 Subject: [PATCH 2/3] Code correction to OSD_UP_DOWN_REFERENCE logic. Corrected OSD_UP_DOWN_REFERENCE label to be consistent with Betaflight. Simplified preview logic to show symbol centered. --- src/js/tabs/osd.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/tabs/osd.js b/src/js/tabs/osd.js index f96eb1b5..b87a3efc 100644 --- a/src/js/tabs/osd.js +++ b/src/js/tabs/osd.js @@ -1181,8 +1181,8 @@ OSD.loadDisplayFields = function() { positionable: true, preview: "#9876", }, - UP_DOWN_REFERENCE: { - name: 'UP_DOWN_REFERENCE', + OSD_UP_DOWN_REFERENCE: { + name: 'OSD_UP_DOWN_REFERENCE', text: 'osdTextElementUpDownReference', desc: 'osdDescUpDownReference', defaultPosition() { @@ -1194,7 +1194,7 @@ OSD.loadDisplayFields = function() { }, draw_order: 465, positionable: true, - preview: 'U', + preview: 'U' }, }; }; @@ -1617,7 +1617,7 @@ OSD.chooseFields = function() { if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) { OSD.constants.DISPLAY_FIELDS = OSD.constants.DISPLAY_FIELDS.concat([ F.TOTAL_FLIGHTS, - F.UP_DOWN_REFERENCE, + F.OSD_UP_DOWN_REFERENCE, ]); } } From 42c9703b958c15cc199fbf1995fe01fc76c0fcee Mon Sep 17 00:00:00 2001 From: Robert Cisneros Date: Mon, 15 Feb 2021 21:17:07 -0600 Subject: [PATCH 3/3] Removed video format dependency of up/down reference indication Removed relationship between video format and the default position for the up down reference indication. --- src/js/tabs/osd.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/js/tabs/osd.js b/src/js/tabs/osd.js index b87a3efc..f5046fe1 100644 --- a/src/js/tabs/osd.js +++ b/src/js/tabs/osd.js @@ -1185,16 +1185,10 @@ OSD.loadDisplayFields = function() { name: 'OSD_UP_DOWN_REFERENCE', text: 'osdTextElementUpDownReference', desc: 'osdDescUpDownReference', - defaultPosition() { - let position = 238; - if (OSD.constants.VIDEO_TYPES[OSD.data.video_system] !== 'NTSC') { - position += FONT.constants.SIZES.LINE; - } - return position; - }, + defaultPosition: 238, draw_order: 465, positionable: true, - preview: 'U' + preview: 'U', }, }; };