Skip to content

Commit

Permalink
Fix SVarC static references when standByAutomaton is not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
gautierbureau committed Oct 18, 2023
1 parent 5f03058 commit 49a9832
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.powsybl.dynawaltz.models.VarMapping;
import com.powsybl.dynawaltz.models.buses.BusModel;
import com.powsybl.dynawaltz.models.utils.BusUtils;
import com.powsybl.iidm.network.extensions.StandbyAutomaton;

import java.util.Arrays;
import java.util.List;
Expand All @@ -25,8 +26,7 @@ public class StaticVarCompensator extends AbstractEquipmentBlackBoxModel<com.pow
private static final List<VarMapping> VAR_MAPPING = Arrays.asList(
new VarMapping("SVarC_injector_PInjPu", "p"),
new VarMapping("SVarC_injector_QInjPu", "q"),
new VarMapping("SVarC_injector_state", "state"),
new VarMapping("SVarC_modeHandling_mode_value", "regulatingMode"));
new VarMapping("SVarC_injector_state", "state"));

public StaticVarCompensator(String dynamicModelId, com.powsybl.iidm.network.StaticVarCompensator svarc, String parameterSetId, String lib) {
super(dynamicModelId, parameterSetId, svarc, lib);
Expand All @@ -43,6 +43,10 @@ private List<VarConnection> getVarConnectionsWithBus(BusModel connected) {

@Override
public List<VarMapping> getVarsMapping() {
StandbyAutomaton standbyAutomaton = equipment.getExtension(StandbyAutomaton.class);
if (standbyAutomaton != null) {
VAR_MAPPING.add(new VarMapping("SVarC_modeHandling_mode_value", "regulatingMode"));
}
return VAR_MAPPING;
}

Expand Down
1 change: 0 additions & 1 deletion dynawaltz/src/test/resources/svarc_dyd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<dyn:staticRef var="SVarC_injector_PInjPu" staticVar="p"/>
<dyn:staticRef var="SVarC_injector_QInjPu" staticVar="q"/>
<dyn:staticRef var="SVarC_injector_state" staticVar="state"/>
<dyn:staticRef var="SVarC_modeHandling_mode_value" staticVar="regulatingMode"/>
</dyn:macroStaticReference>
<dyn:macroConnect connector="MC_StaticVarCompensator-DefaultBus" id1="BBM_SVARC2" id2="NETWORK" name2="B2"/>
</dyn:dynamicModelsArchitecture>

0 comments on commit 49a9832

Please sign in to comment.