Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
Signed-off-by: Etienne LESOT <[email protected]>
  • Loading branch information
EtienneLt committed Oct 10, 2024
1 parent ad26d9a commit a9d7f07
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public static void processPhaseTapRegulation(PhaseTapChanger phaseTapChanger,
regulationReports.add(regulationValueReportNode);
}
setRegulating(isModification, phaseTapChanger, phaseTapChangerAdder,
!regulationMode.equals(PhaseTapChanger.RegulationMode.CURRENT_LIMITER));
regulationMode != PhaseTapChanger.RegulationMode.CURRENT_LIMITER, regulationReports);
}

ReportNode targetDeadbandReportNode = ModificationUtils.getInstance().applyElementaryModificationsAndReturnReport(
Expand All @@ -280,11 +280,16 @@ public static void processPhaseTapRegulation(PhaseTapChanger phaseTapChanger,
}
}

private static void setRegulating(boolean isModification, PhaseTapChanger phaseTapChanger, PhaseTapChangerAdder phaseTapChangerAdder, boolean value) {
if (isModification) {
phaseTapChanger.setRegulating(value);
} else {
phaseTapChangerAdder.setRegulating(value);
private static void setRegulating(boolean isModification, PhaseTapChanger phaseTapChanger, PhaseTapChangerAdder phaseTapChangerAdder,
boolean regulating, List<ReportNode> regulationReports) {
ReportNode regulatingReportNode = ModificationUtils.getInstance().applyElementaryModificationsAndReturnReport(
isModification ? phaseTapChanger::setRegulating
: phaseTapChangerAdder::setRegulating,
isModification ? phaseTapChanger::isRegulating : () -> null,
AttributeModification.toAttributeModification(regulating, OperationType.SET),
regulating ? "Voltage regulation" : "phase tap regulating", 1);
if (regulationReports != null && regulatingReportNode != null) {
regulationReports.add(regulatingReportNode);
}
}

Expand Down

0 comments on commit a9d7f07

Please sign in to comment.