Skip to content

Commit

Permalink
[NAD] Unknown bus corner cases (#619)
Browse files Browse the repository at this point in the history
* Modify existing unit test for unknown bus corner cases
* Fix wrong annulus calculation

Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
  • Loading branch information
flo-dup authored Jun 19, 2024
1 parent 9988566 commit a53c42d
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 155 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,11 @@ private List<Double> createSortedTraversingAnglesList(List<Edge> traversingBusEd
}

private boolean isBusNodeDrawn(Node busGraphNode, BusNode busNodeCurrentlyDrawn) {
if (busGraphNode instanceof BusNode) {
return ((BusNode) busGraphNode).getIndex() < busNodeCurrentlyDrawn.getIndex();
if (busGraphNode == BusNode.UNKNOWN) {
return false;
}
if (busGraphNode instanceof BusNode busGraphBusNode) {
return busGraphBusNode.getIndex() < busNodeCurrentlyDrawn.getIndex();
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ void testDisconnection() {
network.getLine("L3-4-1").getTerminal1().disconnect();
network.getTwoWindingsTransformer("T4-7-1").getTerminal1().disconnect();
network.getVoltageLevel("VL14").getConnectableStream().map(connectable -> (Connectable<?>) connectable).forEach(connectable -> connectable.getTerminals().forEach(Terminal::disconnect));
network.getVoltageLevel("VL5").getBusView().getBusStream().findFirst()
.ifPresent(bus -> bus.getConnectedTerminals().forEach(Terminal::disconnect));
network.getVoltageLevel("VL4").getBusView().getBusStream().findFirst()
.ifPresent(bus -> bus.getConnectedTerminals().forEach(Terminal::disconnect));
assertEquals(toString("/IEEE_14_bus_disconnection.svg"), generateSvgString(network, "/IEEE_14_bus_disconnection.svg"));
}

Expand Down
Loading

0 comments on commit a53c42d

Please sign in to comment.