Skip to content

Commit

Permalink
deal with open switches
Browse files Browse the repository at this point in the history
Signed-off-by: Sophie Frasnedo <[email protected]>
  • Loading branch information
So-Fras authored and flo-dup committed Jun 7, 2023
1 parent d739e7e commit f968614
Show file tree
Hide file tree
Showing 3 changed files with 474 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ public static ConnectivityNode createConnectivityNode(VoltageLevelGraph graph, S

public static SwitchNode createSwitchNode(VoltageLevelGraph graph, String id, String name, String componentType, boolean fictitious, SwitchKind kind, boolean open) {
SwitchNode sn = new SwitchNode(id, name, componentType, fictitious, kind, open);
sn.setDisconnected(open);
graph.addNode(sn);
return sn;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,18 @@ void testDisconnected3wt() {
toSVG(g, "/disconnected3wtBusBreaker.svg", getDefaultDiagramLabelProvider(), getDefaultDiagramStyleProvider()));
}

@Test
void testOpenSwitch() {
// build graph
graphBuilder = new NetworkGraphBuilder(network);
VoltageLevelGraph g = graphBuilder.buildVoltageLevelGraph(network.getVoltageLevel("VL1").getId());

// Run layout
voltageLevelGraphLayout(g);

// write SVG and compare to reference
assertEquals(toString("/openSwitchBusBreaker.svg"),
toSVG(g, "/openSwitchBusBreaker.svg", getDefaultDiagramLabelProvider(), getDefaultDiagramStyleProvider()));
}

}
Loading

0 comments on commit f968614

Please sign in to comment.