Skip to content

Commit

Permalink
Keep custom FMIWrapper name when loading model
Browse files Browse the repository at this point in the history
  • Loading branch information
robbr48 committed Sep 20, 2024
1 parent 0e58703 commit 5cca8c1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions HopsanGUI/loadFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,13 @@ ModelObject* loadModelObject(const QDomElement &domElement, SystemObject* pSyste
QDomElement xmlParameter = xmlParameters.firstChildElement(hmf::parameter::root);
while (!xmlParameter.isNull())
{
QString tempName = pObj->getName();

loadParameterValue(xmlParameter, pObj, NoUndo);

//Some components might change name depending on a parameter (e.g. FMIWrapper), make sure to change it back if it was changed.
pSystem->renameModelObject(pObj->getName(), tempName, NoUndo);

xmlParameter = xmlParameter.nextSiblingElement(hmf::parameter::root);
}

Expand Down

0 comments on commit 5cca8c1

Please sign in to comment.