@Override protected NetworkImpl getNetwork() { return vl.getNetwork(); }
@Override protected NetworkImpl getNetwork() { return voltageLevel.getNetwork(); }
@Override protected NetworkImpl getNetwork() { return voltageLevel.getNetwork(); }
@Override protected NetworkImpl getNetwork() { return voltageLevel.getNetwork(); }
@Override protected NetworkImpl getNetwork() { return voltageLevel.getNetwork(); }
@Override protected NetworkImpl getNetwork() { return voltageLevel.getNetwork(); }
@Override protected NetworkImpl getNetwork() { return voltageLevel.getNetwork(); }
protected NetworkImpl getNetwork() { if (terminals.isEmpty()) { throw new PowsyblException(id + " is not attached to a network"); } return terminals.get(0).getVoltageLevel().getNetwork(); }
static void checkRegulatingTerminal(Validable validable, TerminalExt regulatingTerminal, NetworkImpl network) { if (regulatingTerminal != null && regulatingTerminal.getVoltageLevel().getNetwork() != network) { throw new ValidationException(validable, "regulating terminal is not part of the network"); } }
@Override public boolean isOpen() { return open.get(voltageLevel.getNetwork().getVariantIndex()); }
@Override public boolean isRetained() { return retained.get(voltageLevel.getNetwork().getVariantIndex()); }
@Override public Component getConnectedComponent() { checkValidity(); NetworkImpl.ConnectedComponentsManager ccm = voltageLevel.getNetwork().getConnectedComponentsManager(); ccm.update(); return terminals.isEmpty() ? null : ccm.getComponent(terminals.get(0).getConnectedComponentNumber()); }
@Override public Component getSynchronousComponent() { checkValidity(); NetworkImpl.SynchronousComponentsManager scm = voltageLevel.getNetwork().getSynchronousComponentsManager(); scm.update(); return terminals.isEmpty() ? null : scm.getComponent(terminals.get(0).getSynchronousComponentNumber()); }
@Override public void setFictitious(boolean fictitious) { boolean oldValue = this.fictitious; if (oldValue != fictitious) { this.fictitious = fictitious; voltageLevel.invalidateCache(); NetworkImpl network = voltageLevel.getNetwork(); network.getListeners().notifyUpdate(this, "fictitious", oldValue, fictitious); } }
public C setRegulationTerminal(Terminal regulationTerminal) { if (regulationTerminal == null) { throw new ValidationException(parent, "regulation terminal is null"); } if (((TerminalExt) regulationTerminal).getVoltageLevel().getNetwork() != getNetwork()) { throw new ValidationException(parent, "regulation terminal is not part of the network"); } this.regulationTerminal = (TerminalExt) regulationTerminal; return (C) this; }
@Override public Component getSynchronousComponent() { NetworkImpl.SynchronousComponentsManager scm = voltageLevel.getNetwork().getSynchronousComponentsManager(); scm.update(); return scm.getComponent(synchronousComponentNumber.get(network.get().getVariantIndex())); }
@Override public void setOpen(boolean open) { NetworkImpl network = voltageLevel.getNetwork(); int index = network.getVariantIndex(); boolean oldValue = this.open.get(index); if (oldValue != open) { this.open.set(index, open); voltageLevel.invalidateCache(); network.getListeners().notifyUpdate(this, "open", oldValue, open); } }
@Override public Component getConnectedComponent() { NetworkImpl.ConnectedComponentsManager ccm = voltageLevel.getNetwork().getConnectedComponentsManager(); ccm.update(); return ccm.getComponent(connectedComponentNumber.get(network.get().getVariantIndex())); }
SwitchImpl(VoltageLevelExt voltageLevel, String id, String name, SwitchKind kind, final boolean open, boolean retained, boolean fictitious) { super(id, name); this.voltageLevel = voltageLevel; this.kind = kind; this.fictitious = fictitious; int variantArraySize = voltageLevel.getNetwork().getVariantManager().getVariantArraySize(); this.open = new TBooleanArrayList(variantArraySize); this.retained = new TBooleanArrayList(variantArraySize); for (int i = 0; i < variantArraySize; i++) { this.open.add(open); this.retained.add(retained); } }
@Override public void setRetained(boolean retained) { if (voltageLevel.getTopologyKind() != TopologyKind.NODE_BREAKER) { throw new ValidationException(this, "retain status is not modifiable in a non node/breaker voltage level"); } NetworkImpl network = voltageLevel.getNetwork(); int index = network.getVariantIndex(); boolean oldValue = this.retained.get(index); if (oldValue != retained) { this.retained.set(index, retained); voltageLevel.invalidateCache(); network.getListeners().notifyUpdate(this, "retained", oldValue, retained); } }