Skip to content

Commit

Permalink
Check array connections too (#10724)
Browse files Browse the repository at this point in the history
  • Loading branch information
perost committed May 22, 2023
1 parent 55cbff8 commit e4b5938
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions OMEdit/OMEditLIB/Annotations/LineAnnotation.cpp
Expand Up @@ -2468,6 +2468,12 @@ void CreateConnectionDialog::createConnection()
ModelInfo newModelInfo = mpGraphicsView->getModelWidget()->createModelInfo();
mpGraphicsView->getModelWidget()->getUndoStack()->push(new OMCUndoCommand(mpGraphicsView->getModelWidget()->getLibraryTreeItem(), oldModelInfo, newModelInfo, "Add Connection"));
mpGraphicsView->getModelWidget()->updateModelText();

if (!mpGraphicsView->getModelWidget()->getModelInstance()->isValidConnection(startElementName, endElementName)) {
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica,
GUIMessages::getMessage(GUIMessages::MISMATCHED_CONNECTORS_IN_CONNECT).arg(startElementName, endElementName),
Helper::scriptingKind, Helper::errorLevel));
}
} else {
mpGraphicsView->getModelWidget()->getUndoStack()->push(new AddConnectionCommand(mpConnectionLineAnnotation, true));
mpGraphicsView->getModelWidget()->getLibraryTreeItem()->emitConnectionAdded(mpConnectionLineAnnotation);
Expand Down

0 comments on commit e4b5938

Please sign in to comment.