diff --git a/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/TwoWindingsTransformerField.java b/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/TwoWindingsTransformerField.java index 6a13e93d6..8e5382c13 100644 --- a/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/TwoWindingsTransformerField.java +++ b/src/main/java/org/gridsuite/modification/server/dto/formula/equipmentfield/TwoWindingsTransformerField.java @@ -69,14 +69,14 @@ public static void setNewValue(TwoWindingsTransformer transformer, String twoWin null, new AttributeModification<>(newValue.intValue(), OperationType.SET), null, null); case RATIO_TARGET_DEADBAND -> modifyTargets(ratioTapChanger, null, true, null, attributeModification, null); case REGULATION_VALUE -> processPhaseTapRegulation( - phaseTapChanger, null, regulationMode, true, attributeModification, null, null + phaseTapChanger, null, regulationMode, true, attributeModification, null, null, null ); case PHASE_LOW_TAP_POSITION -> processTapChangerPositionsAndSteps(phaseTapChanger, null, true, new AttributeModification<>(newValue.intValue(), OperationType.SET), null, null, null); case PHASE_TAP_POSITION -> processTapChangerPositionsAndSteps(phaseTapChanger, null, true, null, new AttributeModification<>(newValue.intValue(), OperationType.SET), null, null); case PHASE_TARGET_DEADBAND -> processPhaseTapRegulation( - phaseTapChanger, null, null, true, null, attributeModification, null + phaseTapChanger, null, null, true, null, attributeModification, null, null ); } } diff --git a/src/main/java/org/gridsuite/modification/server/modifications/TwoWindingsTransformerModification.java b/src/main/java/org/gridsuite/modification/server/modifications/TwoWindingsTransformerModification.java index 3676e0b01..a3ab93d51 100644 --- a/src/main/java/org/gridsuite/modification/server/modifications/TwoWindingsTransformerModification.java +++ b/src/main/java/org/gridsuite/modification/server/modifications/TwoWindingsTransformerModification.java @@ -215,8 +215,9 @@ private void processPhaseTapChanger(Network network, regulationMode = phaseTapChangerInfos.getRegulationMode().getValue(); } if (!PhaseTapChanger.RegulationMode.FIXED_TAP.equals(regulationMode)) { - processPhaseTapRegulation(phaseTapChanger, phaseTapChangerAdder, regulationMode, isModification, phaseTapChangerInfos.getRegulationValue(), phaseTapChangerInfos.getTargetDeadband(), regulationReports - ); + processPhaseTapRegulation(phaseTapChanger, phaseTapChangerAdder, regulationMode, isModification, + phaseTapChangerInfos.getRegulationValue(), phaseTapChangerInfos.getTargetDeadband(), + phaseTapChangerInfos.getRegulating(), regulationReports); } processRegulatingTerminal(phaseTapChangerInfos, phaseTapChanger, phaseTapChangerAdder, regulationReports, @@ -254,6 +255,7 @@ public static void processPhaseTapRegulation(PhaseTapChanger phaseTapChanger, boolean isModification, AttributeModification modifyRegulationValue, AttributeModification modifyTargetDeadband, + AttributeModification regulating, List regulationReports) { if (regulationMode != null) { @@ -284,8 +286,8 @@ public static void processPhaseTapRegulation(PhaseTapChanger phaseTapChanger, isModification ? phaseTapChanger::setRegulating : phaseTapChangerAdder::setRegulating, isModification ? phaseTapChanger::isRegulating : () -> null, - phaseTapChangerInfos.getRegulating(), "Regulating", 2); - if (regulatingReport != null) { + regulating, "Regulating", 2); + if (regulationReports != null && regulatingReport != null) { regulationReports.add(regulatingReport); } }