Skip to content

Commit

Permalink
PiModel already tested at construction.
Browse files Browse the repository at this point in the history
Signed-off-by: Bertrand Rix <[email protected]>
  • Loading branch information
obrix committed Jan 27, 2025
1 parent 91da360 commit 579f2e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ public boolean apply(LfNetwork network, LfContingency contingency, LfNetworkPara
if (branch.getPhaseControl().isPresent()) {
LOGGER.warn("Phase tap changer tap position action: phase control is present on the tap changer, tap position could be overriden.");
}
if (branch.getPiModel() instanceof SimplePiModel) {
throw new UnsupportedOperationException("Tap position action: only one tap in branch " + branch.getId());
} else {
branch.getPiModel().setTapPosition(this.change.getNewTapPosition());
return true;
}
branch.getPiModel().setTapPosition(this.change.getNewTapPosition());
return true;
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ public boolean apply(LfNetwork network, LfContingency contingency, LfNetworkPara
if (branch.getVoltageControl().isPresent()) {
LOGGER.warn("Ratio tap changer tap position action: voltage control is present on the tap changer, tap position could be overriden.");
}
if (branch.getPiModel() instanceof SimplePiModel) {
throw new UnsupportedOperationException("Tap position action: only one tap in branch " + branch.getId());
} else {
branch.getPiModel().setTapPosition(this.change.getNewTapPosition());
return true;
}
branch.getPiModel().setTapPosition(this.change.getNewTapPosition());
return true;
}
return false;
}
Expand Down

0 comments on commit 579f2e9

Please sign in to comment.