Skip to content

Commit 7d9bfdc

Browse files
committed
Lookup units recursively
1 parent 885d497 commit 7d9bfdc

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

OMEdit/OMEditGUI/Component/ComponentProperties.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ QString Parameter::getFixedState()
251251
}
252252

253253
/*!
254-
* \brief Parameter::getUnitFromDerivedClass
255-
* Returns the unit value by reading the derived classes.
254+
* \brief Parameter::getModifierValueFromDerivedClass
255+
* Returns the modifier value by reading the derived classes.
256256
* \param pComponent
257257
* \param modifierName
258258
* \return the modifier value.
@@ -272,14 +272,13 @@ QString Parameter::getModifierValueFromDerivedClass(Component *pComponent, QStri
272272
* pInheritedComponent->getLibraryTreeItem()->getNameStructure() to get the correct name of inherited class.
273273
* Also don't just return after reading from first inherited class. Check recursively.
274274
*/
275-
// if (!pOMCProxy->isBuiltinType(pInheritedComponent->getComponentInfo()->getClassName())) {
276-
// return pOMCProxy->getDerivedClassModifierValue(pInheritedComponent->getComponentInfo()->getClassName(), modifierName);
277-
// }
278-
// return getModifierValueFromDerivedClass(pInheritedComponent, modifierName);
279275
if (pInheritedComponent->getLibraryTreeItem() &&
280276
!pOMCProxy->isBuiltinType(pInheritedComponent->getLibraryTreeItem()->getNameStructure())) {
281277
modifierValue = pOMCProxy->getDerivedClassModifierValue(pInheritedComponent->getLibraryTreeItem()->getNameStructure(),
282278
modifierName);
279+
if (modifierValue.isEmpty()) {
280+
modifierValue = getModifierValueFromDerivedClass(pInheritedComponent, modifierName);
281+
}
283282
if (!modifierValue.isEmpty()) {
284283
return modifierValue;
285284
}

0 commit comments

Comments
 (0)