Class AbstractTapPositionModification
- java.lang.Object
-
- com.powsybl.iidm.modification.AbstractNetworkModification
-
- com.powsybl.iidm.modification.tapchanger.AbstractTapPositionModification
-
- All Implemented Interfaces:
NetworkModification
- Direct Known Subclasses:
PhaseTapPositionModification
,RatioTapPositionModification
public abstract class AbstractTapPositionModification extends AbstractNetworkModification
- Author:
- Nicolas PIERRE
-
-
Field Summary
Fields Modifier and Type Field Description static String
TRANSFORMER_STR
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTapPositionModification(String transformerId, int tapPosition, ThreeWindingsTransformer.Side legSide)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(Network network, boolean throwException, ComputationManager computationManager, Reporter reporter)
Applies the modification to the given network.protected ThreeWindingsTransformer.Leg
getLeg(ThreeWindingsTransformer threeWindingsTransformer, Predicate<ThreeWindingsTransformer.Leg> isTapHolder, boolean throwException)
ThreeWindingsTransformer.Side
getLegSide()
Optional<ThreeWindingsTransformer.Side>
getOptionalLeg()
int
getTapPosition()
String
getTransformerId()
-
Methods inherited from class com.powsybl.iidm.modification.AbstractNetworkModification
apply, apply, apply, apply, apply, logOrThrow
-
-
-
-
Field Detail
-
TRANSFORMER_STR
public static final String TRANSFORMER_STR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractTapPositionModification
protected AbstractTapPositionModification(String transformerId, int tapPosition, ThreeWindingsTransformer.Side legSide)
- Parameters:
tapPosition
- the new tap positionlegSide
- defines on which leg of the three winding transformer the modification will be done. Ifnull
on three windings transformer,AbstractNetworkModification.apply(Network)
will search for a unique rtc. Ignored on two windings transformers.
-
-
Method Detail
-
apply
public void apply(Network network, boolean throwException, ComputationManager computationManager, Reporter reporter)
Description copied from interface:NetworkModification
Applies the modification to the given network. If throwException is set to true, then in case of error, an exception will be thrown. Otherwise, computation will continue but the injection will not be added to the network in case of error.
-
getLeg
protected ThreeWindingsTransformer.Leg getLeg(ThreeWindingsTransformer threeWindingsTransformer, Predicate<ThreeWindingsTransformer.Leg> isTapHolder, boolean throwException)
- Parameters:
isTapHolder
- predicate to test if the leg has the correct Tap- Returns:
- The leg either indicated in the constructor, or the unique one matching the predicate, null otherwise
-
getTransformerId
public String getTransformerId()
-
getTapPosition
public int getTapPosition()
-
getOptionalLeg
public Optional<ThreeWindingsTransformer.Side> getOptionalLeg()
-
getLegSide
public ThreeWindingsTransformer.Side getLegSide()
-
-