Skip to content

Commit

Permalink
Merge branch 'main' into synchronize_set_v_angle_on_bus_between_views
Browse files Browse the repository at this point in the history
  • Loading branch information
FranckLecuyer authored Sep 17, 2024
2 parents a43f002 + b240dab commit 8492ef9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,13 @@ public void moveConnectable(String busId, boolean connected) {
throw new PowsyblException("Trying to move connectable " + attributes.getResource().getId()
+ " to bus " + busId + " of voltage level " + bus.getVoltageLevel().getId() + ", which is a node breaker voltage level");
}
attributes.setConnectableBus(busId);
attributes.setBus(connected ? busId : null);
attributes.setVoltageLevelId(voltageLevel.getId());
getAbstractIdentifiable().updateResource(res -> {
InjectionAttributes attr = attributesGetter.apply(res);
attr.setConnectableBus(busId);
attr.setBus(connected ? busId : null);
attr.setNode(null);
attr.setVoltageLevelId(voltageLevel.getId());
});
voltageLevel.invalidateCalculatedBuses();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ public void moveConnectable(int node, String voltageLevelId) {
throw new ValidationException(attributes.getResource(), "an equipment (" + terminal.getConnectable().getId()
+ ") is already connected to node " + node + " of voltage level " + voltageLevelId);
}
attributes.setNode(node);
attributes.setVoltageLevelId(voltageLevelId);
getAbstractIdentifiable().updateResource(res -> {
InjectionAttributes attr = attributesGetter.apply(res);
attr.setConnectableBus(null);
attr.setBus(null);
attr.setNode(node);
attr.setVoltageLevelId(voltageLevelId);
});
voltageLevel.invalidateCalculatedBuses();
}
}

0 comments on commit 8492ef9

Please sign in to comment.