Skip to content

Commit

Permalink
Use core Action to apply the pst range action
Browse files Browse the repository at this point in the history
Signed-off-by: Pauline Jean-Marie <[email protected]>
  • Loading branch information
Pauline Jean-Marie committed Jun 7, 2024
1 parent d1cb352 commit 2ff578f
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package com.powsybl.openrao.data.cracimpl;

import com.powsybl.action.PhaseTapChangerTapPositionActionBuilder;
import com.powsybl.openrao.commons.OpenRaoException;
import com.powsybl.openrao.data.cracapi.*;
import com.powsybl.openrao.data.cracapi.rangeaction.PstRangeAction;
Expand Down Expand Up @@ -108,9 +109,16 @@ public double getMaxAdmissibleSetpoint(double previousInstantSetPoint) {

@Override
public void apply(Network network, double targetAngle) {
PhaseTapChanger phaseTapChanger = getPhaseTapChanger(network);
getPhaseTapChanger(network);
int tap = convertAngleToTap(targetAngle);
phaseTapChanger.setTapPosition(tap);
new PhaseTapChangerTapPositionActionBuilder()
.withId("id")
.withNetworkElementId(networkElement.getId())
.withTapPosition(tap)
.withRelativeValue(false)
.build()
.toModification()
.apply(network);
}

@Override
Expand Down

0 comments on commit 2ff578f

Please sign in to comment.