Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add missing fictitious nodes #167

Merged
merged 1 commit into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,16 @@ protected void add3wtFeeder(Middle3WTNode middleNode, Feeder3WTLegNode firstOthe
}
}

protected Node connectToBus(Graph graph, SwitchNode sw, Bus bus) {
Objects.requireNonNull(graph);
Objects.requireNonNull(sw);
String id = bus.getId() + "_" + sw.getId();
Node newNode = new BusBreakerConnection(graph, id);
graph.addNode(newNode);
graph.addEdge(newNode, sw);
return newNode;
}

private void buildBusBreakerGraph(Graph graph, VoltageLevel vl) {
Map<String, Node> nodesByBusId = new HashMap<>();

Expand All @@ -435,11 +445,12 @@ private void buildBusBreakerGraph(Graph graph, VoltageLevel vl) {
SwitchNode n = createSwitchNodeFromSwitch(graph, sw);

Bus bus1 = vl.getBusBreakerView().getBus1(sw.getId());
Node cnode1 = connectToBus(graph, n, bus1);
Bus bus2 = vl.getBusBreakerView().getBus2(sw.getId());

Node cnode2 = connectToBus(graph, n, bus2);
graph.addNode(n);
graph.addEdge(nodesByBusId.get(bus1.getId()), n);
graph.addEdge(n, nodesByBusId.get(bus2.getId()));
graph.addEdge(nodesByBusId.get(bus1.getId()), cnode2);
graph.addEdge(cnode1, nodesByBusId.get(bus2.getId()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ public void coordHorizontalCase(LayoutParameters layoutParam) {
int h = 0;
for (Node node : nodes) {
node.setY(getCoord().getY());
node.setX(x0 + xPxStep * h);
if (!(node instanceof BusBreakerConnection)) {
node.setX(x0 + xPxStep * h);
}
node.setRotationAngle(90.);
h++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@
<subComponent name="BUSBREAKER_CONNECTION">
<fileName>busbreaker_connection.svg</fileName>
</subComponent>
<anchorPoint x="0" y="0" orientation="VERTICAL"/>
<anchorPoint x="4" y="0" orientation="HORIZONTAL"/>
<anchorPoint x="-4" y="0" orientation="HORIZONTAL"/>
<anchorPoint x="0" y="-4" orientation="VERTICAL"/>
<anchorPoint x="0" y="-4" orientation="VERTICAL"/>
<allowRotation>true</allowRotation>
</metadata>
</component>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"open" : false
}, {
"type" : "FICTITIOUS",
"id" : "FICT_vl_swfNode",
"name" : "swfNode",
"equipmentId" : "swfNode",
"componentType" : "NODE",
"id" : "FICT_vl_b2_sw",
"name" : "b2_sw",
"equipmentId" : "b2_sw",
"componentType" : "BUSBREAKER_CONNECTION",
"fictitious" : true,
"x" : 75.0,
"y" : 220.0,
"y" : 260.0,
"rotationAngle" : 90.0,
"open" : false
}, {
Expand Down Expand Up @@ -109,17 +109,6 @@
"rotationAngle" : 90.0,
"open" : false,
"kind" : "BREAKER"
}, {
"type" : "SWITCH",
"id" : "swfSwitch",
"name" : "swfSwitch",
"equipmentId" : "swfSwitch",
"componentType" : "NODE",
"fictitious" : true,
"x" : 75.0,
"y" : 260.0,
"open" : false,
"kind" : "BREAKER"
}, {
"type" : "SWITCH",
"id" : "swfSwitch",
Expand Down Expand Up @@ -197,7 +186,7 @@
"xSpan" : 0.0,
"ySpan" : 0.0
},
"nodes" : [ "FICT_vl_swfNode", "sw", "FICT_vl_swfNode" ]
"nodes" : [ "FICT_vl_swfNode", "sw", "FICT_vl_b2_sw" ]
}, {
"type" : "LEGPRIMARY",
"cardinalities" : [ {
Expand All @@ -218,7 +207,7 @@
"xSpan" : 50.0,
"ySpan" : 0.0
},
"nodes" : [ "b1", "swfSwitch", "FICT_vl_swfNode" ]
"nodes" : [ "b1", "FICT_vl_b2_sw" ]
} ]
}
}, {
Expand Down Expand Up @@ -298,14 +287,11 @@
"node1" : "FICT_vl_b1_l",
"node2" : "l"
}, {
"node1" : "b1",
"node2" : "swfSwitch"
}, {
"node1" : "swfSwitch",
"node2" : "FICT_vl_swfNode"
}, {
"node1" : "FICT_vl_swfNode",
"node1" : "FICT_vl_b2_sw",
"node2" : "sw"
}, {
"node1" : "b1",
"node2" : "FICT_vl_b2_sw"
}, {
"node1" : "b2",
"node2" : "swfSwitch"
Expand Down