Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into modification_apply_ob…
Browse files Browse the repository at this point in the history
…serve
  • Loading branch information
LE SAULNIER Kevin committed Aug 23, 2024
2 parents 8b8af7b + 8ddff16 commit d60089a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<groupId>org.gridsuite</groupId>
<artifactId>gridsuite-filter</artifactId>
<!-- FIXME: gridsuite-filter modules' version is overloaded in the dependencies section. The overloads and this property below have to be removed at next gridsuite-dependencies.version upgrade -->
<version>1.0.12</version>
<version>1.0.13</version>
</dependency>
<dependency>
<groupId>com.powsybl</groupId>
Expand Down
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

0 comments on commit d60089a

Please sign in to comment.