From 22439528fc6370da70a4910c14c51b90f798babb Mon Sep 17 00:00:00 2001 From: Miguel Angel Mulero Martinez Date: Tue, 3 Apr 2018 19:58:02 +0200 Subject: [PATCH] Add OSD statistic battery --- locales/en/messages.json | 4 ++++ src/js/tabs/osd.js | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/locales/en/messages.json b/locales/en/messages.json index 2f724e25..d4fd8d97 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -3274,6 +3274,10 @@ "osdDescStatRtcDateTime": { "message": "Date and time from real time clock" }, + "osdDescStatBattery": { + "message": "Voltage of the battery in real time" + }, + "osdTimerSource": { "message": "Source:" diff --git a/src/js/tabs/osd.js b/src/js/tabs/osd.js index ce9a0b03..d75f74cf 100755 --- a/src/js/tabs/osd.js +++ b/src/js/tabs/osd.js @@ -883,6 +883,10 @@ OSD.constants = { RTC_DATE_TIME: { name: 'RTC_DATE_TIME', desc: 'osdDescStatRtcDateTime' + }, + STAT_BATTERY: { + name: 'STAT_BATTERY', + desc: 'osdDescStatBattery' } }, ALL_WARNINGS: { @@ -1050,6 +1054,11 @@ OSD.chooseFields = function () { OSD.constants.STATISTIC_FIELDS = OSD.constants.STATISTIC_FIELDS.concat([ F.RTC_DATE_TIME ]); + if (semver.gte(CONFIG.apiVersion, "1.38.0")) { + OSD.constants.STATISTIC_FIELDS = OSD.constants.STATISTIC_FIELDS.concat([ + F.STAT_BATTERY + ]); + } } // Choose warnings