From f5fb398cf3a66cf9c9b45ad25e0693528e86c198 Mon Sep 17 00:00:00 2001 From: Thang PHAM <117309322+thangqp@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:49:19 +0100 Subject: [PATCH] Renaming MAXIMUM_Q_AT_NOMINAL_VOLTAGE to MAX_Q_AT_NOMINAL_V (#11) Signed-off-by: Thang PHAM --- .../dto/byfilter/equipmentfield/ShuntCompensatorField.java | 6 +++--- .../ShuntCompensatorModificationByAssignmentTest.java | 2 +- .../formula/ShuntCompensatorByFormulaModificationTest.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/gridsuite/modification/dto/byfilter/equipmentfield/ShuntCompensatorField.java b/src/main/java/org/gridsuite/modification/dto/byfilter/equipmentfield/ShuntCompensatorField.java index f7764fe..a0fbefa 100644 --- a/src/main/java/org/gridsuite/modification/dto/byfilter/equipmentfield/ShuntCompensatorField.java +++ b/src/main/java/org/gridsuite/modification/dto/byfilter/equipmentfield/ShuntCompensatorField.java @@ -26,7 +26,7 @@ public enum ShuntCompensatorField { MAXIMUM_SECTION_COUNT, SECTION_COUNT, MAXIMUM_SUSCEPTANCE, - MAXIMUM_Q_AT_NOMINAL_VOLTAGE; + MAX_Q_AT_NOMINAL_V; public static String getReferenceValue(ShuntCompensator shuntCompensator, String shuntCompensatorField) { VoltageLevel voltageLevel = shuntCompensator.getTerminal().getVoltageLevel(); @@ -36,7 +36,7 @@ public static String getReferenceValue(ShuntCompensator shuntCompensator, String case MAXIMUM_SECTION_COUNT -> String.valueOf(shuntCompensator.getMaximumSectionCount()); case SECTION_COUNT -> String.valueOf(shuntCompensator.getSectionCount()); case MAXIMUM_SUSCEPTANCE -> String.valueOf(bPerSection * shuntCompensator.getMaximumSectionCount()); - case MAXIMUM_Q_AT_NOMINAL_VOLTAGE -> String.valueOf(Math.abs(Math.pow(voltageLevel.getNominalV(), 2) * bPerSection) * shuntCompensator.getMaximumSectionCount()); + case MAX_Q_AT_NOMINAL_V -> String.valueOf(Math.abs(Math.pow(voltageLevel.getNominalV(), 2) * bPerSection) * shuntCompensator.getMaximumSectionCount()); }; } @@ -58,7 +58,7 @@ public static void setNewValue(ShuntCompensator shuntCompensator, String shuntCo 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), shuntCompensator.getMaximumSectionCount(), null, model); - case MAXIMUM_Q_AT_NOMINAL_VOLTAGE -> modifyMaximumQAtNominalVoltage(new AttributeModification<>(Double.parseDouble(newValue), OperationType.SET), + case MAX_Q_AT_NOMINAL_V -> modifyMaximumQAtNominalVoltage(new AttributeModification<>(Double.parseDouble(newValue), OperationType.SET), voltageLevel, shuntCompensator.getMaximumSectionCount(), null, model, shuntCompensatorType); } } diff --git a/src/test/java/org/gridsuite/modification/modifications/byfilter/assignment/ShuntCompensatorModificationByAssignmentTest.java b/src/test/java/org/gridsuite/modification/modifications/byfilter/assignment/ShuntCompensatorModificationByAssignmentTest.java index d2630f9..ef77623 100644 --- a/src/test/java/org/gridsuite/modification/modifications/byfilter/assignment/ShuntCompensatorModificationByAssignmentTest.java +++ b/src/test/java/org/gridsuite/modification/modifications/byfilter/assignment/ShuntCompensatorModificationByAssignmentTest.java @@ -116,7 +116,7 @@ protected List> getAssignmentInfos() { .build(); DoubleAssignmentInfos assignmentInfos4 = DoubleAssignmentInfos.builder() - .editedField(ShuntCompensatorField.MAXIMUM_Q_AT_NOMINAL_VOLTAGE.name()) + .editedField(ShuntCompensatorField.MAX_Q_AT_NOMINAL_V.name()) .value(10.) .filters(List.of(filter5)) .build(); diff --git a/src/test/java/org/gridsuite/modification/modifications/byfilter/formula/ShuntCompensatorByFormulaModificationTest.java b/src/test/java/org/gridsuite/modification/modifications/byfilter/formula/ShuntCompensatorByFormulaModificationTest.java index 69e1e67..cb083fc 100644 --- a/src/test/java/org/gridsuite/modification/modifications/byfilter/formula/ShuntCompensatorByFormulaModificationTest.java +++ b/src/test/java/org/gridsuite/modification/modifications/byfilter/formula/ShuntCompensatorByFormulaModificationTest.java @@ -123,10 +123,10 @@ protected List getFormulaInfos() { ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAXIMUM_SUSCEPTANCE.name()).build(), ReferenceFieldOrValue.builder().value(5.).build()); - FormulaInfos formulaInfos4 = getFormulaInfo(ShuntCompensatorField.MAXIMUM_Q_AT_NOMINAL_VOLTAGE.name(), + FormulaInfos formulaInfos4 = getFormulaInfo(ShuntCompensatorField.MAX_Q_AT_NOMINAL_V.name(), List.of(filter5), Operator.DIVISION, - ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAXIMUM_Q_AT_NOMINAL_VOLTAGE.name()).build(), + ReferenceFieldOrValue.builder().equipmentField(ShuntCompensatorField.MAX_Q_AT_NOMINAL_V.name()).build(), ReferenceFieldOrValue.builder().value(2.).build()); return List.of(formulaInfos1, formulaInfos2, formulaInfos3, formulaInfos4);