Merge pull request #1099 from leocb/OSD-add-g-force

Added support for OSD G-force element
10.4.x-maintenance
Michael Keller 2018-07-03 22:45:06 +12:00 committed by GitHub
commit 396291e1ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 9 deletions

View File

@ -3295,7 +3295,9 @@
"osdDescAntiGravity": {
"message": "Enables an indicator when the anti gravity is active"
},
"osdDescGForce": {
"message": "Shows how much G-Force the craft is experiencing"
},
"osdDescStatMaxSpeed": {
"message": "Maximum recorded speed"
},

View File

@ -774,6 +774,14 @@ OSD.constants = {
draw_order: 320,
positionable: true,
preview: 'AG'
},
G_FORCE: {
name: 'G_FORCE',
desc: 'osdDescGForce',
default_position: -1,
draw_order: 15,
positionable: true,
preview: '1.0G'
}
},
UNKNOWN_DISPLAY_FIELD: {
@ -978,17 +986,22 @@ OSD.chooseFields = function () {
F.ESC_RPM
]);
if (semver.gte(CONFIG.apiVersion, "1.37.0")) {
OSD.constants.DISPLAY_FIELDS = OSD.constants.DISPLAY_FIELDS.concat([
F.REMAINING_TIME_ESTIMATE,
F.RTC_DATE_TIME,
F.ADJUSTMENT_RANGE,
F.CORE_TEMPERATURE
]);
if (semver.gte(CONFIG.apiVersion, "1.39.0")) {
OSD.constants.DISPLAY_FIELDS = OSD.constants.DISPLAY_FIELDS.concat([
F.REMAINING_TIME_ESTIMATE,
F.RTC_DATE_TIME,
F.ADJUSTMENT_RANGE,
F.CORE_TEMPERATURE
F.ANTI_GRAVITY
]);
if (semver.gte(CONFIG.apiVersion, "1.39.0")) {
OSD.constants.DISPLAY_FIELDS = OSD.constants.DISPLAY_FIELDS.concat([
F.ANTI_GRAVITY
]);
if (semver.gte(CONFIG.apiVersion, "1.40.0")) {
OSD.constants.DISPLAY_FIELDS = OSD.constants.DISPLAY_FIELDS.concat([
F.G_FORCE
]);
}
}
}
}
}