From d677a86a99286b348ae9d326e11f43939d781375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=ADguel=20=C3=81ngel=20Mulero=20Mart=C3=ADnez?= Date: Tue, 11 Jun 2024 18:55:11 +0200 Subject: [PATCH] Add CPU LOAD warning to the OSD tab (#4021) --- locales/en/messages.json | 9 +++++++++ src/js/tabs/osd.js | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/locales/en/messages.json b/locales/en/messages.json index dadb73d390..2a69a3c498 100755 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -6422,6 +6422,15 @@ "osdWarningRSNR": { "message": "Warns when RSNR value is below alarm setting" }, + "osdWarningTextLoad": { + "message": "LOAD", + "description": "One of the warnings that can be selected to be shown in the OSD" + }, + "osdWarningLoad": { + "message": "Warns if the CPU LOAD of the flight controller is too high", + "description": "Description of one of the warnings that can be selected to be shown in the OSD" + }, + "osdWarningTextUnknown": { "message": "Unknown $1" }, diff --git a/src/js/tabs/osd.js b/src/js/tabs/osd.js index 241841557f..c92478fc7f 100644 --- a/src/js/tabs/osd.js +++ b/src/js/tabs/osd.js @@ -1827,6 +1827,11 @@ OSD.constants = { text: 'osdWarningTextRSNR', desc: 'osdWarningRSNR', }, + LOAD: { + name: 'LOAD', + text: 'osdWarningTextLoad', + desc: 'osdWarningLoad', + }, }, FONT_TYPES: [ @@ -2096,6 +2101,11 @@ OSD.chooseFields = function() { F.RSNR, ]); } + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) { + OSD.constants.WARNINGS = OSD.constants.WARNINGS.concat([ + F.LOAD, + ]); + } }; OSD.updateDisplaySize = function() {