mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
Merge pull request #2964 from P-I-Engineer/vtx_osd_variant_gitfix
This commit is contained in:
commit
c4706b17a7
2 changed files with 30 additions and 1 deletions
|
@ -4904,6 +4904,14 @@
|
|||
"osdDescElementVtxChannel": {
|
||||
"message": "Current VTX channel and power"
|
||||
},
|
||||
"osdTextElementVTXchannelVariantPower": {
|
||||
"message": "VTX power",
|
||||
"description": "One of the variants of the VTX channel element of the OSD"
|
||||
},
|
||||
"osdTextElementVTXchannelVariantFull": {
|
||||
"message": "Band:Channel:Pwr:Pit",
|
||||
"description": "One of the variants of the VTX channel element of the OSD"
|
||||
},
|
||||
"osdTextElementVoltageWarning": {
|
||||
"message": "Battery voltage warning",
|
||||
"description": "One of the elements of the OSD"
|
||||
|
|
|
@ -306,6 +306,21 @@ OSD.generateAltitudePreview = function(osdData) {
|
|||
return `${FONT.symbol(SYM.ALTITUDE)}399${variantSelected === 0? '.7' : ''}${unit}`;
|
||||
};
|
||||
|
||||
OSD.generateVTXChannelPreview = function(osdData) {
|
||||
const variantSelected = OSD.getVariantForPreview(osdData, 'VTX_CHANNEL');
|
||||
let value;
|
||||
switch (variantSelected) {
|
||||
case 0:
|
||||
value = 'R:2:200:P';
|
||||
break;
|
||||
|
||||
case 1:
|
||||
value = '200';
|
||||
break;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
OSD.generateBatteryUsagePreview = function(osdData) {
|
||||
const variantSelected = OSD.getVariantForPreview(osdData, 'MAIN_BATT_USAGE');
|
||||
|
||||
|
@ -565,7 +580,13 @@ OSD.loadDisplayFields = function() {
|
|||
defaultPosition: 1,
|
||||
draw_order: 120,
|
||||
positionable: true,
|
||||
preview: 'R:2:200:P',
|
||||
variants: [
|
||||
'osdTextElementVTXchannelVariantFull',
|
||||
'osdTextElementVTXchannelVariantPower',
|
||||
],
|
||||
preview(osdData) {
|
||||
return OSD.generateVTXChannelPreview(osdData);
|
||||
},
|
||||
},
|
||||
VOLTAGE_WARNING: {
|
||||
name: 'VOLTAGE_WARNING',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue