private void setIdEraseName(String id) { objectStore.remove(this); this.id = id; name = null; // reset the name objectStore.checkAndAdd(this); }
private void removeAllSwitches() { for (SwitchImpl s : graph.getEdgesObject()) { getNetwork().getObjectStore().remove(s); } graph.removeAllEdges(); switches.clear(); }
private void removeAllSwitches() { for (SwitchImpl s : graph.getEdgesObject()) { getNetwork().getObjectStore().remove(s); } graph.removeAllEdges(); switches.clear(); }
private 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); getNetwork().getObjectStore().remove(aSwitch); }
@Override public void remove() { NetworkImpl network = getNetwork(); network.getObjectStore().remove(this); network.getListeners().notifyRemoval(this); }
otherNetwork.objectStore.remove(otherNetwork);
@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); }
private void removeBus(String busId) { ConfiguredBus bus = getBus(busId, true); if (bus.getTerminalCount() > 0) { throw new ValidationException(this, "Cannot remove bus " + bus.getId() + " because of connectable equipments"); } // TODO improve check efficency for (Map.Entry<String, Integer> entry : switches.entrySet()) { String switchId = entry.getKey(); int e = entry.getValue(); int v1 = graph.getEdgeVertex1(e); int v2 = graph.getEdgeVertex2(e); ConfiguredBus b1 = graph.getVertexObject(v1); ConfiguredBus b2 = graph.getVertexObject(v2); if (bus == b1 || bus == b2) { throw new PowsyblException("Cannot remove bus '" + bus.getId() + "' because switch '" + switchId + "' is connected to it"); } } getNetwork().getObjectStore().remove(bus); int v = buses.remove(bus.getId()); graph.removeVertex(v); }
@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 void remove() { VoltageLevels.checkRemovability(this); // Remove all connectables List<Connectable> connectables = Lists.newArrayList(getConnectables()); for (Connectable connectable : connectables) { connectable.remove(); } // Remove the topology removeTopology(); // Remove this voltage level from the network getSubstation().remove(this); getNetwork().getObjectStore().remove(this); getNetwork().getListeners().notifyRemoval(this); }
@Override public void remove() { Substations.checkRemovability(this); Set<VoltageLevelExt> vls = new HashSet<>(voltageLevels); for (VoltageLevelExt vl : vls) { // Remove all branches, transformers and HVDC lines List<Connectable> connectables = Lists.newArrayList(vl.getConnectables()); for (Connectable connectable : connectables) { ConnectableType type = connectable.getType(); if (VoltageLevels.MULTIPLE_TERMINALS_CONNECTABLE_TYPES.contains(type)) { connectable.remove(); } else if (type == ConnectableType.HVDC_CONVERTER_STATION) { HvdcLine hvdcLine = getNetwork().getHvdcLine((HvdcConverterStation) connectable); if (hvdcLine != null) { hvdcLine.remove(); } } } // Then remove the voltage level (bus, switches and injections) from the network vl.remove(); } // Remove this substation from the network getNetwork().getObjectStore().remove(this); getNetwork().getListeners().notifyRemoval(this); }
private void removeAllBuses() { if (graph.getEdgeCount() > 0) { throw new ValidationException(this, "Cannot remove all buses because there is still some switches"); } for (ConfiguredBus bus : graph.getVerticesObj()) { if (bus.getTerminalCount() > 0) { throw new ValidationException(this, "Cannot remove bus " + bus.getId() + " because of connected equipments"); } } for (ConfiguredBus bus : graph.getVerticesObj()) { getNetwork().getObjectStore().remove(bus); } graph.removeAllVertices(); buses.clear(); }