Skip to content

Commit fdb8c6b

Browse files
authored
Fix OSD stat elements (#3498)
1 parent 2563552 commit fdb8c6b

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

locales/en/messages.json

+14
Original file line numberDiff line numberDiff line change
@@ -5961,6 +5961,20 @@
59615961
"osdDescStatMinRSNR": {
59625962
"message": "Minimum RSNR value"
59635963
},
5964+
"osdTextStatBest3ConsecLaps": {
5965+
"message": "Best 3 consecutive laps",
5966+
"description": "One of the statistics that can be shown at the end of the flight in the OSD"
5967+
},
5968+
"osdDescStatBest3ConsecLaps": {
5969+
"message": "Best 3 consecutive laps"
5970+
},
5971+
"osdTextStatBestLap": {
5972+
"message": "Best lap",
5973+
"description": "One of the statistics that can be shown at the end of the flight in the OSD"
5974+
},
5975+
"osdDescStatBestLap": {
5976+
"message": "Best lap"
5977+
},
59645978
"osdTextStatUnknown": {
59655979
"message": "Unknown $1",
59665980
"description": "One of the statistics that can be shown at the end of the flight in the OSD"

src/js/tabs/osd.js

+18-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import FC from "../fc";
77
import MSP from "../msp";
88
import MSPCodes from "../msp/MSPCodes";
99
import PortHandler from "../port_handler";
10-
import CONFIGURATOR, { API_VERSION_1_42, API_VERSION_1_43, API_VERSION_1_44, API_VERSION_1_45 } from "../data_storage";
10+
import CONFIGURATOR, { API_VERSION_1_42, API_VERSION_1_43, API_VERSION_1_44, API_VERSION_1_45, API_VERSION_1_46 } from "../data_storage";
1111
import LogoManager from "../LogoManager";
1212
import { gui_log } from "../gui_log";
1313
import semver from "semver";
@@ -1682,6 +1682,16 @@ OSD.constants = {
16821682
text: 'osdTextStatMinRSNR',
16831683
desc: 'osdDescStatMinRSNR',
16841684
},
1685+
STAT_BEST_3_CONSEC_LAPS : {
1686+
name: 'STAT_BEST_3_CONSEC_LAPS',
1687+
text: 'osdTextStatBest3ConsecLaps',
1688+
desc: 'osdDescStatBest3ConsecLaps',
1689+
},
1690+
STAT_BEST_LAP : {
1691+
name: 'STAT_BEST_LAP',
1692+
text: 'osdTextStatBestLap',
1693+
desc: 'osdDescStatBestLap',
1694+
},
16851695
},
16861696
ALL_WARNINGS: {
16871697
ARMING_DISABLED: {
@@ -1979,6 +1989,13 @@ OSD.chooseFields = function() {
19791989
]);
19801990
}
19811991

1992+
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) {
1993+
OSD.constants.STATISTIC_FIELDS = OSD.constants.STATISTIC_FIELDS.concat([
1994+
F.STAT_BEST_3_CONSEC_LAPS,
1995+
F.STAT_BEST_LAP,
1996+
]);
1997+
}
1998+
19821999
// Choose warnings
19832000
// Nothing much to do here, I'm preempting there being new warnings
19842001
F = OSD.constants.ALL_WARNINGS;

0 commit comments

Comments
 (0)