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:
parent
c7abdac31d
commit
e0fd63f5d5
3 changed files with 7 additions and 25 deletions
25
src/js/fc.js
25
src/js/fc.js
|
@ -143,27 +143,6 @@ const FC = {
|
||||||
// and bridges the vue and rest of the code
|
// and bridges the vue and rest of the code
|
||||||
CONFIG: {
|
CONFIG: {
|
||||||
...INITIAL_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,
|
COPY_PROFILE: null,
|
||||||
CURRENT_METERS: null,
|
CURRENT_METERS: null,
|
||||||
|
@ -816,7 +795,7 @@ const FC = {
|
||||||
return serialRxTypes;
|
return serialRxTypes;
|
||||||
},
|
},
|
||||||
|
|
||||||
getHardwareName() {
|
calculateHardwareName() {
|
||||||
let name;
|
let name;
|
||||||
if (this.CONFIG.targetName) {
|
if (this.CONFIG.targetName) {
|
||||||
name = this.CONFIG.targetName;
|
name = this.CONFIG.targetName;
|
||||||
|
@ -832,7 +811,7 @@ const FC = {
|
||||||
name = `${this.CONFIG.manufacturerId}/${name}`;
|
name = `${this.CONFIG.manufacturerId}/${name}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return name;
|
this.CONFIG.hardwareName = name;
|
||||||
},
|
},
|
||||||
|
|
||||||
MCU_TYPES: {
|
MCU_TYPES: {
|
||||||
|
|
|
@ -833,6 +833,9 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
||||||
FC.CONFIG.sampleRateHz = data.readU16();
|
FC.CONFIG.sampleRateHz = data.readU16();
|
||||||
FC.CONFIG.configurationProblems = data.readU32();
|
FC.CONFIG.configurationProblems = data.readU32();
|
||||||
|
|
||||||
|
// Refresh the hardware name (it's a calculated field)
|
||||||
|
FC.calculateHardwareName();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSPCodes.MSP_NAME:
|
case MSPCodes.MSP_NAME:
|
||||||
|
|
|
@ -394,7 +394,7 @@ function processCustomDefaults() {
|
||||||
|
|
||||||
function processBoardInfo() {
|
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)) {
|
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) {
|
||||||
checkReportProblems();
|
checkReportProblems();
|
||||||
|
@ -405,7 +405,7 @@ function processBoardInfo() {
|
||||||
boardIdentifier: FC.CONFIG.boardIdentifier,
|
boardIdentifier: FC.CONFIG.boardIdentifier,
|
||||||
targetName: FC.CONFIG.targetName,
|
targetName: FC.CONFIG.targetName,
|
||||||
boardName: FC.CONFIG.boardName,
|
boardName: FC.CONFIG.boardName,
|
||||||
hardware: FC.getHardwareName(),
|
hardware: FC.CONFIG.hardwareName,
|
||||||
manufacturerId: FC.CONFIG.manufacturerId,
|
manufacturerId: FC.CONFIG.manufacturerId,
|
||||||
apiVersion: FC.CONFIG.apiVersion,
|
apiVersion: FC.CONFIG.apiVersion,
|
||||||
flightControllerVersion: FC.CONFIG.flightControllerVersion,
|
flightControllerVersion: FC.CONFIG.flightControllerVersion,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue