Skip to content

Commit

Permalink
Removed unnecessary function calls. Fixed error in causality check.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Braun committed Jan 13, 2017
1 parent 43afe7f commit 055e13d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions OMEdit/OMEditGUI/Editors/MetaModelEditor.cpp
Expand Up @@ -390,15 +390,15 @@ bool MetaModelEditor::createConnection(LineAnnotation *pConnectionLineAnnotation
StringHandler::getTLMCausality(StringHandler::TLMInput)) {
pConnectionLineAnnotation->setLinePattern(StringHandler::LineDash);
pConnectionLineAnnotation->setEndArrow(StringHandler::ArrowFilled);
pConnectionLineAnnotation->update();
pConnectionLineAnnotation->handleComponentMoved();
//pConnectionLineAnnotation->update();
//pConnectionLineAnnotation->handleComponentMoved();
}
else if(this->getInterfaceCausality(pConnectionLineAnnotation->getEndComponentName()) ==
StringHandler::getTLMCausality(StringHandler::TLMOutput)) {
pConnectionLineAnnotation->setLinePattern(StringHandler::LineDash);
pConnectionLineAnnotation->setStartArrow(StringHandler::ArrowFilled);
pConnectionLineAnnotation->update();
pConnectionLineAnnotation->handleComponentMoved();
//pConnectionLineAnnotation->update();
//pConnectionLineAnnotation->handleComponentMoved();
}

return true;
Expand Down Expand Up @@ -440,9 +440,9 @@ bool MetaModelEditor::okToConnect(LineAnnotation *pConnectionLineAnnotation)
if(!(causality1 == StringHandler::getTLMCausality(StringHandler::TLMBidirectional) &&
causality2 == StringHandler::getTLMCausality(StringHandler::TLMBidirectional)) &&
!(causality1 == StringHandler::getTLMCausality(StringHandler::TLMInput) &&
causality2 != StringHandler::getTLMCausality(StringHandler::TLMOutput)) &&
causality2 == StringHandler::getTLMCausality(StringHandler::TLMOutput)) &&
!(causality1 == StringHandler::getTLMCausality(StringHandler::TLMOutput) &&
causality2 != StringHandler::getTLMCausality(StringHandler::TLMInput))) {
causality2 == StringHandler::getTLMCausality(StringHandler::TLMInput))) {
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::MetaModel, "", false, 0, 0, 0, 0,
"Cannot connect interface points of different causality ("+
causality1+" to "+causality2+")",
Expand Down
8 changes: 4 additions & 4 deletions OMEdit/OMEditGUI/Modeling/ModelWidgetContainer.cpp
Expand Up @@ -4302,15 +4302,15 @@ void ModelWidget::getMetaModelConnections()
StringHandler::getTLMCausality(StringHandler::TLMInput)) {
pConnectionLineAnnotation->setLinePattern(StringHandler::LineDash);
pConnectionLineAnnotation->setEndArrow(StringHandler::ArrowFilled);
pConnectionLineAnnotation->update();
pConnectionLineAnnotation->handleComponentMoved();
//pConnectionLineAnnotation->update();
//pConnectionLineAnnotation->handleComponentMoved();
}
else if(pEditor->getInterfaceCausality(pConnectionLineAnnotation->getEndComponentName()) ==
StringHandler::getTLMCausality(StringHandler::TLMOutput)) {
pConnectionLineAnnotation->setLinePattern(StringHandler::LineDash);
pConnectionLineAnnotation->setStartArrow(StringHandler::ArrowFilled);
pConnectionLineAnnotation->update();
pConnectionLineAnnotation->handleComponentMoved();
//pConnectionLineAnnotation->update();
//pConnectionLineAnnotation->handleComponentMoved();
}

mpUndoStack->push(new AddConnectionCommand(pConnectionLineAnnotation, false));
Expand Down

0 comments on commit 055e13d

Please sign in to comment.