Skip to content

Commit bfe8da7

Browse files
authored
Renaming MAXIMUM_SUSCEPTANCE to MAX_SUSCEPTANCE for modification by filter and by formula (#13)
Signed-off-by: Thang PHAM <[email protected]>
1 parent 3b3f273 commit bfe8da7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/main/java/org/gridsuite/modification/dto/byfilter/equipmentfield/ShuntCompensatorField.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
public enum ShuntCompensatorField {
2626
MAXIMUM_SECTION_COUNT,
2727
SECTION_COUNT,
28-
MAXIMUM_SUSCEPTANCE,
28+
MAX_SUSCEPTANCE,
2929
MAX_Q_AT_NOMINAL_V;
3030

3131
public static String getReferenceValue(ShuntCompensator shuntCompensator, String shuntCompensatorField) {
@@ -35,7 +35,7 @@ public static String getReferenceValue(ShuntCompensator shuntCompensator, String
3535
return switch (field) {
3636
case MAXIMUM_SECTION_COUNT -> String.valueOf(shuntCompensator.getMaximumSectionCount());
3737
case SECTION_COUNT -> String.valueOf(shuntCompensator.getSectionCount());
38-
case MAXIMUM_SUSCEPTANCE -> String.valueOf(bPerSection * shuntCompensator.getMaximumSectionCount());
38+
case MAX_SUSCEPTANCE -> String.valueOf(bPerSection * shuntCompensator.getMaximumSectionCount());
3939
case MAX_Q_AT_NOMINAL_V -> String.valueOf(Math.abs(Math.pow(voltageLevel.getNominalV(), 2) * bPerSection) * shuntCompensator.getMaximumSectionCount());
4040
};
4141
}
@@ -56,7 +56,7 @@ public static void setNewValue(ShuntCompensator shuntCompensator, String shuntCo
5656
case MAXIMUM_SECTION_COUNT -> modifyMaximumSectionCount(new AttributeModification<>((int) Double.parseDouble(newValue), OperationType.SET),
5757
null, null, null, shuntCompensator, model);
5858
case SECTION_COUNT -> modifySectionCount(new AttributeModification<>((int) Double.parseDouble(newValue), OperationType.SET), null, shuntCompensator);
59-
case MAXIMUM_SUSCEPTANCE -> modifyMaxSusceptance(new AttributeModification<>(Double.parseDouble(newValue), OperationType.SET),
59+
case MAX_SUSCEPTANCE -> modifyMaxSusceptance(new AttributeModification<>(Double.parseDouble(newValue), OperationType.SET),
6060
shuntCompensator.getMaximumSectionCount(), null, model);
6161
case MAX_Q_AT_NOMINAL_V -> modifyMaximumQAtNominalVoltage(new AttributeModification<>(Double.parseDouble(newValue), OperationType.SET),
6262
voltageLevel, shuntCompensator.getMaximumSectionCount(), null, model, shuntCompensatorType);

src/test/java/org/gridsuite/modification/modifications/byfilter/assignment/ShuntCompensatorModificationByAssignmentTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ protected List<AssignmentInfos<?>> getAssignmentInfos() {
110110
.build();
111111

112112
DoubleAssignmentInfos assignmentInfos3 = DoubleAssignmentInfos.builder()
113-
.editedField(ShuntCompensatorField.MAXIMUM_SUSCEPTANCE.name())
113+
.editedField(ShuntCompensatorField.MAX_SUSCEPTANCE.name())
114114
.value(5.)
115115
.filters(List.of(filter4))
116116
.build();

src/test/java/org/gridsuite/modification/modifications/byfilter/formula/ShuntCompensatorByFormulaModificationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ protected List<FormulaInfos> getFormulaInfos() {
117117
ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAXIMUM_SECTION_COUNT.name()).build(),
118118
ReferenceFieldOrValue.builder().value(2.).build());
119119

120-
FormulaInfos formulaInfos3 = getFormulaInfo(ShuntCompensatorField.MAXIMUM_SUSCEPTANCE.name(),
120+
FormulaInfos formulaInfos3 = getFormulaInfo(ShuntCompensatorField.MAX_SUSCEPTANCE.name(),
121121
List.of(filter4),
122122
Operator.ADDITION,
123-
ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAXIMUM_SUSCEPTANCE.name()).build(),
123+
ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAX_SUSCEPTANCE.name()).build(),
124124
ReferenceFieldOrValue.builder().value(5.).build());
125125

126126
FormulaInfos formulaInfos4 = getFormulaInfo(ShuntCompensatorField.MAX_Q_AT_NOMINAL_V.name(),

0 commit comments

Comments
 (0)