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

Improve reporting of connectivity modifications when voltage levels or bus bar sections contain null values #517

Merged
merged 3 commits into from
Aug 20, 2024
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 @@ -612,6 +612,14 @@ public ReportNode modifyInjectionConnectivityAttributes(ConnectablePosition<?> c
InjectionModificationInfos modificationInfos,
ReportNode connectivityReports) {
List<ReportNode> reports = new ArrayList<>();
if (modificationInfos.getVoltageLevelId() == null || modificationInfos.getBusOrBusbarSectionId() == null) {
return ReportNode.newRootReportNode()
.withMessageTemplate("VoltageLevelOrBusbarSectionNotFound",
"Voltage level id or Bus bar section id of equipment id=${id} not found")
.withUntypedValue("id", modificationInfos.getEquipmentId())
.withSeverity(TypedValue.WARN_SEVERITY)
.build();
}
if (connectablePosition != null) {
modifyExistingConnectivityPosition(connectablePosition, modificationInfos, reports);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ protected ModificationInfos buildModification() {
.stashed(false)
.equipmentId("v3Battery")
.equipmentName(new AttributeModification<>("newV1Battery", OperationType.SET))
.voltageLevelId(new AttributeModification<>("v2", OperationType.SET))
.busOrBusbarSectionId(new AttributeModification<>("1B", OperationType.SET))
.targetP(new AttributeModification<>(80.0, OperationType.SET))
.targetQ(new AttributeModification<>(40.0, OperationType.SET))
.minP(new AttributeModification<>(0., OperationType.SET))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ protected ModificationInfos buildModification() {
.equipmentId("idGenerator")
.energySource(new AttributeModification<>(EnergySource.SOLAR, OperationType.SET))
.equipmentName(new AttributeModification<>("newV1Generator", OperationType.SET))
.voltageLevelId(new AttributeModification<>("v2", OperationType.SET))
.busOrBusbarSectionId(new AttributeModification<>("1B", OperationType.SET))
.targetP(new AttributeModification<>(80.0, OperationType.SET))
.targetQ(new AttributeModification<>(40.0, OperationType.SET))
.targetV(new AttributeModification<>(48.0, OperationType.SET))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ protected ModificationInfos buildModification() {
.equipmentId("v1load")
.equipmentName(new AttributeModification<>("nameLoad1", OperationType.SET))
.loadType(new AttributeModification<>(LoadType.FICTITIOUS, OperationType.SET))
.voltageLevelId(new AttributeModification<>("v2", OperationType.SET))
.busOrBusbarSectionId(new AttributeModification<>("1B", OperationType.SET))
.p0(new AttributeModification<>(200.0, OperationType.SET))
.q0(new AttributeModification<>(30.0, OperationType.SET))
.properties(List.of(FreePropertyInfos.builder().name(PROPERTY_NAME).value(PROPERTY_VALUE).build()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ public void testDisconnection() throws Exception {
ShuntCompensatorModificationInfos.builder()
.stashed(false)
.equipmentId("v2shunt")
.voltageLevelId(new AttributeModification<>("v2", OperationType.SET))
.busOrBusbarSectionId(new AttributeModification<>("1B", OperationType.SET))
.build();
assertChangeConnectionState(getNetwork().getShuntCompensator("v2shunt"), shuntModificationInfos, false);
}
Expand All @@ -333,6 +335,8 @@ public void testConnection() throws Exception {
ShuntCompensatorModificationInfos.builder()
.stashed(false)
.equipmentId("v2shunt")
.voltageLevelId(new AttributeModification<>("v2", OperationType.SET))
.busOrBusbarSectionId(new AttributeModification<>("1B", OperationType.SET))
.build();
assertChangeConnectionState(getNetwork().getShuntCompensator("v2shunt"), shuntModificationInfos, true);
}
Expand Down
Loading