Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public class BatteryTabInfos extends ElementInfosWithProperties {
@JsonInclude(JsonInclude.Include.NON_NULL)
private Country country;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId;

@JsonInclude(JsonInclude.Include.NON_ABSENT)
private Optional<MeasurementsInfos> measurementP;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public class BusTabInfos extends ElementInfosWithProperties {
@JsonInclude(JsonInclude.Include.NON_NULL)
private Country country;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId;

@JsonInclude(JsonInclude.Include.NON_NULL)
private Map<String, String> substationProperties;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ public class BusBarSectionTabInfos extends ElementInfosWithProperties {

@JsonInclude(JsonInclude.Include.NON_NULL)
private Map<String, String> voltageLevelProperties;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public class DanglingLineTabInfos extends ElementInfosWithProperties {
@JsonInclude(JsonInclude.Include.NON_NULL)
private Country country;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId;

private Boolean terminalConnected;

@JsonInclude(JsonInclude.Include.NON_NULL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ public class HvdcTabInfos extends ElementInfosWithProperties {
@JsonInclude(JsonInclude.Include.NON_NULL)
private Country country2;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId1;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId2;

@JsonInclude(JsonInclude.Include.NON_NULL)
private Double activePowerSetpoint;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public class LccConverterStationTabInfos extends ElementInfosWithProperties {
@JsonInclude(JsonInclude.Include.NON_NULL)
private Country country;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId;

private Boolean terminalConnected;

private String hvdcLineId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public class LineTabInfos extends ElementInfosWithProperties {
@JsonInclude(JsonInclude.Include.NON_NULL)
private Country country2;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId1;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId2;

private Boolean terminal1Connected;

private Boolean terminal2Connected;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public class LoadTabInfos extends ElementInfosWithProperties {
@JsonInclude(JsonInclude.Include.NON_NULL)
private Country country;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId;

private Double nominalVoltage;

private Boolean terminalConnected;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public class ShuntCompensatorTabInfos extends ElementInfosWithProperties {
@JsonInclude(JsonInclude.Include.NON_NULL)
private Country country;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId;

private Boolean terminalConnected;

@JsonInclude(JsonInclude.Include.NON_NULL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public class StaticVarCompensatorTabInfos extends ElementInfosWithProperties {
@JsonInclude(JsonInclude.Include.NON_NULL)
private Country country;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId;

private Boolean terminalConnected;

private StaticVarCompensator.RegulationMode regulationMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public class ThreeWindingsTransformerTabInfos extends ElementInfosWithProperties
@JsonInclude(JsonInclude.Include.NON_NULL)
private Country country;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId;

private Boolean terminal1Connected;

private Boolean terminal2Connected;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ public class TieLineTabInfos extends ElementInfosWithProperties {
@JsonInclude(JsonInclude.Include.NON_NULL)
private Country country2;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId1;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId2;

private Boolean terminal1Connected;

private Boolean terminal2Connected;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public class TwoWindingsTransformerTabInfos extends ElementInfosWithProperties {
@JsonInclude(JsonInclude.Include.NON_NULL)
private Country country;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId;

private Boolean terminal1Connected;

private Boolean terminal2Connected;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public class VscConverterStationTabInfos extends ElementInfosWithProperties {
@JsonInclude(JsonInclude.Include.NON_NULL)
private Country country;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String substationId;

private Boolean terminalConnected;

private String hvdcLineId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ private static BatteryTabInfos toTabInfos(Identifiable<?> identifiable) {
.voltageLevelId(terminal.getVoltageLevel().getId())
.nominalVoltage(terminal.getVoltageLevel().getNominalV())
.country(mapCountry(terminal.getVoltageLevel().getSubstation().orElse(null)))
.substationId(terminal.getVoltageLevel().getSubstation().map(Substation::getId).orElse(null))
.targetP(battery.getTargetP())
.targetQ(nullIfNan(battery.getTargetQ()))
.minP(battery.getMinP())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public static BusBarSectionTabInfos toTabInfos(Identifiable<?> identifiable) {
.name(busbarSection.getOptionalName().orElse(null))
.properties(getProperties(busbarSection))
.voltageLevelId(busbarSection.getTerminal().getVoltageLevel().getId())
.substationId(busbarSection.getTerminal().getVoltageLevel().getSubstation().map(Substation::getId).orElse(null))
.measurementV(toMeasurement(busbarSection, Measurement.Type.VOLTAGE, 0))
.measurementAngle(toMeasurement(busbarSection, Measurement.Type.ANGLE, 0))
.voltageLevelProperties(getProperties(terminal.getVoltageLevel()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.powsybl.iidm.network.Bus;
import com.powsybl.iidm.network.Identifiable;
import com.powsybl.iidm.network.Substation;
import org.gridsuite.network.map.dto.ElementInfos;
import org.gridsuite.network.map.dto.InfoTypeParameters;
import org.gridsuite.network.map.dto.definition.bus.BusTabInfos;
Expand Down Expand Up @@ -43,6 +44,7 @@ public static BusTabInfos toTabInfos(Identifiable<?> identifiable) {
.voltageLevelId(bus.getVoltageLevel().getId())
.nominalVoltage(bus.getVoltageLevel().getNominalV())
.country(mapCountry(bus.getVoltageLevel().getSubstation().orElse(null)))
.substationId(bus.getVoltageLevel().getSubstation().map(Substation::getId).orElse(null))
.synchronousComponentNum(bus.getSynchronousComponent().getNum())
.properties(getProperties(bus))
.connectedComponentNum(bus.getConnectedComponent().getNum())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.powsybl.iidm.network.DanglingLine;
import com.powsybl.iidm.network.Identifiable;
import com.powsybl.iidm.network.Substation;
import com.powsybl.iidm.network.Terminal;
import com.powsybl.iidm.network.extensions.Measurement;
import org.gridsuite.network.map.dto.ElementInfos;
Expand Down Expand Up @@ -45,6 +46,7 @@ private static DanglingLineTabInfos toTabInfos(Identifiable<?> identifiable) {
.voltageLevelId(terminal.getVoltageLevel().getId())
.nominalV(terminal.getVoltageLevel().getNominalV())
.country(mapCountry(terminal.getVoltageLevel().getSubstation().orElse(null)))
.substationId(terminal.getVoltageLevel().getSubstation().map(Substation::getId).orElse(null))
.pairingKey(danglingLine.getPairingKey())
.p0(danglingLine.getP0())
.properties(getProperties(danglingLine))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ protected static HvdcTabInfos toHvdcTabInfos(Identifiable<?> identifiable) {
.voltageLevelId2(terminal2.getVoltageLevel().getId())
.country1(mapCountry(terminal1.getVoltageLevel().getSubstation().orElse(null)))
.country2(mapCountry(terminal2.getVoltageLevel().getSubstation().orElse(null)))
.substationId1(terminal1.getVoltageLevel().getSubstation().map(Substation::getId).orElse(null))
.substationId2(terminal2.getVoltageLevel().getSubstation().map(Substation::getId).orElse(null))
.i1(nullIfNan(terminal1.getI()))
.i2(nullIfNan(terminal2.getI()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.powsybl.iidm.network.Identifiable;
import com.powsybl.iidm.network.LccConverterStation;
import com.powsybl.iidm.network.Substation;
import com.powsybl.iidm.network.Terminal;
import com.powsybl.iidm.network.extensions.Measurement;
import org.gridsuite.network.map.dto.ElementInfos;
Expand Down Expand Up @@ -50,6 +51,7 @@ private static LccConverterStationTabInfos toTabInfos(Identifiable<?> identifiab
.voltageLevelId(terminal.getVoltageLevel().getId())
.nominalV(terminal.getVoltageLevel().getNominalV())
.country(mapCountry(terminal.getVoltageLevel().getSubstation().orElse(null)))
.substationId(terminal.getVoltageLevel().getSubstation().map(Substation::getId).orElse(null))
.terminalConnected(terminal.isConnected())
.lossFactor(lccConverterStation.getLossFactor())
.properties(getProperties(lccConverterStation))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ private static LineTabInfos toTabInfos(Identifiable<?> identifiable, Double dcPo
.nominalVoltage2(terminal2.getVoltageLevel().getNominalV())
.country1(mapCountry(terminal1.getVoltageLevel().getSubstation().orElse(null)))
.country2(mapCountry(terminal2.getVoltageLevel().getSubstation().orElse(null)))
.substationId1(terminal1.getVoltageLevel().getSubstation().map(Substation::getId).orElse(null))
.substationId2(terminal2.getVoltageLevel().getSubstation().map(Substation::getId).orElse(null))
.p1(nullIfNan(terminal1.getP()))
.q1(nullIfNan(terminal1.getQ()))
.i1(nullIfNan(ElementUtils.computeIntensity(terminal1, dcPowerFactor)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.powsybl.iidm.network.Identifiable;
import com.powsybl.iidm.network.Load;
import com.powsybl.iidm.network.Substation;
import com.powsybl.iidm.network.Terminal;
import com.powsybl.iidm.network.extensions.Measurement;
import org.gridsuite.network.map.dto.ElementInfos;
Expand Down Expand Up @@ -79,6 +80,7 @@ private static LoadTabInfos toTabInfos(Identifiable<?> identifiable) {
.voltageLevelId(terminal.getVoltageLevel().getId())
.nominalVoltage(terminal.getVoltageLevel().getNominalV())
.country(mapCountry(terminal.getVoltageLevel().getSubstation().orElse(null)))
.substationId(terminal.getVoltageLevel().getSubstation().map(Substation::getId).orElse(null))
.p0(load.getP0())
.properties(getProperties(load))
.q0(load.getQ0());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ private static ShuntCompensatorTabInfos toTabInfos(Identifiable<?> identifiable)
.voltageLevelId(terminal.getVoltageLevel().getId())
.nominalVoltage(terminal.getVoltageLevel().getNominalV())
.properties(getProperties(shuntCompensator))
.country(mapCountry(terminal.getVoltageLevel().getSubstation().orElse(null)));
.country(mapCountry(terminal.getVoltageLevel().getSubstation().orElse(null)))
.substationId(terminal.getVoltageLevel().getSubstation().map(Substation::getId).orElse(null));

Double bPerSection = null;
if (shuntCompensator.getModel() instanceof ShuntCompensatorLinearModel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.powsybl.iidm.network.Identifiable;
import com.powsybl.iidm.network.StaticVarCompensator;
import com.powsybl.iidm.network.Substation;
import com.powsybl.iidm.network.Terminal;
import com.powsybl.iidm.network.extensions.Measurement;
import org.gridsuite.network.map.dto.ElementInfos;
Expand Down Expand Up @@ -76,6 +77,7 @@ private static StaticVarCompensatorTabInfos toTabInfos(Identifiable<?> identifia
.voltageLevelId(terminal.getVoltageLevel().getId())
.nominalV(terminal.getVoltageLevel().getNominalV())
.country(mapCountry(terminal.getVoltageLevel().getSubstation().orElse(null)))
.substationId(terminal.getVoltageLevel().getSubstation().map(Substation::getId).orElse(null))
.properties(getProperties(staticVarCompensator))
.regulationMode(staticVarCompensator.getRegulationMode());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.gridsuite.network.map.dto.utils.ElementUtils;

import java.util.List;
import java.util.Optional;

import static org.gridsuite.network.map.dto.utils.ElementUtils.*;

Expand Down Expand Up @@ -79,7 +80,8 @@ private static ThreeWindingsTransformerTabInfos toTabInfos(Identifiable<?> ident
.nominalV1(terminal1.getVoltageLevel().getNominalV())
.nominalV2(terminal2.getVoltageLevel().getNominalV())
.nominalV3(terminal3.getVoltageLevel().getNominalV())
.country(mapCountry(firstSubstationFound));
.country(mapCountry(firstSubstationFound))
.substationId(Optional.ofNullable(firstSubstationFound).map(Substation::getId).orElse(null));

if (!Double.isNaN(terminal1.getP())) {
builder.p1(terminal1.getP());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.gridsuite.network.map.dto.mapper;

import com.powsybl.iidm.network.Identifiable;
import com.powsybl.iidm.network.Substation;
import com.powsybl.iidm.network.Terminal;
import com.powsybl.iidm.network.TieLine;
import org.gridsuite.network.map.dto.ElementInfos;
Expand Down Expand Up @@ -79,6 +80,8 @@ private static TieLineTabInfos toTabInfos(Identifiable<?> identifiable, Double d
.nominalVoltage2(terminal2.getVoltageLevel().getNominalV())
.country1(mapCountry(terminal1.getVoltageLevel().getSubstation().orElse(null)))
.country2(mapCountry(terminal2.getVoltageLevel().getSubstation().orElse(null)))
.substationId1(terminal1.getVoltageLevel().getSubstation().map(Substation::getId).orElse(null))
.substationId2(terminal2.getVoltageLevel().getSubstation().map(Substation::getId).orElse(null))
.p1(nullIfNan(terminal1.getP()))
.q1(nullIfNan(terminal1.getQ()))
.p2(nullIfNan(terminal2.getP()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ private static TwoWindingsTransformerTabInfos toTabInfos(Identifiable<?> identif
.voltageLevelName2(terminal2.getVoltageLevel().getOptionalName().orElse(null))
.nominalVoltage2(terminal2.getVoltageLevel().getNominalV())
.country(mapCountry(firstSubstationFound))
.substationId(Optional.ofNullable(firstSubstationFound).map(Substation::getId).orElse(null))
.phaseTapChanger(toMapData(twoWT.getPhaseTapChanger()))
.ratioTapChanger(toMapData(twoWT.getRatioTapChanger()))
.r(twoWT.getR())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private static VscConverterStationTabInfos toTabInfos(Identifiable<?> identifiab
.voltageLevelId(terminal.getVoltageLevel().getId())
.nominalV(terminal.getVoltageLevel().getNominalV())
.country(mapCountry(terminal.getVoltageLevel().getSubstation().orElse(null)))
.substationId(terminal.getVoltageLevel().getSubstation().map(Substation::getId).orElse(null))
.terminalConnected(terminal.isConnected())
.lossFactor(vscConverterStation.getLossFactor())
.properties(getProperties(vscConverterStation))
Expand Down
3 changes: 3 additions & 0 deletions src/test/resources/2-windings-transformers-tab-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"voltageLevelName2": null,
"nominalVoltage2": 380.0,
"country": "FR",
"substationId": "P1",
"terminal1Connected": true,
"terminal2Connected": true,
"p1": 11.1,
Expand Down Expand Up @@ -118,6 +119,7 @@
"voltageLevelId2": "VLLOAD",
"voltageLevelName2": null,
"nominalVoltage2": 150.0,
"substationId": "P2",
"terminal1Connected": true,
"terminal2Connected": true,
"p1": 5.5,
Expand Down Expand Up @@ -189,6 +191,7 @@
"voltageLevelName2": null,
"nominalVoltage2": 380.0,
"country": "FR",
"substationId": "P1",
"terminal1Connected": true,
"terminal2Connected": true,
"operationalLimitsGroup1": {
Expand Down
3 changes: 3 additions & 0 deletions src/test/resources/3-windings-transformers-tab-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"voltageLevelId3": "VLGEN",
"nominalV3": 24.0,
"country": "FR",
"substationId": "P1",
"terminal1Connected": true,
"terminal2Connected": true,
"terminal3Connected": true,
Expand Down Expand Up @@ -171,6 +172,7 @@
"voltageLevelId3": "VLGEN",
"nominalV3": 24.0,
"country": "FR",
"substationId": "P1",
"terminal1Connected": true,
"terminal2Connected": true,
"terminal3Connected": true,
Expand Down Expand Up @@ -333,6 +335,7 @@
"voltageLevelId3": "VLGEN",
"nominalV3": 24.0,
"country": "FR",
"substationId": "P1",
"terminal1Connected": true,
"terminal2Connected": true,
"terminal3Connected": true,
Expand Down
Loading