OSD: allow configuring post flight odometer stats

10.7.0-preview
Krzysztof Matula 2019-04-15 21:05:29 +02:00
parent 2c7d47bbdc
commit 40965d4ab1
2 changed files with 28 additions and 0 deletions

View File

@ -3899,6 +3899,15 @@
"osdDescStatMaxFFT": {
"message": "Peak FFT frequency"
},
"osdDescStatTotalFlights": {
"message": "Total number of flights"
},
"osdDescStatTotalFlightTime": {
"message": "Total time spent flying"
},
"osdDescStatTotalFlightDistance": {
"message": "Total distance traveled"
},
"osdTimerSource": {
"message": "Source:"

View File

@ -1053,6 +1053,18 @@ OSD.constants = {
MAX_FFT: {
name: 'MAX_FFT',
desc: 'osdDescStatMaxFFT'
},
TOTAL_FLIGHTS: {
name: 'TOTAL_FLIGHTS',
desc: 'osdDescStatTotalFlights'
},
TOTAL_FLIGHT_TIME: {
name: 'TOTAL_FLIGHT_TIME',
desc: 'osdDescStatTotalFlightTime'
},
TOTAL_FLIGHT_DIST: {
name: 'TOTAL_FLIGHT_DIST',
desc: 'osdDescStatTotalFlightDistance'
}
},
ALL_WARNINGS: {
@ -1337,6 +1349,13 @@ OSD.chooseFields = function () {
F.MAX_FFT
]);
}
if (semver.gte(CONFIG.apiVersion, "1.42.0")) {
OSD.constants.STATISTIC_FIELDS = OSD.constants.STATISTIC_FIELDS.concat([
F.TOTAL_FLIGHTS,
F.TOTAL_FLIGHT_TIME,
F.TOTAL_FLIGHT_DIST
]);
}
}
// Choose warnings