@Override public SubstationImpl setTso(String tso) { String oldValue = this.tso; this.tso = tso; getNetwork().getListeners().notifyUpdate(this, "tso", oldValue, tso); return this; }
protected void notifyUpdate(String attribute, Object oldValue, Object newValue) { network.get().getListeners().notifyUpdate(this, attribute, oldValue, newValue); }
protected void notifyUpdate(String attribute, Object oldValue, Object newValue) { getNetwork().getListeners().notifyUpdate(this, attribute, oldValue, newValue); }
private void notifyUpdate(String attribute, Object oldValue, Object newValue) { getNetwork().getListeners().notifyUpdate(this, attribute, oldValue, newValue); }
protected void notifyUpdate(String attribute, Object oldValue, Object newValue) { getNetwork().getListeners().notifyUpdate(this, attribute, oldValue, newValue); }
@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); } }
@Override public void remove() { NetworkImpl network = getNetwork(); network.getObjectStore().remove(this); network.getListeners().notifyRemoval(this); }
@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 ConfiguredBus add() { String id = checkAndGetUniqueId(); ConfiguredBusImpl bus = new ConfiguredBusImpl(id, voltageLevel); voltageLevel.addBus(bus); getNetwork().getListeners().notifyCreation(bus); return bus; }
@Override public void removeSwitch(String switchId) { Integer e = switches.remove(switchId); if (e == null) { throw new PowsyblException("Switch '" + switchId + "' not found in substation voltage level '" + id + "'"); } SwitchImpl aSwitch = graph.removeEdge(e); clean(); getNetwork().getObjectStore().remove(aSwitch); getNetwork().getListeners().notifyRemoval(aSwitch); }
@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 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); }
@Override public Switch add() { String id = checkAndGetUniqueId(); if (busId1 == null) { throw new ValidationException(this, "first connection bus is not set"); } if (busId2 == null) { throw new ValidationException(this, "second connection bus is not set"); } SwitchImpl aSwitch = new SwitchImpl(BusBreakerVoltageLevel.this, id, getName(), SwitchKind.BREAKER, open, true, fictitious); addSwitch(aSwitch, busId1, busId2); getNetwork().getListeners().notifyCreation(aSwitch); return aSwitch; }
@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); } }
public C setTapPosition(int tapPosition) { if (tapPosition < lowTapPosition || tapPosition > getHighTapPosition()) { throw new ValidationException(parent, "incorrect tap position " + tapPosition + " [" + lowTapPosition + ", " + getHighTapPosition() + "]"); } int oldValue = this.tapPosition.set(network.get().getVariantIndex(), tapPosition); parent.getNetwork().getListeners().notifyUpdate(parent.getTransformer(), getTapChangerAttribute() + ".tapPosition", oldValue, tapPosition); return (C) 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 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 LccConverterStation add() { String id = checkAndGetUniqueId(); String name = getName(); TerminalExt terminal = checkAndGetTerminal(); validate(); LccConverterStationImpl converterStation = new LccConverterStationImpl(id, name, getLossFactor(), powerFactor); converterStation.addTerminal(terminal); getVoltageLevel().attach(terminal, false); getNetwork().getObjectStore().checkAndAdd(converterStation); getNetwork().getListeners().notifyCreation(converterStation); return converterStation; }
@Override public VscConverterStationImpl add() { String id = checkAndGetUniqueId(); String name = getName(); TerminalExt terminal = checkAndGetTerminal(); validate(); VscConverterStationImpl converterStation = new VscConverterStationImpl(id, name, getLossFactor(), getNetwork().getRef(), voltageRegulatorOn, reactivePowerSetpoint, voltageSetpoint); converterStation.addTerminal(terminal); getVoltageLevel().attach(terminal, false); getNetwork().getObjectStore().checkAndAdd(converterStation); getNetwork().getListeners().notifyCreation(converterStation); return converterStation; }
@Override public LoadImpl add() { String id = checkAndGetUniqueId(); TerminalExt terminal = checkAndGetTerminal(); ValidationUtil.checkLoadType(this, loadType); ValidationUtil.checkP0(this, p0); ValidationUtil.checkQ0(this, q0); LoadImpl load = new LoadImpl(getNetwork().getRef(), id, getName(), loadType, p0, q0); load.addTerminal(terminal); voltageLevel.attach(terminal, false); getNetwork().getObjectStore().checkAndAdd(load); getNetwork().getListeners().notifyCreation(load); return load; }