diff --git a/OMEdit/OMEditLIB/Element/ElementProperties.cpp b/OMEdit/OMEditLIB/Element/ElementProperties.cpp index cd063d2b372..e59cff8b74b 100644 --- a/OMEdit/OMEditLIB/Element/ElementProperties.cpp +++ b/OMEdit/OMEditLIB/Element/ElementProperties.cpp @@ -236,7 +236,7 @@ Parameter::Parameter(ModelInstance::Element *pElement, ElementParameters *pEleme mConnectorSizing = dialogAnnotation.isConnectorSizing(); // If mShowStartAttribute is not set then check for start modifier - if (!mShowStartAndFixed && !isParameter() && mpModelInstanceElement->getModifier()) { + if (!mShowStartAndFixed && !isParameter() && !isInput() && mpModelInstanceElement->getModifier()) { mShowStartAndFixed = mpModelInstanceElement->getModifier()->hasModifier("start"); } /* if mShowStartAndFixed and group name is empty then set group name to Initialization. @@ -377,6 +377,20 @@ bool Parameter::isParameter() const } } +/*! + * \brief Parameter::isInput + * Returns true if input + * \return + */ +bool Parameter::isInput() const +{ + if (mpModelInstanceElement) { + return mpModelInstanceElement->getDirectionPrefix().compare(QStringLiteral("input")) == 0; + } else { + return mpElement->getElementInfo()->getCausality().compare("input") == 0; + } +} + /*! * \brief Parameter::updateNameLabel * Updates the name label. @@ -1309,11 +1323,11 @@ void ElementParameters::applyFinalStartFixedAndDisplayUnitModifiers(Parameter *p if (MainWindow::instance()->getOMCProxy()->isBuiltinType(pParameter->getModelInstanceElement()->getRootType())) { const QString value = pModifier->getValue(); // if value is not empty then use it otherwise try to read start and fixed modifiers - if (pParameter->isShowStartAttribute() || (value.isEmpty() && !pParameter->isParameter())) { + if (pParameter->isShowStartAttribute() || (value.isEmpty() && !pParameter->isParameter() && !pParameter->isInput())) { bool hasStart = pModifier->hasModifier("start"); bool hasFixed = pModifier->hasModifier("fixed"); if (hasStart || hasFixed) { - if (!pParameter->isGroupDefined() && !pParameter->isParameter()) { + if (!pParameter->isGroupDefined() && !pParameter->isParameter() && !pParameter->isInput()) { pParameter->setGroup("Initialization"); } pParameter->setShowStartAndFixed(true); diff --git a/OMEdit/OMEditLIB/Element/ElementProperties.h b/OMEdit/OMEditLIB/Element/ElementProperties.h index 52e95db2b88..ad65770906e 100644 --- a/OMEdit/OMEditLIB/Element/ElementProperties.h +++ b/OMEdit/OMEditLIB/Element/ElementProperties.h @@ -81,6 +81,7 @@ class Parameter : public QObject Element* getElement() {return mpElement;} ModelInstance::Element* getModelInstanceElement() {return mpModelInstanceElement;} bool isParameter() const; + bool isInput() const; void setTab(QString tab) {mTab = tab;} const StringAnnotation &getTab() {return mTab;} void setGroup(QString group) {mGroup = group;}