@Override public GeneratorImpl setMinP(double minP) { ValidationUtil.checkMinP(this, minP); ValidationUtil.checkActiveLimits(this, minP, maxP); double oldValue = this.minP; this.minP = minP; notifyUpdate("minP", oldValue, minP); return this; }
@Override public TwoWindingsTransformerImpl setB(double b) { ValidationUtil.checkB(this, b); double oldValue = this.b; this.b = b; notifyUpdate("b", oldValue, b); return this; }
@Override public LineImpl setB1(double b1) { ValidationUtil.checkB1(this, b1); double oldValue = this.b1; this.b1 = b1; notifyUpdate("b1", oldValue, b1); return this; }
@Override public GeneratorImpl setMaxP(double maxP) { ValidationUtil.checkMaxP(this, maxP); ValidationUtil.checkActiveLimits(this, minP, maxP); double oldValue = this.maxP; this.maxP = maxP; notifyUpdate("maxP", oldValue, maxP); return this; }
@Override public GeneratorImpl add() { String id = checkAndGetUniqueId(); TerminalExt terminal = checkAndGetTerminal(); ValidationUtil.checkEnergySource(this, energySource); ValidationUtil.checkMinP(this, minP); ValidationUtil.checkMaxP(this, maxP); ValidationUtil.checkRegulatingTerminal(this, regulatingTerminal, getNetwork()); ValidationUtil.checkActivePowerSetpoint(this, targetP); ValidationUtil.checkVoltageControl(this, voltageRegulatorOn, targetV, targetQ); ValidationUtil.checkActiveLimits(this, minP, maxP); ValidationUtil.checkRatedS(this, ratedS); GeneratorImpl generator = new GeneratorImpl(getNetwork().getRef(), id, getName(), energySource, minP, maxP, voltageRegulatorOn, regulatingTerminal != null ? regulatingTerminal : terminal, targetP, targetQ, targetV, ratedS); generator.addTerminal(terminal); voltageLevel.attach(terminal, false); getNetwork().getObjectStore().checkAndAdd(generator); getNetwork().getListeners().notifyCreation(generator); return generator; }
@Override public DanglingLineImpl add() { String id = checkAndGetUniqueId(); TerminalExt terminal = checkAndGetTerminal(); ValidationUtil.checkP0(this, p0); ValidationUtil.checkQ0(this, q0); ValidationUtil.checkR(this, r); ValidationUtil.checkX(this, x); ValidationUtil.checkG(this, g); ValidationUtil.checkB(this, b); DanglingLineImpl danglingLine = new DanglingLineImpl(getNetwork().getRef(), id, getName(), p0, q0, r, x, g, b, ucteXnodeCode); danglingLine.addTerminal(terminal); voltageLevel.attach(terminal, false); getNetwork().getObjectStore().checkAndAdd(danglingLine); getNetwork().getListeners().notifyCreation(danglingLine); return danglingLine; }
@Override public LineImpl add() { String id = checkAndGetUniqueId(); VoltageLevelExt voltageLevel1 = checkAndGetVoltageLevel1(); VoltageLevelExt voltageLevel2 = checkAndGetVoltageLevel2(); TerminalExt terminal1 = checkAndGetTerminal1(); TerminalExt terminal2 = checkAndGetTerminal2(); ValidationUtil.checkR(this, r); ValidationUtil.checkX(this, x); ValidationUtil.checkG1(this, g1); ValidationUtil.checkG2(this, g2); ValidationUtil.checkB1(this, b1); ValidationUtil.checkB2(this, b2); // check that the line is attachable on both side voltageLevel1.attach(terminal1, true); voltageLevel2.attach(terminal2, true); LineImpl line = new LineImpl(id, getName(), r, x, g1, b1, g2, b2); terminal1.setNum(1); terminal2.setNum(2); line.addTerminal(terminal1); line.addTerminal(terminal2); voltageLevel1.attach(terminal1, false); voltageLevel2.attach(terminal2, false); network.getObjectStore().checkAndAdd(line); getNetwork().getListeners().notifyCreation(line); return line; }
TerminalExt terminal2 = checkAndGetTerminal2(); ValidationUtil.checkR(this, r); ValidationUtil.checkX(this, x); ValidationUtil.checkG(this, g); ValidationUtil.checkB(this, b); ValidationUtil.checkRatedU1(this, ratedU1); ValidationUtil.checkRatedU2(this, ratedU2);
@Override public HvdcLine add() { String id = checkAndGetUniqueId(); String name = getName(); ValidationUtil.checkR(this, r); ValidationUtil.checkConvertersMode(this, convertersMode); ValidationUtil.checkNominalV(this, nominalV); ValidationUtil.checkActivePowerSetpoint(this, activePowerSetpoint); ValidationUtil.checkMaxP(this, maxP); AbstractHvdcConverterStation<?> converterStation1 = getNetwork().getHvdcConverterStation(converterStationId1); if (converterStation1 == null) { throw new PowsyblException("Side 1 converter station " + converterStationId1 + " not found"); } AbstractHvdcConverterStation<?> converterStation2 = getNetwork().getHvdcConverterStation(converterStationId2); if (converterStation2 == null) { throw new PowsyblException("Side 2 converter station " + converterStationId2 + " not found"); } HvdcLineImpl hvdcLine = new HvdcLineImpl(id, name, r, nominalV, maxP, convertersMode, activePowerSetpoint, converterStation1, converterStation2, networkRef); getNetwork().getObjectStore().checkAndAdd(hvdcLine); getNetwork().getListeners().notifyCreation(hvdcLine); return hvdcLine; }
@Override public StaticVarCompensatorImpl add() { String id = checkAndGetUniqueId(); String name = getName(); TerminalExt terminal = checkAndGetTerminal(); ValidationUtil.checkBmin(this, bMin); ValidationUtil.checkBmax(this, bMax); ValidationUtil.checkSvcRegulator(this, voltageSetPoint, reactivePowerSetPoint, regulationMode); StaticVarCompensatorImpl svc = new StaticVarCompensatorImpl(id, name, bMin, bMax, voltageSetPoint, reactivePowerSetPoint, regulationMode, getNetwork().getRef()); svc.addTerminal(terminal); vl.attach(terminal, false); getNetwork().getObjectStore().checkAndAdd(svc); getNetwork().getListeners().notifyCreation(svc); return svc; }
@Override public SubstationImpl setCountry(Country country) { ValidationUtil.checkCountry(this, country); Country oldValue = this.country; this.country = country; getNetwork().getListeners().notifyUpdate(this, "country", oldValue.toString(), country.toString()); return this; }
@Override public HvdcLineImpl setActivePowerSetpoint(double activePowerSetpoint) { ValidationUtil.checkActivePowerSetpoint(this, activePowerSetpoint); double oldValue = this.activePowerSetpoint.set(getNetwork().getVariantIndex(), activePowerSetpoint); notifyUpdate("activePowerSetpoint", oldValue, activePowerSetpoint); return this; }
@Override public StaticVarCompensatorImpl setBmin(double bMin) { ValidationUtil.checkBmin(this, bMin); this.bMin = bMin; return this; }
@Override public StaticVarCompensatorImpl setBmax(double bMax) { ValidationUtil.checkBmax(this, bMax); this.bMax = bMax; return this; }
@Override public NetworkImpl setCaseDate(DateTime caseDate) { ValidationUtil.checkCaseDate(this, caseDate); this.caseDate = caseDate; return this; }
@Override public LineImpl setB2(double b2) { ValidationUtil.checkB2(this, b2); double oldValue = this.b2; this.b2 = b2; notifyUpdate("b2", oldValue, b2); return this; }
@Override public HvdcLineImpl setConvertersMode(ConvertersMode convertersMode) { ValidationUtil.checkConvertersMode(this, convertersMode); int variantIndex = getNetwork().getVariantIndex(); boolean oldValue = this.convertersMode.get(variantIndex); this.convertersMode.set(variantIndex, fromEnum(Objects.requireNonNull(convertersMode))); notifyUpdate("convertersMode", toEnum(oldValue), convertersMode); return this; }
@Override public Substation add() { String id = checkAndGetUniqueId(); ValidationUtil.checkCountry(this, country); SubstationImpl substation = new SubstationImpl(id, getName(), country, tso, networkRef); if (tags != null) { for (String tag : tags) { substation.addGeographicalTag(tag); } } getNetwork().getObjectStore().checkAndAdd(substation); getNetwork().getListeners().notifyCreation(substation); return substation; }
@Override public GeneratorImpl setTargetP(double targetP) { ValidationUtil.checkActivePowerSetpoint(this, targetP); double oldValue = this.targetP.set(getNetwork().getVariantIndex(), targetP); notifyUpdate("targetP", oldValue, targetP); return this; }
@Override public DanglingLineImpl setB(double b) { ValidationUtil.checkB(this, b); double oldValue = this.b; this.b = b; notifyUpdate("b", oldValue, b); return this; }