private Void readHvdcLine(String[] tokens) { int num = Integer.parseInt(tokens[1]); String converterMode = tokens[2].replace("\"", ""); double targetP = readDouble(tokens[3]); String id = mapper.getId(AmplSubset.HVDC_LINE, num); HvdcLine hl = network.getHvdcLine(id); if (hl == null) { throw new AmplException("Invalid HvdcLine id '" + id + "'"); } hl.setConvertersMode(ConvertersMode.valueOf(converterMode)); hl.setActivePowerSetpoint(targetP); return null; }
/** * Throw a {@link com.powsybl.commons.PowsyblException} if this voltage level contains at least one {@link Branch} or * one {@link ThreeWindingsTransformer} or one {@link HvdcConverterStation}. */ static void checkRemovability(VoltageLevel voltageLevel) { Network network = voltageLevel.getSubstation().getNetwork(); for (Connectable connectable : voltageLevel.getConnectables()) { ConnectableType type = connectable.getType(); if (MULTIPLE_TERMINALS_CONNECTABLE_TYPES.contains(type)) { // Reject lines, 2WT and 3WT throw new AssertionError("The voltage level '" + voltageLevel.getId() + "' cannot be removed because of a remaining " + type); } else if ((type == ConnectableType.HVDC_CONVERTER_STATION) && (network.getHvdcLine((HvdcConverterStation) connectable) != null)) { // Reject all converter stations connected to a HVDC line throw new AssertionError("The voltage level '" + voltageLevel.getId() + "' cannot be removed because of a remaining HVDC line"); } } } }
private static void checkRemovability(Substation substation, HvdcConverterStation station) { HvdcLine hvdcLine = substation.getNetwork().getHvdcLine(station); if (hvdcLine != null) { Substation s1 = hvdcLine.getConverterStation1().getTerminal().getVoltageLevel().getSubstation(); Substation s2 = hvdcLine.getConverterStation2().getTerminal().getVoltageLevel().getSubstation(); if ((s1 != substation) || (s2 != substation)) { throw createIsolationException(substation); } } }