Skip to content

Commit

Permalink
FU recognise amcfoc applications name (#1004)
Browse files Browse the repository at this point in the history
  • Loading branch information
SanLordKevin authored Jan 9, 2025
1 parent 5966bcf commit 40746fd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
16 changes: 13 additions & 3 deletions src/tools/FirmwareUpdater/firmwareupdatercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,17 +320,27 @@ boardInfo2_t FirmwareUpdaterCore::getMoreDetails(int boardNum,QString *infoStrin

}

QString FirmwareUpdaterCore::getProcessFromUint(uint8_t id, bool isMultiCore)
QString FirmwareUpdaterCore::getProcessFromUint(uint8_t id, bool isMultiCore, eObrd_ethtype_t boardtype)
{
switch (id) {
case uprot_proc_Loader:
return "eLoader";
case uprot_proc_Updater:
return "eUpdater";
case uprot_proc_Application00:
return isMultiCore ? "eApplication_core_0" : "eApplication";
if ((boardtype == eobrd_ethtype_amc) && isMultiCore)
return "eApplication_core_0";
else if ((boardtype == eobrd_ethtype_amcfoc) && isMultiCore)
return "app.yri" ;
else
return "eApplication";
case uprot_proc_Application01:
return "eApplication_core_1";
if ((boardtype == eobrd_ethtype_amc) && isMultiCore)
return "eApplication_core_1";
else if ((boardtype == eobrd_ethtype_amcfoc) && isMultiCore)
return "app.mot" ;
else
return "eApplication_core_1";
case uprot_proc_ApplPROGupdater:
return "eApplPROGupdater";
default:
Expand Down
2 changes: 1 addition & 1 deletion src/tools/FirmwareUpdater/firmwareupdatercore.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class FirmwareUpdaterCore : public QObject
bool goToMaintenance();
bool eraseEthEprom();
void eraseCanEprom();
QString getProcessFromUint(uint8_t id, bool isMultiCore = false);
QString getProcessFromUint(uint8_t id, bool isMultiCore = false, eObrd_ethtype_t boardtype = eobrd_ethtype_unknown);

cDownloader *getDownloader();

Expand Down
8 changes: 4 additions & 4 deletions src/tools/FirmwareUpdater/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1097,14 +1097,14 @@ void MainWindow::onAppendInfo(boardInfo2_t info,eOipv4addr_t address)

/*******************************************************************************/
bool isMulticore = (eoboards_type2numberofcores(eoboards_ethtype2type(info.boardtype))) > 1 ? true : false;
QTreeWidgetItem *startUpNode = new QTreeWidgetItem(bootStrapNode, QStringList() << "Startup" << core->getProcessFromUint(info.processes.startup, isMulticore));
QTreeWidgetItem *startUpNode = new QTreeWidgetItem(bootStrapNode, QStringList() << "Startup" << core->getProcessFromUint(info.processes.startup, isMulticore, info.boardtype));
bootStrapNode->addChild(startUpNode);
bootStrapNode->setExpanded(true);

QTreeWidgetItem *defaultNode = new QTreeWidgetItem(bootStrapNode, QStringList() << "Default" << core->getProcessFromUint(info.processes.def2run, isMulticore));
QTreeWidgetItem *defaultNode = new QTreeWidgetItem(bootStrapNode, QStringList() << "Default" << core->getProcessFromUint(info.processes.def2run, isMulticore, info.boardtype));
bootStrapNode->addChild(defaultNode);

QTreeWidgetItem *runningNode = new QTreeWidgetItem(bootStrapNode, QStringList() << "Running" << core->getProcessFromUint(info.processes.runningnow, isMulticore));
QTreeWidgetItem *runningNode = new QTreeWidgetItem(bootStrapNode, QStringList() << "Running" << core->getProcessFromUint(info.processes.runningnow, isMulticore, info.boardtype));
bootStrapNode->addChild(runningNode);

/*******************************************************************************/
Expand All @@ -1125,7 +1125,7 @@ void MainWindow::onAppendInfo(boardInfo2_t info,eOipv4addr_t address)
propertiesNode->addChild(processNode);
processNode->setExpanded(true);

QTreeWidgetItem *processType = new QTreeWidgetItem(processNode, QStringList() << "Type" << core->getProcessFromUint(pinfo.type, isMulticore));
QTreeWidgetItem *processType = new QTreeWidgetItem(processNode, QStringList() << "Type" << core->getProcessFromUint(pinfo.type, isMulticore, info.boardtype));
processNode->addChild(processType);

QTreeWidgetItem *processVersion = new QTreeWidgetItem(processNode, QStringList() << "Version" << QString("%1.%2").arg(pinfo.version.major).arg(pinfo.version.minor));
Expand Down

0 comments on commit 40746fd

Please sign in to comment.