Skip to content

Commit

Permalink
First try at creating builders from existing object (only with defaul…
Browse files Browse the repository at this point in the history
…t implementation, not in merging view)

Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>
  • Loading branch information
miovd committed Jul 15, 2021
1 parent 1be46cb commit 0829a17
Show file tree
Hide file tree
Showing 27 changed files with 552 additions and 126 deletions.
14 changes: 14 additions & 0 deletions iidm/iidm-api/src/main/java/com/powsybl/iidm/network/Network.java
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,13 @@ static PrettyNetworkFactory with(String name) {
*/
LineAdder newLine();

/**
* Get a builder to create a new AC line. The builder is initialized with all the values of the given AC line.
*/
default LineAdder newLine(Line line) {
return newLine();
}

/**
* Get all AC lines.
*/
Expand Down Expand Up @@ -718,6 +725,13 @@ default HvdcLine getHvdcLine(HvdcConverterStation converterStation) {
*/
HvdcLineAdder newHvdcLine();

/**
* Get a builder to create a new HVDC line. The builder is initialized with all the values of the given HVDC line.
*/
default HvdcLineAdder newHvdcLine(HvdcLine hvdcLine) {
return newHvdcLine();
}

/**
* Get an equipment by its ID or alias
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ public interface PhaseTapChangerHolder {
*/
PhaseTapChangerAdder newPhaseTapChanger();

/**
* Get a builder to create and associate a phase tap changer to the
* transformer. The builder is initialized with all the values of the given phase tap changer.
*/
default PhaseTapChangerAdder newPhaseTapChanger(PhaseTapChanger ptc) {
return newPhaseTapChanger();
}

/**
* Get the phase tap changer.
* <p>Could return <code>null</code> if the transfomer is not associated to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ public interface RatioTapChangerHolder {
*/
RatioTapChangerAdder newRatioTapChanger();

/**
* Get a builder to create and associate a ratio tap changer to the
* transformer. The builder is initialized with all the values of the given ratio tap changer.
*/
default RatioTapChangerAdder newRatioTapChanger(RatioTapChanger rtc) {
return newRatioTapChanger();
}

/**
* Get the ratio tap changer.
* <p>Could return <code>null</code> if the leg is not associated to a ratio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ public interface Substation extends Container<Substation> {
*/
VoltageLevelAdder newVoltageLevel();

/**
* Get a builder to create a new voltage level in the substation. The builder is initialized with all the values of the given voltage level.
*/
default VoltageLevelAdder newVoltageLevel(VoltageLevel voltageLevel) {
return newVoltageLevel();
}

/**
* Get the voltage levels of the substation.
*/
Expand All @@ -125,6 +132,13 @@ public interface Substation extends Container<Substation> {
*/
TwoWindingsTransformerAdder newTwoWindingsTransformer();

/**
* Get a builder to create a new two windings transformer in the substation. The builder is initialized with all the values of the given two windings transformer.
*/
default TwoWindingsTransformerAdder newTwoWindingsTransformer(TwoWindingsTransformer twt) {
return newTwoWindingsTransformer();
}

/**
* Get the two windings transformers connected to the substation.
*/
Expand All @@ -145,6 +159,13 @@ public interface Substation extends Container<Substation> {
*/
ThreeWindingsTransformerAdder newThreeWindingsTransformer();

/**
* Get a builder to create a new 3 windings transformer in the substation. The builder is initialized with all the values of a the given 3 windings transformer.
*/
default ThreeWindingsTransformerAdder newThreeWindingsTransformer(ThreeWindingsTransformer twt) {
return newThreeWindingsTransformer();
}

/**
* Get the 3 windings transformers connected to the substation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,16 @@ default HalfLineAdder setXnodeQ(double xnodeQ) {

TieLineAdder.HalfLineAdder newHalfLine1();

default TieLineAdder.HalfLineAdder newHalfLine1(TieLine.HalfLine halfLine) {
return newHalfLine1();
}

TieLineAdder.HalfLineAdder newHalfLine2();

default HalfLineAdder newHalfLine2(TieLine.HalfLine halfLine) {
return newHalfLine2();
}

TieLine add();

}
Loading

0 comments on commit 0829a17

Please sign in to comment.