Skip to content

Commit a510dec

Browse files
authored
Modifiers are not part of the model now (#10474)
Adapt to the new output of getModelInstance API
1 parent d10c70d commit a510dec

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

OMEdit/OMEditLIB/Modeling/Model.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -951,11 +951,6 @@ namespace ModelInstance
951951
mRestriction = mModelJson.value("restriction").toString();
952952
}
953953

954-
// short type definitions have modifiers
955-
if (mModelJson.contains("modifiers")) {
956-
mModifier.deserialize(mModelJson.value("modifiers"));
957-
}
958-
959954
if (mModelJson.contains("prefixes")) {
960955
mpPrefixes->deserialize(mModelJson.value("prefixes").toObject());
961956
}
@@ -1409,15 +1404,12 @@ namespace ModelInstance
14091404
QString Element::getModifierValueFromType(QStringList modifierNames)
14101405
{
14111406
/* 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.
14141408
*/
14151409
// Case 1
14161410
QString modifierValue = mModifier.getModifierValue(modifierNames);
14171411
if (modifierValue.isEmpty() && mpModel) {
14181412
// Case 2
1419-
modifierValue = mpModel->getModifier().getModifierValue(modifierNames);
1420-
// Case 3
14211413
if (modifierValue.isEmpty()) {
14221414
modifierValue = Element::getModifierValueFromInheritedType(mpModel, modifierNames);
14231415
}
@@ -1459,10 +1451,10 @@ namespace ModelInstance
14591451
{
14601452
QString modifierValue = "";
14611453
foreach (auto pElement, pModel->getElements()) {
1462-
if (pElement->isExtend() && pElement->getModel()) {
1454+
if (pElement->isExtend()) {
14631455
auto pExtend = dynamic_cast<Extend*>(pElement);
1464-
modifierValue = pExtend->getModel()->getModifier().getModifierValue(modifierNames);
1465-
if (modifierValue.isEmpty()) {
1456+
modifierValue = pExtend->getModifier().getModifierValue(modifierNames);
1457+
if (modifierValue.isEmpty() && pExtend->getModel()) {
14661458
modifierValue = Element::getModifierValueFromInheritedType(pExtend->getModel(), modifierNames);
14671459
} else {
14681460
return modifierValue;

OMEdit/OMEditLIB/Modeling/Model.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,6 @@ namespace ModelInstance
557557
QString getName() const {return mName;}
558558
bool isMissing() const {return mMissing;}
559559
QString getRestriction() const {return mRestriction;}
560-
Modifier getModifier() const {return mModifier;}
561560
bool isConnector() const;
562561
bool isExpandableConnector() const;
563562
bool isEnumeration() const;
@@ -587,7 +586,6 @@ namespace ModelInstance
587586
Dimensions mDims;
588587
QString mRestriction;
589588
std::unique_ptr<Prefixes> mpPrefixes;
590-
Modifier mModifier;
591589
QString mComment;
592590
std::unique_ptr<Annotation> mpAnnotation;
593591
QList<Element*> mElements;

0 commit comments

Comments
 (0)