Changeset a510dec in OpenModelica


Ignore:
Timestamp:
2023-03-30T14:02:58+02:00 (12 months ago)
Author:
GitHub <noreply@…>
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)
Message:

Modifiers are not part of the model now (#10474)

Adapt to the new output of getModelInstance API

Location:
OMEdit/OMEditLIB/Modeling
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OMEdit/OMEditLIB/Modeling/Model.cpp

    rc84168c ra510dec  
    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());
     
    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
     
    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);
     
    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 {
  • OMEdit/OMEditLIB/Modeling/Model.h

    rc84168c ra510dec  
    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;
     
    588587    QString mRestriction;
    589588    std::unique_ptr<Prefixes> mpPrefixes;
    590     Modifier mModifier;
    591589    QString mComment;
    592590    std::unique_ptr<Annotation> mpAnnotation;
Note: See TracChangeset for help on using the changeset viewer.