Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ghazwarhili committed Sep 5, 2024
1 parent a01d340 commit b902bf1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class BatteryCreation extends AbstractModification {
private final BatteryCreationInfos modificationInfos;
private static final String LIMITS = "Limits";
private static final String ACTIVE_LIMITS = "Active limits";
private static final String CONNECTIVITY = "Connectivity";

public BatteryCreation(BatteryCreationInfos modificationInfos) {
this.modificationInfos = modificationInfos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class GeneratorCreation extends AbstractModification {
private final GeneratorCreationInfos modificationInfos;
private static final String LIMITS = "Limits";
private static final String ACTIVE_LIMITS = "Active limits";
private static final String CONNECTIVITY = "Connectivity";

public GeneratorCreation(GeneratorCreationInfos modificationInfos) {
this.modificationInfos = modificationInfos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public final class ModificationUtils {
public static final String BUS_BAR_SECTION_ID = "busbarSectionId";

public static final String DOES_NOT_EXIST_IN_NETWORK = " does not exist in network";
public static final String EQUIPMENT_DISCONNECTED = "equipmentDisconnected";
public static final String NO_VALUE = "No value";
public static final String LIMITS = "Limits";
public static final String REACTIVE_LIMITS = "Reactive limits";
Expand Down Expand Up @@ -603,7 +604,7 @@ public void disconnectCreatedInjection(InjectionCreationInfos modificationInfos,
if (!modificationInfos.isTerminalConnected()) {
injection.getTerminal().disconnect();
subReportNode.newReportNode()
.withMessageTemplate("equipmentDisconnected", "Equipment with id=${id} disconnected")
.withMessageTemplate(EQUIPMENT_DISCONNECTED, "Equipment with id=${id} disconnected")
.withUntypedValue("id", modificationInfos.getEquipmentId())
.withSeverity(TypedValue.INFO_SEVERITY)
.add();
Expand Down Expand Up @@ -707,7 +708,7 @@ public void modifyInjectionConnection(InjectionModificationInfos modificationInf
String.format("Could not disconnect equipment '%s'", injection.getId()));
}
subReportNode.add(ReportNode.newRootReportNode()
.withMessageTemplate("equipmentDisconnected", " Equipment with id=${id} disconnected")
.withMessageTemplate(EQUIPMENT_DISCONNECTED, " Equipment with id=${id} disconnected")
.withUntypedValue("id", modificationInfos.getEquipmentId())
.withSeverity(TypedValue.INFO_SEVERITY)
.build());
Expand Down Expand Up @@ -1357,19 +1358,19 @@ public static void reportInjectionCreationConnectivity(InjectionCreationInfos in
List<ReportNode> connectivityReports = new ArrayList<>();
if (injectionCreationInfos.getConnectionName() != null) {
connectivityReports.add(ModificationUtils.getInstance()
.buildCreationReport(injectionCreationInfos.getConnectionName(), "Connection name"));
.buildCreationReport(injectionCreationInfos.getConnectionName(), CONNECTION_NAME_FIELD_NAME));
}
if (injectionCreationInfos.getConnectionDirection() != null) {
connectivityReports.add(ModificationUtils.getInstance()
.buildCreationReport(injectionCreationInfos.getConnectionDirection(), "Connection direction"));
.buildCreationReport(injectionCreationInfos.getConnectionDirection(), CONNECTION_DIRECTION_FIELD_NAME));
}
if (injectionCreationInfos.getConnectionPosition() != null) {
connectivityReports.add(ModificationUtils.getInstance()
.buildCreationReport(injectionCreationInfos.getConnectionPosition(), "Connection position"));
.buildCreationReport(injectionCreationInfos.getConnectionPosition(), CONNECTION_POSITION_FIELD_NAME));
}
if (!injectionCreationInfos.isTerminalConnected()) {
connectivityReports.add(ReportNode.newRootReportNode()
.withMessageTemplate("equipmentDisconnected", " Equipment with id=${id} disconnected")
.withMessageTemplate(EQUIPMENT_DISCONNECTED, " Equipment with id=${id} disconnected")
.withUntypedValue("id", injectionCreationInfos.getEquipmentId())
.withSeverity(TypedValue.INFO_SEVERITY)
.build());
Expand Down

0 comments on commit b902bf1

Please sign in to comment.