From fb440fcaedd5d9fb5f9d0cd1a23fd4d3ab84ecbf Mon Sep 17 00:00:00 2001 From: timman2er Date: Tue, 25 Sep 2018 15:33:04 +0200 Subject: [PATCH] add support for max esc temp and rpm (rebase) --- locales/en/messages.json | 6 ++++++ src/js/tabs/osd.js | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/locales/en/messages.json b/locales/en/messages.json index 5a1fb045..ce0500ba 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -3572,6 +3572,12 @@ "osdDescStatGForce": { "message": "Max G-Force experienced by the craft" }, + "osdDescStatEscTemperature": { + "message": "Max ESC temperature" + }, + "osdDescStatEscRpm": { + "message": "Max ESC RPM" + }, "osdTimerSource": { diff --git a/src/js/tabs/osd.js b/src/js/tabs/osd.js index 6277d827..3dbaadbc 100755 --- a/src/js/tabs/osd.js +++ b/src/js/tabs/osd.js @@ -893,6 +893,14 @@ OSD.constants = { MAX_G_FORCE: { name: 'MAX_G_FORCE', desc: 'osdDescStatGForce' + }, + MAX_ESC_TEMP: { + name: 'MAX_ESC_TEMP', + desc: 'osdDescStatEscTemperature' + }, + MAX_ESC_RPM: { + name: 'MAX_ESC_RPM', + desc: 'osdDescStatEscRpm' } }, ALL_WARNINGS: { @@ -1107,6 +1115,12 @@ OSD.chooseFields = function () { F.RTC_DATE_TIME ]); } + if (semver.gte(CONFIG.apiVersion, "1.41.0")) { + OSD.constants.STATISTIC_FIELDS = OSD.constants.STATISTIC_FIELDS.concat([ + F.MAX_ESC_TEMP, + F.MAX_ESC_RPM + ]); + } } else { // Starting with 1.39.0 OSD stats are reordered to match how they're presented on screen OSD.constants.STATISTIC_FIELDS = [ F.RTC_DATE_TIME, @@ -1123,7 +1137,9 @@ OSD.chooseFields = function () { F.MAX_ALTITUDE, F.BLACKBOX, F.BLACKBOX_LOG_NUMBER, - F.MAX_G_FORCE + F.MAX_G_FORCE, + F.MAX_ESC_TEMP, + F.MAX_ESC_RPM ]; }