Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check Hvdc vsc static type #326

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,14 @@ private static Stream<Arguments> provideWarningsModel() {
'uMeasurements' field value 'GEN' not found for equipment type(s) LOAD/TWO_WINDINGS_TRANSFORMER
'transformers' list is empty
Model ZAB cannot be instantiated
"""),
Arguments.of("/warnings/hvdcVscWrongStaticType.groovy", HvdcTestNetwork.createLcc(),
"""
+ DSL tests
+ Groovy Dynamic Models Supplier
+ DSL model builder for HvdcVSC
'staticId' field value 'L' not found for equipment type(s) VSC HVDC_LINE
Model BBM_HVDC cannot be instantiated
""")
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Copyright (c) 2024, RTE (http://www.rte-france.com/)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* SPDX-License-Identifier: MPL-2.0
*/

package warnings


HvdcVSC {
dynamicModelId "BBM_HVDC"
parameterSetId "hvdc"
staticId "L"
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ protected AbstractEquipmentModelBuilder(Network network, ModelConfig modelConfig
this.builderEquipment = new BuilderEquipment<>(equipmentType);
}

protected AbstractEquipmentModelBuilder(Network network, ModelConfig modelConfig, String equipmentType, Reporter reporter) {
super(network, reporter);
this.modelConfig = modelConfig;
this.builderEquipment = new BuilderEquipment<>(equipmentType);
}

public R staticId(String staticId) {
builderEquipment.addEquipment(staticId, this::findEquipment);
return self();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ public abstract class AbstractHvdcBuilder<R extends AbstractEquipmentModelBuilde

protected TwoSides danglingSide;

protected AbstractHvdcBuilder(Network network, ModelConfig modelConfig, Reporter reporter) {
super(network, modelConfig, IdentifiableType.HVDC_LINE, reporter);
protected AbstractHvdcBuilder(Network network, ModelConfig modelConfig, IdentifiableType identifiableType, Reporter reporter) {
super(network, modelConfig, identifiableType, reporter);
}

protected AbstractHvdcBuilder(Network network, ModelConfig modelConfig, String equipmentType, Reporter reporter) {
super(network, modelConfig, equipmentType, reporter);
}

public R dangling(TwoSides danglingSide) {
Expand All @@ -41,9 +45,4 @@ protected void checkData() {
isInstantiable = false;
}
}

@Override
protected HvdcLine findEquipment(String staticId) {
return network.getHvdcLine(staticId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import com.powsybl.dynawaltz.builders.ModelConfig;
import com.powsybl.dynawaltz.builders.ModelConfigs;
import com.powsybl.dynawaltz.builders.Reporters;
import com.powsybl.iidm.network.HvdcLine;
import com.powsybl.iidm.network.IdentifiableType;
import com.powsybl.iidm.network.Network;

import java.util.Map;
Expand Down Expand Up @@ -50,7 +52,7 @@ public static Set<String> getSupportedLibs() {
}

protected HvdcPBuilder(Network network, ModelConfig modelConfig, Reporter reporter) {
super(network, modelConfig, reporter);
super(network, modelConfig, IdentifiableType.HVDC_LINE, reporter);
}

@Override
Expand All @@ -65,6 +67,11 @@ public HvdcP build() {
return null;
}

@Override
protected HvdcLine findEquipment(String staticId) {
return network.getHvdcLine(staticId);
}

@Override
protected HvdcPBuilder self() {
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
import com.powsybl.dynawaltz.builders.ModelConfig;
import com.powsybl.dynawaltz.builders.ModelConfigs;
import com.powsybl.dynawaltz.builders.Reporters;
import com.powsybl.iidm.network.HvdcConverterStation;
import com.powsybl.iidm.network.HvdcLine;
import com.powsybl.iidm.network.IdentifiableType;
import com.powsybl.iidm.network.Network;

import java.util.Map;
Expand Down Expand Up @@ -50,7 +53,7 @@ public static Set<String> getSupportedLibs() {
}

protected HvdcVscBuilder(Network network, ModelConfig modelConfig, Reporter reporter) {
super(network, modelConfig, reporter);
super(network, modelConfig, "VSC " + IdentifiableType.HVDC_LINE, reporter);
}

@Override
Expand All @@ -65,6 +68,12 @@ public HvdcVsc build() {
return null;
}

@Override
protected HvdcLine findEquipment(String staticId) {
HvdcLine line = network.getHvdcLine(staticId);
return HvdcConverterStation.HvdcType.VSC == line.getConverterStation1().getHvdcType() ? line : null;
}

@Override
protected HvdcVscBuilder self() {
return this;
Expand Down
Loading