add support for max esc temp and rpm (rebase)

10.5.x-maintenance
timman2er 2018-09-25 15:33:04 +02:00
parent 0e0b7476d1
commit fb440fcaed
2 changed files with 23 additions and 1 deletions

View File

@ -3572,6 +3572,12 @@
"osdDescStatGForce": { "osdDescStatGForce": {
"message": "Max G-Force experienced by the craft" "message": "Max G-Force experienced by the craft"
}, },
"osdDescStatEscTemperature": {
"message": "Max ESC temperature"
},
"osdDescStatEscRpm": {
"message": "Max ESC RPM"
},
"osdTimerSource": { "osdTimerSource": {

View File

@ -893,6 +893,14 @@ OSD.constants = {
MAX_G_FORCE: { MAX_G_FORCE: {
name: 'MAX_G_FORCE', name: 'MAX_G_FORCE',
desc: 'osdDescStatGForce' desc: 'osdDescStatGForce'
},
MAX_ESC_TEMP: {
name: 'MAX_ESC_TEMP',
desc: 'osdDescStatEscTemperature'
},
MAX_ESC_RPM: {
name: 'MAX_ESC_RPM',
desc: 'osdDescStatEscRpm'
} }
}, },
ALL_WARNINGS: { ALL_WARNINGS: {
@ -1107,6 +1115,12 @@ OSD.chooseFields = function () {
F.RTC_DATE_TIME 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 } else { // Starting with 1.39.0 OSD stats are reordered to match how they're presented on screen
OSD.constants.STATISTIC_FIELDS = [ OSD.constants.STATISTIC_FIELDS = [
F.RTC_DATE_TIME, F.RTC_DATE_TIME,
@ -1123,7 +1137,9 @@ OSD.chooseFields = function () {
F.MAX_ALTITUDE, F.MAX_ALTITUDE,
F.BLACKBOX, F.BLACKBOX,
F.BLACKBOX_LOG_NUMBER, F.BLACKBOX_LOG_NUMBER,
F.MAX_G_FORCE F.MAX_G_FORCE,
F.MAX_ESC_TEMP,
F.MAX_ESC_RPM
]; ];
} }