1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-25 17:25:16 +03:00

Fix board name in logo and status bar (#4019)

This commit is contained in:
Míguel Ángel Mulero Martínez 2024-06-11 16:59:27 +02:00 committed by GitHub
parent c7abdac31d
commit e0fd63f5d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 25 deletions

View file

@ -143,27 +143,6 @@ const FC = {
// and bridges the vue and rest of the code
CONFIG: {
...INITIAL_CONFIG,
get hardwareName() {
let name;
if (this.targetName) {
name = this.targetName;
} else {
name = this.boardIdentifier;
}
if (this.boardName && this.boardName !== name) {
name = `${this.boardName}(${name})`;
}
if (this.manufacturerId) {
name = `${this.manufacturerId}/${name}`;
}
return name;
},
set hardwareName(name) {
// NOOP, can't really be set. Maybe implement some logic?
},
},
COPY_PROFILE: null,
CURRENT_METERS: null,
@ -816,7 +795,7 @@ const FC = {
return serialRxTypes;
},
getHardwareName() {
calculateHardwareName() {
let name;
if (this.CONFIG.targetName) {
name = this.CONFIG.targetName;
@ -832,7 +811,7 @@ const FC = {
name = `${this.CONFIG.manufacturerId}/${name}`;
}
return name;
this.CONFIG.hardwareName = name;
},
MCU_TYPES: {

View file

@ -833,6 +833,9 @@ MspHelper.prototype.process_data = function(dataHandler) {
FC.CONFIG.sampleRateHz = data.readU16();
FC.CONFIG.configurationProblems = data.readU32();
// Refresh the hardware name (it's a calculated field)
FC.calculateHardwareName();
break;
case MSPCodes.MSP_NAME:

View file

@ -394,7 +394,7 @@ function processCustomDefaults() {
function processBoardInfo() {
gui_log(i18n.getMessage('boardInfoReceived', [FC.getHardwareName(), FC.CONFIG.boardVersion]));
gui_log(i18n.getMessage('boardInfoReceived', [FC.CONFIG.hardwareName, FC.CONFIG.boardVersion]));
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) {
checkReportProblems();
@ -405,7 +405,7 @@ function processBoardInfo() {
boardIdentifier: FC.CONFIG.boardIdentifier,
targetName: FC.CONFIG.targetName,
boardName: FC.CONFIG.boardName,
hardware: FC.getHardwareName(),
hardware: FC.CONFIG.hardwareName,
manufacturerId: FC.CONFIG.manufacturerId,
apiVersion: FC.CONFIG.apiVersion,
flightControllerVersion: FC.CONFIG.flightControllerVersion,