mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
Add OSD_EFFICIENCY element to configurator
This commit is contained in:
parent
4eda5f852f
commit
7ef3fa6a2c
2 changed files with 21 additions and 0 deletions
|
@ -4696,6 +4696,13 @@
|
|||
"osdDescElementCameraFrame": {
|
||||
"message": "Adds an adjustable outline element designed to represent the field of view of the pilot's HD camera for visual framing.<br><br>You can adjust the width and height in CLI with 'osd_camera_frame_width' and 'osd_camera_frame_height'"
|
||||
},
|
||||
"osdTextElementEfficiency": {
|
||||
"message": "Efficiency",
|
||||
"description": "One of the elements of the OSD"
|
||||
},
|
||||
"osdDescElementEfficiency": {
|
||||
"message": "Shows current energy consumption in mAh/distance"
|
||||
},
|
||||
|
||||
"osdTextElementUnknown": {
|
||||
"message": "Unknown $1",
|
||||
|
|
|
@ -62,6 +62,8 @@ SYM.loadSymbols = function() {
|
|||
SYM.ALTITUDE = 0x7F;
|
||||
SYM.PITCH = 0x15;
|
||||
SYM.ROLL = 0x14;
|
||||
SYM.KM = 0x7d;
|
||||
SYM.MILES = 0x7e;
|
||||
|
||||
/* Versions before Betaflight 4.1 use font V1
|
||||
* To maintain this list at minimum, we only add here:
|
||||
|
@ -1118,6 +1120,17 @@ OSD.loadDisplayFields = function() {
|
|||
positionable: true,
|
||||
preview: OSD.drawCameraFramePreview,
|
||||
},
|
||||
OSD_EFFICIENCY: {
|
||||
name: 'OSD_EFFICIENCY',
|
||||
text: 'osdTextElementEfficiency',
|
||||
desc: 'osdDescElementEfficiency',
|
||||
default_position: -1,
|
||||
draw_order: 455,
|
||||
positionable: true,
|
||||
preview: function (osdData) {
|
||||
return `1234${FONT.symbol(SYM.MAH)}/${FONT.symbol(osdData.unit_mode === 0 ? SYM.MILES : SYM.KM)}`;
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
};
|
||||
|
@ -1527,6 +1540,7 @@ OSD.chooseFields = function () {
|
|||
OSD.constants.DISPLAY_FIELDS = OSD.constants.DISPLAY_FIELDS.concat([
|
||||
F.RC_CHANNELS,
|
||||
F.CAMERA_FRAME,
|
||||
F.OSD_EFFICIENCY,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue