mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
Fix OSD stat elements (#3498)
This commit is contained in:
parent
256355201f
commit
fdb8c6b19c
2 changed files with 32 additions and 1 deletions
|
@ -5961,6 +5961,20 @@
|
|||
"osdDescStatMinRSNR": {
|
||||
"message": "Minimum RSNR value"
|
||||
},
|
||||
"osdTextStatBest3ConsecLaps": {
|
||||
"message": "Best 3 consecutive laps",
|
||||
"description": "One of the statistics that can be shown at the end of the flight in the OSD"
|
||||
},
|
||||
"osdDescStatBest3ConsecLaps": {
|
||||
"message": "Best 3 consecutive laps"
|
||||
},
|
||||
"osdTextStatBestLap": {
|
||||
"message": "Best lap",
|
||||
"description": "One of the statistics that can be shown at the end of the flight in the OSD"
|
||||
},
|
||||
"osdDescStatBestLap": {
|
||||
"message": "Best lap"
|
||||
},
|
||||
"osdTextStatUnknown": {
|
||||
"message": "Unknown $1",
|
||||
"description": "One of the statistics that can be shown at the end of the flight in the OSD"
|
||||
|
|
|
@ -7,7 +7,7 @@ import FC from "../fc";
|
|||
import MSP from "../msp";
|
||||
import MSPCodes from "../msp/MSPCodes";
|
||||
import PortHandler from "../port_handler";
|
||||
import CONFIGURATOR, { API_VERSION_1_42, API_VERSION_1_43, API_VERSION_1_44, API_VERSION_1_45 } from "../data_storage";
|
||||
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";
|
||||
import LogoManager from "../LogoManager";
|
||||
import { gui_log } from "../gui_log";
|
||||
import semver from "semver";
|
||||
|
@ -1682,6 +1682,16 @@ OSD.constants = {
|
|||
text: 'osdTextStatMinRSNR',
|
||||
desc: 'osdDescStatMinRSNR',
|
||||
},
|
||||
STAT_BEST_3_CONSEC_LAPS : {
|
||||
name: 'STAT_BEST_3_CONSEC_LAPS',
|
||||
text: 'osdTextStatBest3ConsecLaps',
|
||||
desc: 'osdDescStatBest3ConsecLaps',
|
||||
},
|
||||
STAT_BEST_LAP : {
|
||||
name: 'STAT_BEST_LAP',
|
||||
text: 'osdTextStatBestLap',
|
||||
desc: 'osdDescStatBestLap',
|
||||
},
|
||||
},
|
||||
ALL_WARNINGS: {
|
||||
ARMING_DISABLED: {
|
||||
|
@ -1979,6 +1989,13 @@ OSD.chooseFields = function() {
|
|||
]);
|
||||
}
|
||||
|
||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) {
|
||||
OSD.constants.STATISTIC_FIELDS = OSD.constants.STATISTIC_FIELDS.concat([
|
||||
F.STAT_BEST_3_CONSEC_LAPS,
|
||||
F.STAT_BEST_LAP,
|
||||
]);
|
||||
}
|
||||
|
||||
// Choose warnings
|
||||
// Nothing much to do here, I'm preempting there being new warnings
|
||||
F = OSD.constants.ALL_WARNINGS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue