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

Renaming MAXIMUM_SUSCEPTANCE to MAX_SUSCEPTANCE for modification by filter and by formula #13

Merged
merged 4 commits into from
Dec 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 @@ -25,7 +25,7 @@
public enum ShuntCompensatorField {
MAXIMUM_SECTION_COUNT,
SECTION_COUNT,
MAXIMUM_SUSCEPTANCE,
MAX_SUSCEPTANCE,
MAX_Q_AT_NOMINAL_V;

public static String getReferenceValue(ShuntCompensator shuntCompensator, String shuntCompensatorField) {
Expand All @@ -35,7 +35,7 @@ public static String getReferenceValue(ShuntCompensator shuntCompensator, String
return switch (field) {
case MAXIMUM_SECTION_COUNT -> String.valueOf(shuntCompensator.getMaximumSectionCount());
case SECTION_COUNT -> String.valueOf(shuntCompensator.getSectionCount());
case MAXIMUM_SUSCEPTANCE -> String.valueOf(bPerSection * shuntCompensator.getMaximumSectionCount());
case MAX_SUSCEPTANCE -> String.valueOf(bPerSection * shuntCompensator.getMaximumSectionCount());
case MAX_Q_AT_NOMINAL_V -> String.valueOf(Math.abs(Math.pow(voltageLevel.getNominalV(), 2) * bPerSection) * shuntCompensator.getMaximumSectionCount());
};
}
Expand All @@ -56,7 +56,7 @@ public static void setNewValue(ShuntCompensator shuntCompensator, String shuntCo
case MAXIMUM_SECTION_COUNT -> modifyMaximumSectionCount(new AttributeModification<>((int) Double.parseDouble(newValue), OperationType.SET),
null, null, null, shuntCompensator, model);
case SECTION_COUNT -> modifySectionCount(new AttributeModification<>((int) Double.parseDouble(newValue), OperationType.SET), null, shuntCompensator);
case MAXIMUM_SUSCEPTANCE -> modifyMaxSusceptance(new AttributeModification<>(Double.parseDouble(newValue), OperationType.SET),
case MAX_SUSCEPTANCE -> modifyMaxSusceptance(new AttributeModification<>(Double.parseDouble(newValue), OperationType.SET),
shuntCompensator.getMaximumSectionCount(), null, model);
case MAX_Q_AT_NOMINAL_V -> modifyMaximumQAtNominalVoltage(new AttributeModification<>(Double.parseDouble(newValue), OperationType.SET),
voltageLevel, shuntCompensator.getMaximumSectionCount(), null, model, shuntCompensatorType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected List<AssignmentInfos<?>> getAssignmentInfos() {
.build();

DoubleAssignmentInfos assignmentInfos3 = DoubleAssignmentInfos.builder()
.editedField(ShuntCompensatorField.MAXIMUM_SUSCEPTANCE.name())
.editedField(ShuntCompensatorField.MAX_SUSCEPTANCE.name())
.value(5.)
.filters(List.of(filter4))
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ protected List<FormulaInfos> getFormulaInfos() {
ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAXIMUM_SECTION_COUNT.name()).build(),
ReferenceFieldOrValue.builder().value(2.).build());

FormulaInfos formulaInfos3 = getFormulaInfo(ShuntCompensatorField.MAXIMUM_SUSCEPTANCE.name(),
FormulaInfos formulaInfos3 = getFormulaInfo(ShuntCompensatorField.MAX_SUSCEPTANCE.name(),
List.of(filter4),
Operator.ADDITION,
ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAXIMUM_SUSCEPTANCE.name()).build(),
ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAX_SUSCEPTANCE.name()).build(),
ReferenceFieldOrValue.builder().value(5.).build());

FormulaInfos formulaInfos4 = getFormulaInfo(ShuntCompensatorField.MAX_Q_AT_NOMINAL_V.name(),
Expand Down
Loading