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

corrects Move connectable implementation in order to execute tcks on the network store server #447

Merged
merged 6 commits into from
Sep 17, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
introduce variable
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
Mathieu-Deharbe committed Sep 10, 2024
commit d40ef06b2b72d106e641276fdb94846d33b27119
Original file line number Diff line number Diff line change
@@ -147,10 +147,11 @@ public void moveConnectable(String busId, boolean connected) {
+ " to bus " + busId + " of voltage level " + bus.getVoltageLevel().getId() + ", which is a node breaker voltage level");
}
getAbstractIdentifiable().updateResource(res -> {
attributesGetter.apply(res).setConnectableBus(busId);
attributesGetter.apply(res).setBus(connected ? busId : null);
attributesGetter.apply(res).setNode(null);
attributesGetter.apply(res).setVoltageLevelId(voltageLevel.getId());
InjectionAttributes attr = attributesGetter.apply(res);
attr.setConnectableBus(busId);
attr.setBus(connected ? busId : null);
attr.setNode(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you explain the reason to set null value for node in this case ?

Copy link
Contributor Author

@Mathieu-Deharbe Mathieu-Deharbe Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because an equipment may be connected by Node (in node breaker view) of by bus (in bus breaker view). When you affect one of those values the other makes no sense anymore (and this may cause problems of you reaffect to the previous value, like in the unit tests).

However this brings a good question : may an equipment be connected to a bus and a node simultaneously in the same voltage level ? In the unit test the bus breaker view and the node breaker view were in different voltage levels so the previous value had to be nulled.

I don't really know the answer, what do you say @geofjamg ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Geoffroy told me that a voltage level can only be in node breaker OR bus breaker. Therefore it is impossible to be connected at the same to a node and to a bus in the same voltage level. And therefore setting the other to null should be fine.

attr.setVoltageLevelId(voltageLevel.getId());
});
voltageLevel.invalidateCalculatedBuses();
}
Original file line number Diff line number Diff line change
@@ -71,10 +71,11 @@ public void moveConnectable(int node, String voltageLevelId) {
+ ") is already connected to node " + node + " of voltage level " + voltageLevelId);
}
getAbstractIdentifiable().updateResource(res -> {
attributesGetter.apply(res).setConnectableBus(null);
attributesGetter.apply(res).setBus(null);
attributesGetter.apply(res).setNode(node);
attributesGetter.apply(res).setVoltageLevelId(voltageLevelId);
InjectionAttributes attr = attributesGetter.apply(res);
attr.setConnectableBus(null);
attr.setBus(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same remarks for Bus and connectableBus

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and same answer as well.

attr.setNode(node);
attr.setVoltageLevelId(voltageLevelId);
});
voltageLevel.invalidateCalculatedBuses();
}