Changeset 1c153a9d in OpenModelica
- Timestamp:
- 2020-11-11T16:05:46+01:00 (4 years ago)
- Branches:
- Added-citation-metadata, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- 060e22d0, 86acb37, d58083b8, ddd9636, f10cce6
- Parents:
- 94032733
- git-author:
- Adeel Asghar <adeel.asghar@…> (11/11/20 15:40:18)
- git-committer:
- Adeel Asghar <adeel.asghar@…> (11/11/20 16:05:46)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OMEdit/OMEditLIB/Annotations/ShapeAnnotation.cpp
rf62cc7f r1c153a9d 1544 1544 void ShapeAnnotation::cornerItemReleased(const bool changed) 1545 1545 { 1546 Q_ASSERT(!mOldAnnotation.isEmpty());1546 assert(!mOldAnnotation.isEmpty()); 1547 1547 1548 1548 if (changed) { … … 1550 1550 LineAnnotation *pLineAnnotation = dynamic_cast<LineAnnotation*>(this); 1551 1551 1552 if (p LineAnnotation) {1553 if (p ModelWidget->getLibraryTreeItem()->getLibraryType() == LibraryTreeItem::OMS) {1552 if (pModelWidget->getLibraryTreeItem()->getLibraryType() == LibraryTreeItem::OMS) { 1553 if (pLineAnnotation) { 1554 1554 pLineAnnotation->updateOMSConnection(); 1555 1555 pModelWidget->createOMSimulatorUndoCommand(QString("Update OMS Connection connect(%1, %2)").arg(pLineAnnotation->getStartComponentName(), pLineAnnotation->getEndComponentName())); 1556 1556 pModelWidget->updateModelText(); 1557 } 1558 } else { 1559 if (pLineAnnotation && pLineAnnotation->getLineType() == LineAnnotation::ConnectionType) { 1560 manhattanizeShape(false); 1561 removeRedundantPointsGeometriesAndCornerItems(); 1562 // Call getOMCShapeAnnotation() after manhattanizeShape() and removeRedundantPointsGeometriesAndCornerItems() to get a correct new annotation 1563 QString newAnnotation = getOMCShapeAnnotation(); 1564 pModelWidget->getUndoStack()->push(new UpdateConnectionCommand(pLineAnnotation, mOldAnnotation, newAnnotation)); 1565 } else if (pLineAnnotation && pLineAnnotation->getLineType() == LineAnnotation::TransitionType) { 1566 manhattanizeShape(false); 1567 removeRedundantPointsGeometriesAndCornerItems(); 1568 QString newAnnotation = getOMCShapeAnnotation(); 1569 pModelWidget->getUndoStack()->push(new UpdateTransitionCommand(pLineAnnotation, pLineAnnotation->getCondition(), pLineAnnotation->getImmediate(), 1570 pLineAnnotation->getReset(), pLineAnnotation->getSynchronize(), pLineAnnotation->getPriority(), 1571 mOldAnnotation, pLineAnnotation->getCondition(), pLineAnnotation->getImmediate(), 1572 pLineAnnotation->getReset(), pLineAnnotation->getSynchronize(), pLineAnnotation->getPriority(), newAnnotation)); 1557 1573 } else { 1558 if (pLineAnnotation->getLineType() == LineAnnotation::ConnectionType) { 1559 manhattanizeShape(false); 1560 removeRedundantPointsGeometriesAndCornerItems(); 1561 // Call getOMCShapeAnnotation() after manhattanizeShape() and removeRedundantPointsGeometriesAndCornerItems() to get a correct new annotation 1562 QString newAnnotation = getOMCShapeAnnotation(); 1563 pModelWidget->getUndoStack()->push(new UpdateConnectionCommand(pLineAnnotation, mOldAnnotation, newAnnotation)); 1564 } else if (pLineAnnotation && pLineAnnotation->getLineType() == LineAnnotation::TransitionType) { 1565 manhattanizeShape(false); 1566 removeRedundantPointsGeometriesAndCornerItems(); 1567 QString newAnnotation = getOMCShapeAnnotation(); 1568 pModelWidget->getUndoStack()->push(new UpdateTransitionCommand(pLineAnnotation, pLineAnnotation->getCondition(), pLineAnnotation->getImmediate(), 1569 pLineAnnotation->getReset(), pLineAnnotation->getSynchronize(), pLineAnnotation->getPriority(), 1570 mOldAnnotation, pLineAnnotation->getCondition(), pLineAnnotation->getImmediate(), 1571 pLineAnnotation->getReset(), pLineAnnotation->getSynchronize(), pLineAnnotation->getPriority(), newAnnotation)); 1572 } else { 1573 QString newAnnotation = getOMCShapeAnnotation(); 1574 pModelWidget->getUndoStack()->push(new UpdateShapeCommand(this, mOldAnnotation, newAnnotation)); 1575 pModelWidget->updateClassAnnotationIfNeeded(); 1576 } 1577 pModelWidget->updateModelText(); 1574 QString newAnnotation = getOMCShapeAnnotation(); 1575 pModelWidget->getUndoStack()->push(new UpdateShapeCommand(this, mOldAnnotation, newAnnotation)); 1576 pModelWidget->updateClassAnnotationIfNeeded(); 1578 1577 } 1578 pModelWidget->updateModelText(); 1579 1579 } 1580 1580 } else {
Note: See TracChangeset
for help on using the changeset viewer.