Skip to content

Commit

Permalink
Added check for connections between moved blocks in MoveThroughHierarchy
Browse files Browse the repository at this point in the history
When moving multiple blocks, connection between these blocks already
gets moved so we don't have to reconnect them
  • Loading branch information
sebHollersbacher authored and oberlehner committed May 7, 2024
1 parent acae8e3 commit 8c14e8f
Showing 1 changed file with 12 additions and 5 deletions.
Expand Up @@ -241,12 +241,19 @@ private static CompoundCommand createReconnectCommand(final List<FBNetworkElemen
// reconnect the input connections
fbElement.getInterface().getAllInterfaceElements().forEach(ie -> {
if (ie.isIsInput()) {
ie.getInputConnections()
.forEach(conn -> cmd.add(new BorderCrossingReconnectCommand(conn.getDestination(),
conn.getDestination(), conn, false)));
ie.getInputConnections().forEach(conn -> {
if (!fbElements.contains(conn.getSource().eContainer().eContainer())) {
cmd.add(new BorderCrossingReconnectCommand(conn.getDestination(), conn.getDestination(),
conn, false));
}
});
} else {
ie.getOutputConnections().forEach(conn -> cmd
.add(new BorderCrossingReconnectCommand(conn.getSource(), conn.getSource(), conn, true)));
ie.getOutputConnections().forEach(conn -> {
if (!fbElements.contains(conn.getDestination().eContainer().eContainer())) {
cmd.add(new BorderCrossingReconnectCommand(conn.getSource(), conn.getSource(), conn, true));
}
});

}
});
}
Expand Down

0 comments on commit 8c14e8f

Please sign in to comment.