Skip to content

Commit

Permalink
Refactor RegulatingCondEq RegulatingControl SSH export (#2920).
Browse files Browse the repository at this point in the history
Signed-off-by: stojkovicn <nemanja.stojkovic@rte-france.com>
  • Loading branch information
stojkovicn committed May 9, 2024
1 parent 4869509 commit c07f7ef
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.powsybl.iidm.network.*;
import com.powsybl.iidm.network.extensions.ActivePowerControl;
import com.powsybl.iidm.network.extensions.ReferencePriority;
import com.powsybl.iidm.network.extensions.RemoteReactivePowerControl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -353,9 +354,21 @@ private static void addRegulatingControlView(Generator g, Map<String, List<Regul
// PowSyBl has considered the control as continuous and with targetDeadband of size 0
// The target value is stored in kV by PowSyBl, so unit multiplier is "k"
String rcid = context.getNamingStrategy().getCgmesIdFromProperty(g, REGULATING_CONTROL_PROPERTY);

double targetDeadband = 0;
double target;
String targetValueUnitMultiplier;
RemoteReactivePowerControl rrpc = g.getExtension(RemoteReactivePowerControl.class);
if (rrpc != null) {
target = rrpc.getTargetQ();
targetValueUnitMultiplier = "M";
} else {
target = g.getTargetV();
targetValueUnitMultiplier = "k";
}

RegulatingControlView rcv = new RegulatingControlView(rcid, RegulatingControlType.REGULATING_CONTROL, false,
g.isVoltageRegulatorOn(), targetDeadband, g.getTargetV(), "k");
g.isVoltageRegulatorOn(), targetDeadband, target, targetValueUnitMultiplier);
regulatingControlViews.computeIfAbsent(rcid, k -> new ArrayList<>()).add(rcv);
}
}
Expand Down Expand Up @@ -389,6 +402,7 @@ private static void writeStaticVarCompensators(Network network, String cimNamesp
// Regulating control could be reactive power or voltage
double targetValue;
String multiplier;
// FIXME: remove RegulationMode.OFF when #2790 is done
if (regulationMode == StaticVarCompensator.RegulationMode.VOLTAGE
|| regulationMode == StaticVarCompensator.RegulationMode.OFF && isValidSvcVolatgeSetpoint(svc.getVoltageSetpoint())) {
targetValue = svc.getVoltageSetpoint();
Expand Down

0 comments on commit c07f7ef

Please sign in to comment.