diff --git a/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/models/loads/LoadTwoTransformersTapChangersGroovyExtension.groovy b/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/models/loads/LoadTwoTransformersTapChangersGroovyExtension.groovy index 18bf77353..c7a1b56c1 100644 --- a/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/models/loads/LoadTwoTransformersTapChangersGroovyExtension.groovy +++ b/dynawaltz-dsl/src/main/groovy/com/powsybl/dynawaltz/dsl/models/loads/LoadTwoTransformersTapChangersGroovyExtension.groovy @@ -21,8 +21,14 @@ import com.powsybl.iidm.network.Network @AutoService(DynamicModelGroovyExtension.class) class LoadTwoTransformersTapChangersGroovyExtension extends AbstractSimpleEquipmentGroovyExtension { + private static final BASE_LIB = "LoadTwoTransformersTapChangers" + LoadTwoTransformersTapChangersGroovyExtension() { - super("LoadTwoTransformersTapChangers") + super(BASE_LIB) + } + + protected LoadTwoTransformersTapChangersGroovyExtension(String lib) { + super(lib) } @Override @@ -38,7 +44,7 @@ class LoadTwoTransformersTapChangersGroovyExtension extends AbstractSimpleEquipm @Override LoadTwoTransformersTapChangers build() { - isInstantiable() ? new LoadTwoTransformersTapChangers(dynamicModelId, equipment, parameterSetId) : null + isInstantiable() ? new LoadTwoTransformersTapChangers(dynamicModelId, equipment, parameterSetId, equipmentConfig.lib) : null } } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java index eb17b9c4c..e4bc5f809 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java @@ -24,8 +24,8 @@ */ public class LoadTwoTransformersTapChangers extends LoadTwoTransformers implements TapChangerModel { - public LoadTwoTransformersTapChangers(String dynamicModelId, Load load, String parameterSetId) { - super(dynamicModelId, load, parameterSetId, "LoadTwoTransformersTapChangers"); + public LoadTwoTransformersTapChangers(String dynamicModelId, Load load, String parameterSetId, String lib) { + super(dynamicModelId, load, parameterSetId, lib); } @Override diff --git a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/LoadsModelXmlTest.java b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/LoadsModelXmlTest.java index 094284203..a7acb5640 100644 --- a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/LoadsModelXmlTest.java +++ b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/LoadsModelXmlTest.java @@ -60,7 +60,7 @@ private static Stream provideLoads() { Arguments.of("load_one_transformer_dyd", (Function) n -> new LoadOneTransformer(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LOT")), Arguments.of("load_one_transformer_tap_changer_dyd", (Function) n -> new LoadOneTransformerTapChanger(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LOTTC")), Arguments.of("load_two_transformers_dyd", (Function) n -> new LoadTwoTransformers(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LTT")), - Arguments.of("load_two_transformers_tap_changers_dyd", (Function) n -> new LoadTwoTransformersTapChangers(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LTTTC")) + Arguments.of("load_two_transformers_tap_changers_dyd", (Function) n -> new LoadTwoTransformersTapChangers(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LTTTC", "LoadTwoTransformersTapChangers")) ); } } diff --git a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/TapChangerAutomatonExceptionsXmlTest.java b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/TapChangerAutomatonExceptionsXmlTest.java index 3b2ed5133..d1bbe4d0a 100644 --- a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/TapChangerAutomatonExceptionsXmlTest.java +++ b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/TapChangerAutomatonExceptionsXmlTest.java @@ -62,7 +62,7 @@ private static Stream provideTapChangers() { Arguments.of(TransformerSide.HIGH_VOLTAGE, (Function) n -> new LoadOneTransformer(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LOT"), "LoadOneTransformer doesn't have a transformer side"), Arguments.of(TransformerSide.NONE, (Function) n -> new LoadOneTransformerTapChanger(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LOTTC"), "LoadOneTransformerTapChanger already have a tap changer"), Arguments.of(TransformerSide.NONE, (Function) n -> new LoadTwoTransformers(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LTT"), "LoadTwoTransformers must have a side connected to the Tap changer automaton"), - Arguments.of(TransformerSide.HIGH_VOLTAGE, (Function) n -> new LoadTwoTransformersTapChangers(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LTTTC"), "LoadTwoTransformersTapChangers already have a tap changer") + Arguments.of(TransformerSide.HIGH_VOLTAGE, (Function) n -> new LoadTwoTransformersTapChangers(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LTTTC", "LoadTwoTransformersTapChangers"), "LoadTwoTransformersTapChangers already have a tap changer") ); } } diff --git a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/TapChangerBlockingAutomatonXmlTest.java b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/TapChangerBlockingAutomatonXmlTest.java index a2be2a032..4ecfc2dc2 100644 --- a/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/TapChangerBlockingAutomatonXmlTest.java +++ b/dynawaltz/src/test/java/com/powsybl/dynawaltz/xml/TapChangerBlockingAutomatonXmlTest.java @@ -44,7 +44,7 @@ protected void setupNetwork() { protected void addDynamicModels() { dynamicModels.add(new TransformerFixedRatio("BBM_NGEN_NHV1", network.getTwoWindingsTransformer("NGEN_NHV1"), "transformer", "TransformerFixedRatio")); dynamicModels.add(new LoadOneTransformerTapChanger("BBM_LOAD", network.getLoad("LOAD"), "lot")); - dynamicModels.add(new LoadTwoTransformersTapChangers("BBM_LOAD2", network.getLoad("LOAD2"), "ltt")); + dynamicModels.add(new LoadTwoTransformersTapChangers("BBM_LOAD2", network.getLoad("LOAD2"), "ltt", "LoadTwoTransformersTapChangers")); dynamicModels.add(new TapChangerBlockingAutomaton("BBM_TapChangerBlocking", "TapChangerPar", network.getTwoWindingsTransformerStream().toList(), List.of(network.getLoad("LOAD"), network.getLoad("LOAD2")),