Changeset a510dec in OpenModelica
- Timestamp:
- 2023-03-30T14:02:58+02:00 (12 months ago)
- Branches:
- maintenance/v1.22, master
- Children:
- 6150c3a, dfd0762c, f4dc2927
- Parents:
- d10c70d
- git-author:
- Adeel Asghar <adeel.asghar@…> (03/30/23 14:02:58)
- git-committer:
- GitHub <noreply@…> (03/30/23 14:02:58)
- Location:
- OMEdit/OMEditLIB/Modeling
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
OMEdit/OMEditLIB/Modeling/Model.cpp
rc84168c ra510dec 952 952 } 953 953 954 // short type definitions have modifiers955 if (mModelJson.contains("modifiers")) {956 mModifier.deserialize(mModelJson.value("modifiers"));957 }958 959 954 if (mModelJson.contains("prefixes")) { 960 955 mpPrefixes->deserialize(mModelJson.value("prefixes").toObject()); … … 1410 1405 { 1411 1406 /* 1. First check if unit is defined with in the component modifier. 1412 * 2. If no unit is found then check it in the derived class modifier value. 1413 * 3. A derived class can be inherited, so look recursively. 1407 * 2. If no unit is found then check it in the derived class modifier value recursively. 1414 1408 */ 1415 1409 // Case 1 … … 1417 1411 if (modifierValue.isEmpty() && mpModel) { 1418 1412 // Case 2 1419 modifierValue = mpModel->getModifier().getModifierValue(modifierNames);1420 // Case 31421 1413 if (modifierValue.isEmpty()) { 1422 1414 modifierValue = Element::getModifierValueFromInheritedType(mpModel, modifierNames); … … 1460 1452 QString modifierValue = ""; 1461 1453 foreach (auto pElement, pModel->getElements()) { 1462 if (pElement->isExtend() && pElement->getModel()) {1454 if (pElement->isExtend()) { 1463 1455 auto pExtend = dynamic_cast<Extend*>(pElement); 1464 modifierValue = pExtend->getMod el()->getModifier().getModifierValue(modifierNames);1465 if (modifierValue.isEmpty() ) {1456 modifierValue = pExtend->getModifier().getModifierValue(modifierNames); 1457 if (modifierValue.isEmpty() && pExtend->getModel()) { 1466 1458 modifierValue = Element::getModifierValueFromInheritedType(pExtend->getModel(), modifierNames); 1467 1459 } else { -
OMEdit/OMEditLIB/Modeling/Model.h
rc84168c ra510dec 558 558 bool isMissing() const {return mMissing;} 559 559 QString getRestriction() const {return mRestriction;} 560 Modifier getModifier() const {return mModifier;}561 560 bool isConnector() const; 562 561 bool isExpandableConnector() const; … … 588 587 QString mRestriction; 589 588 std::unique_ptr<Prefixes> mpPrefixes; 590 Modifier mModifier;591 589 QString mComment; 592 590 std::unique_ptr<Annotation> mpAnnotation;
Note: See TracChangeset
for help on using the changeset viewer.