mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-16 12:55:14 +03:00
Add display name to config, backup/restore and OSD
This commit is contained in:
parent
d502e69bb2
commit
ab83c79315
5 changed files with 25 additions and 2 deletions
|
@ -3564,6 +3564,9 @@
|
|||
"osdDescElementCraftName": {
|
||||
"message": "Craft name as set in Configuration tab"
|
||||
},
|
||||
"osdDescElementDisplayName": {
|
||||
"message": "Display name as set in Configuration tab"
|
||||
},
|
||||
"osdDescElementAltitude": {
|
||||
"message": "Current altitude (flashes when above alarm threshold)"
|
||||
},
|
||||
|
|
|
@ -143,6 +143,7 @@ function configuration_backup(callback) {
|
|||
configuration.LED_COLORS = jQuery.extend(true, [], LED_COLORS);
|
||||
configuration.BOARD_ALIGNMENT_CONFIG = jQuery.extend(true, {}, BOARD_ALIGNMENT_CONFIG);
|
||||
configuration.CRAFT_NAME = CONFIG.name;
|
||||
configuration.DISPLAY_NAME = CONFIG.displayName;
|
||||
configuration.MIXER_CONFIG = jQuery.extend(true, {}, MIXER_CONFIG);
|
||||
configuration.SENSOR_CONFIG = jQuery.extend(true, {}, SENSOR_CONFIG);
|
||||
configuration.PID_ADVANCED_CONFIG = jQuery.extend(true, {}, PID_ADVANCED_CONFIG);
|
||||
|
@ -833,6 +834,7 @@ function configuration_restore(callback) {
|
|||
RSSI_CONFIG = configuration.RSSI_CONFIG;
|
||||
BOARD_ALIGNMENT_CONFIG = configuration.BOARD_ALIGNMENT_CONFIG;
|
||||
CONFIG.name = configuration.CRAFT_NAME;
|
||||
CONFIG.displayName = configuration.DISPLAY_NAME;
|
||||
MIXER_CONFIG = configuration.MIXER_CONFIG;
|
||||
SENSOR_CONFIG = configuration.SENSOR_CONFIG;
|
||||
PID_ADVANCED_CONFIG = configuration.PID_ADVANCED_CONFIG;
|
||||
|
|
|
@ -78,6 +78,7 @@ var FC = {
|
|||
uid: [0, 0, 0],
|
||||
accelerometerTrims: [0, 0],
|
||||
name: '',
|
||||
displayName: 'JOE PILOT',
|
||||
numProfiles: 3,
|
||||
rateProfile: 0,
|
||||
boardType: 0,
|
||||
|
|
|
@ -515,7 +515,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
|
||||
$('input[name="craftName"]').val(CONFIG.name);
|
||||
|
||||
|
||||
if (semver.gte(CONFIG.apiVersion, "1.31.0")) {
|
||||
$('input[name="fpvCamAngleDegrees"]').val(RX_CONFIG.fpvCamAngleDegrees);
|
||||
} else {
|
||||
|
|
|
@ -295,6 +295,13 @@ OSD.generateCraftName = function (osd_data) {
|
|||
return preview;
|
||||
}
|
||||
|
||||
OSD.generateDisplayName = function(osd_data) {
|
||||
var preview = 'DISPLAY_NAME';
|
||||
if (CONFIG.displayName != '')
|
||||
preview = CONFIG.displayName.toUpperCase();
|
||||
return preview;
|
||||
}
|
||||
|
||||
OSD.drawStickOverlayPreview = function () {
|
||||
function randomInt(count) {
|
||||
return Math.floor(Math.random() * Math.floor(count));
|
||||
|
@ -914,6 +921,16 @@ OSD.constants = {
|
|||
positionable: true,
|
||||
preview: OSD.drawStickOverlayPreview
|
||||
},
|
||||
DISPLAY_NAME: {
|
||||
name: 'DISPLAY_NAME',
|
||||
desc: 'osdDescElementDisplayName',
|
||||
default_position: -77,
|
||||
draw_order: 380,
|
||||
positionable: true,
|
||||
preview: function(osd_data) {
|
||||
return OSD.generateDisplayName(osd_data, 1);
|
||||
}
|
||||
},
|
||||
},
|
||||
UNKNOWN_DISPLAY_FIELD: {
|
||||
name: 'UNKNOWN_',
|
||||
|
@ -1189,6 +1206,7 @@ OSD.chooseFields = function () {
|
|||
F.FLIGHT_DIST,
|
||||
F.STICK_OVERLAY_LEFT,
|
||||
F.STICK_OVERLAY_RIGHT,
|
||||
F.DISPLAY_NAME,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue