@Override public BusbarSection add() { String id = checkAndGetUniqueId(); TerminalExt terminal = new NodeTerminal(getNetwork().getRef(), node); BusbarSectionImpl section = new BusbarSectionImpl(id, getName()); section.addTerminal(terminal); voltageLevel.attach(terminal, false); getNetwork().getObjectStore().checkAndAdd(section); getNetwork().getListeners().notifyCreation(section); return section; }
@Override public void invalidateCache() { variants.get().calculatedBusBreakerTopology.invalidateCache(); variants.get().calculatedBusTopology.invalidateCache(); getNetwork().getConnectedComponentsManager().invalidate(); }
@Override public void remove() { NetworkImpl network = getNetwork(); network.getObjectStore().remove(this); for (TerminalExt terminal : terminals) { VoltageLevelExt vl = terminal.getVoltageLevel(); vl.detach(terminal); vl.clean(); } network.getListeners().notifyRemoval(this); }
protected TerminalExt checkAndGetTerminal2() { return new TerminalBuilder(getNetwork().getRef(), this) .setNode(node2) .setBus(bus2) .setConnectableBus(connectableBus2) .build(); }
protected TerminalExt checkAndGetTerminal() { return new TerminalBuilder(getNetwork().getRef(), this) .setNode(node) .setBus(bus) .setConnectableBus(connectableBus) .build(); }
@Override public void remove() { NetworkImpl network = getNetwork(); network.getObjectStore().remove(this); network.getListeners().notifyRemoval(this); }
@Override public void invalidateCache() { calculatedBusTopology.invalidateCache(); getNetwork().getConnectedComponentsManager().invalidate(); getNetwork().getSynchronousComponentsManager().invalidate(); }
@Override public PhaseTapChangerImpl setRegulationTerminal(Terminal regulationTerminal) { ValidationUtil.checkPhaseTapChangerRegulation(parent, regulationMode, getRegulationValue(), isRegulating(), regulationTerminal, getNetwork()); return super.setRegulationTerminal(regulationTerminal); }
@Override public void reduceVariantArraySize(int number) { super.reduceVariantArraySize(number); if (leg2.getRatioTapChanger() != null) { leg2.getRatioTapChanger().reduceVariantArraySize(number); } if (leg3.getRatioTapChanger() != null) { leg3.getRatioTapChanger().reduceVariantArraySize(number); } }
@Override public void allocateVariantArrayElement(int[] indexes, int sourceIndex) { super.allocateVariantArrayElement(indexes, sourceIndex); if (leg2.getRatioTapChanger() != null) { leg2.getRatioTapChanger().allocateVariantArrayElement(indexes, sourceIndex); } if (leg3.getRatioTapChanger() != null) { leg3.getRatioTapChanger().allocateVariantArrayElement(indexes, sourceIndex); } }
@Override public CurrentLimits add() { ValidationUtil.checkPermanentLimit(owner, permanentLimit); checkTemporaryLimits(); CurrentLimitsImpl limits = new CurrentLimitsImpl(permanentLimit, temporaryLimits, owner); owner.setCurrentLimits(side, limits); return limits; }
private void checkTerminal(TerminalExt terminal) { if (!(terminal instanceof BusTerminal)) { throw new ValidationException(terminal.getConnectable(), "voltage level " + BusBreakerVoltageLevel.this.id + " has a bus/breaker topology" + ", a bus connection should be specified instead of a node connection"); } // check connectable buses exist String connectableBusId = ((BusTerminal) terminal).getConnectableBusId(); if (connectableBusId != null) { getBus(connectableBusId, true); } }
@Override public RatioTapChangerImpl setRegulating(boolean regulating) { ValidationUtil.checkRatioTapChangerRegulation(parent, loadTapChangingCapabilities, regulating, regulationTerminal, getTargetV(), getNetwork()); return super.setRegulating(regulating); }
protected VoltageLevelExt checkAndGetVoltageLevel1() { if (voltageLevelId1 == null) { throw new ValidationException(this, "first voltage level is not set"); } VoltageLevelExt voltageLevel1 = getNetwork().getVoltageLevel(voltageLevelId1); if (voltageLevel1 == null) { throw new ValidationException(this, "first voltage level '" + voltageLevelId1 + "' not found"); } return voltageLevel1; }
@Override public void allocateVariantArrayElement(int[] indexes, int sourceIndex) { super.allocateVariantArrayElement(indexes, sourceIndex); if (ratioTapChanger != null) { ratioTapChanger.allocateVariantArrayElement(indexes, sourceIndex); } if (phaseTapChanger != null) { phaseTapChanger.allocateVariantArrayElement(indexes, sourceIndex); } }
NodeBreakerVoltageLevel(String id, String name, SubstationImpl substation, double nominalV, double lowVoltageLimit, double highVoltageLimit) { super(id, name, substation, nominalV, lowVoltageLimit, highVoltageLimit); variants = new VariantArray<>(substation.getNetwork().getRef(), VariantImpl::new); }
private void invalidateCache() { // detach buses if (variants.get().cache != null) { for (MergedBus bus : variants.get().cache.getMergedBuses()) { bus.invalidate(); } variants.get().cache = null; } }
@Override public boolean disconnect(TerminalExt terminal) { assert terminal instanceof BusTerminal; // already connected? if (!terminal.isConnected()) { return false; } ((BusTerminal) terminal).setConnected(false); // invalidate connected components invalidateCache(); return true; }
@Override public TieLineAdderImpl setId(String id) { if (activeHalf == null) { return super.setId(id); } else { getActiveHalf().setId(id); } return this; }
protected VoltageLevelExt checkAndGetVoltageLevel2() { if (voltageLevelId2 == null) { throw new ValidationException(this, "second voltage level is not set"); } VoltageLevelExt voltageLevel2 = getNetwork().getVoltageLevel(voltageLevelId2); if (voltageLevel2 == null) { throw new ValidationException(this, "second voltage level '" + voltageLevelId2 + "' not found"); } return voltageLevel2; }