-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Seddik Yengui <[email protected]>
- Loading branch information
1 parent
5eff596
commit f1e53ce
Showing
13 changed files
with
1,117 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/main/java/org/gridsuite/modification/server/dto/ConverterStationCreationInfos.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* Copyright (c) 2023, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package org.gridsuite.modification.server.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonTypeName; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
import lombok.experimental.SuperBuilder; | ||
import org.gridsuite.modification.server.dto.annotation.ModificationErrorTypeName; | ||
import org.gridsuite.modification.server.entities.equipment.creation.ConverterStationCreationEntity; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Seddik Yengui <seddik.yengui at rte-france.com> | ||
*/ | ||
|
||
@SuperBuilder | ||
@NoArgsConstructor | ||
@Getter | ||
@Setter | ||
@ToString(callSuper = true) | ||
@Schema(description = "Converter station creation") | ||
@JsonTypeName("CONVERTER_STATION_CREATION") | ||
@ModificationErrorTypeName("CREATE_CONVERTER_STATION_ERROR") | ||
public class ConverterStationCreationInfos extends InjectionCreationInfos implements ReactiveLimitsHolderInfos { | ||
@Schema(description = "Loss Factor") | ||
private Float lossFactor; | ||
|
||
@Schema(description = "Reactive power") | ||
private Double reactivePower; | ||
|
||
@Schema(description = "Voltage regulation") | ||
private Boolean voltageRegulationOn; | ||
|
||
@Schema(description = "Voltage") | ||
private Double voltage; | ||
|
||
@Schema(description = "Reactive capability curve") | ||
private Boolean reactiveCapabilityCurve; | ||
|
||
@Schema(description = "Minimum reactive power") | ||
private Double minimumReactivePower; | ||
|
||
@Schema(description = "Maximum reactive power") | ||
private Double maximumReactivePower; | ||
|
||
@Schema(description = "Reactive capability curve points") | ||
private List<ReactiveCapabilityCurveCreationInfos> reactiveCapabilityCurvePoints; | ||
|
||
@Override | ||
public ConverterStationCreationEntity toEntity() { | ||
return new ConverterStationCreationEntity(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
src/main/java/org/gridsuite/modification/server/dto/VscCreationInfos.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/** | ||
* Copyright (c) 2023, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package org.gridsuite.modification.server.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonTypeName; | ||
import com.powsybl.commons.reporter.Reporter; | ||
import com.powsybl.commons.reporter.ReporterModel; | ||
import com.powsybl.iidm.network.HvdcLine; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
import lombok.experimental.SuperBuilder; | ||
import org.gridsuite.modification.server.dto.annotation.ModificationErrorTypeName; | ||
import org.gridsuite.modification.server.entities.equipment.creation.VscCreationEntity; | ||
import org.gridsuite.modification.server.modifications.AbstractModification; | ||
import org.gridsuite.modification.server.modifications.VscCreation; | ||
|
||
/** | ||
* @author Seddik Yengui <seddik.yengui at rte-france.com> | ||
*/ | ||
|
||
@SuperBuilder | ||
@NoArgsConstructor | ||
@Getter | ||
@Setter | ||
@ToString(callSuper = true) | ||
@Schema(description = "VSC creation") | ||
@JsonTypeName("VSC_CREATION") | ||
@ModificationErrorTypeName("CREATE_VSC_ERROR") | ||
public class VscCreationInfos extends EquipmentCreationInfos { | ||
@Schema(description = "DC nominal voltage") | ||
private Double dcNominalVoltage; | ||
|
||
@Schema(description = "DC resistance") | ||
private Double dcResistance; | ||
|
||
@Schema(description = "Maximum active power ") | ||
private Double maximumActivePower; | ||
|
||
@Schema(description = "Operator active power limit (Side1->Side2)") | ||
private Float operatorActivePowerLimitFromSide1ToSide2; | ||
|
||
@Schema(description = "Operator active power limit (Side2->Side1)") | ||
private Float operatorActivePowerLimitFromSide2ToSide1; | ||
|
||
@Schema(description = "Converters mode") | ||
private HvdcLine.ConvertersMode convertersMode; | ||
|
||
@Schema(description = "Active power") | ||
private Double activePower; | ||
|
||
@Schema(description = "Angle droop active power control ") | ||
private Boolean angleDroopActivePowerControl; | ||
|
||
@Schema(description = "p0") | ||
private Float p0; | ||
|
||
@Schema(description = "droop") | ||
private Float droop; | ||
|
||
@Schema(description = "Converter station 1") | ||
private ConverterStationCreationInfos converterStation1; | ||
|
||
@Schema(description = "Converter station 2") | ||
private ConverterStationCreationInfos converterStation2; | ||
|
||
@Override | ||
public VscCreationEntity toEntity() { | ||
return new VscCreationEntity(this); | ||
} | ||
|
||
@Override | ||
public AbstractModification toModification() { | ||
return new VscCreation(this); | ||
} | ||
|
||
@Override | ||
public Reporter createSubReporter(ReporterModel reporter) { | ||
return reporter.createSubReporter(getType().name(), "Vsc creation ${vscId}", "vscId", this.getEquipmentId()); | ||
} | ||
} |
126 changes: 126 additions & 0 deletions
126
...suite/modification/server/entities/equipment/creation/ConverterStationCreationEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
/** | ||
* Copyright (c) 2023, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package org.gridsuite.modification.server.entities.equipment.creation; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.gridsuite.modification.server.dto.ConverterStationCreationInfos; | ||
import org.gridsuite.modification.server.dto.ReactiveCapabilityCurveCreationInfos; | ||
|
||
import javax.persistence.CollectionTable; | ||
import javax.persistence.Column; | ||
import javax.persistence.ElementCollection; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
import java.util.List; | ||
import java.util.UUID; | ||
import java.util.stream.Collectors; | ||
|
||
/** | ||
* @author Seddik Yengui <seddik.yengui at rte-france.com> | ||
*/ | ||
|
||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Getter | ||
@Entity | ||
@Table(name = "converterStationCreation") | ||
public class ConverterStationCreationEntity extends InjectionCreationEntity { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
@Column(name = "id") | ||
private UUID id; | ||
|
||
@Column | ||
private Float lossFactor; | ||
|
||
@Column | ||
private Double minimumReactivePower; | ||
|
||
@Column | ||
private Double maximumReactivePower; | ||
|
||
@Column | ||
private Double reactivePower; | ||
|
||
@Column | ||
private Boolean voltageRegulationOn; | ||
|
||
@Column | ||
private Double voltage; | ||
|
||
@ElementCollection | ||
@CollectionTable(name = "converter_station_creation_rcc_points") | ||
private List<ReactiveCapabilityCurveCreationEmbeddable> reactiveCapabilityCurvePoints; | ||
|
||
@Column | ||
private Boolean reactiveCapabilityCurve; | ||
|
||
public ConverterStationCreationEntity(ConverterStationCreationInfos converterStationCreationInfos) { | ||
super(converterStationCreationInfos); | ||
assignAttributes(converterStationCreationInfos); | ||
} | ||
|
||
private void assignAttributes(ConverterStationCreationInfos converterStationCreationInfos) { | ||
this.lossFactor = converterStationCreationInfos.getLossFactor(); | ||
this.minimumReactivePower = converterStationCreationInfos.getMinimumReactivePower(); | ||
this.maximumReactivePower = converterStationCreationInfos.getMaximumReactivePower(); | ||
this.reactivePower = converterStationCreationInfos.getReactivePower(); | ||
this.voltageRegulationOn = converterStationCreationInfos.getVoltageRegulationOn(); | ||
this.voltage = converterStationCreationInfos.getVoltage(); | ||
this.reactiveCapabilityCurvePoints = toEmbeddablePoints(converterStationCreationInfos.getReactiveCapabilityCurvePoints()); | ||
this.reactiveCapabilityCurve = converterStationCreationInfos.getReactiveCapabilityCurve(); | ||
} | ||
|
||
public ConverterStationCreationInfos toConverterStationInfos() { | ||
return ConverterStationCreationInfos.builder() | ||
.equipmentId(getEquipmentId()) | ||
.equipmentName(getEquipmentName()) | ||
.lossFactor(getLossFactor()) | ||
.minimumReactivePower(getMinimumReactivePower()) | ||
.maximumReactivePower(getMaximumReactivePower()) | ||
.reactivePower(getReactivePower()) | ||
.voltageRegulationOn(getVoltageRegulationOn()) | ||
.voltage(getVoltage()) | ||
.reactiveCapabilityCurvePoints(toReactiveCapabilityCurveInfos(getReactiveCapabilityCurvePoints())) | ||
.voltageLevelId(getVoltageLevelId()) | ||
.busOrBusbarSectionId(getBusOrBusbarSectionId()) | ||
.connectionName(getConnectionName()) | ||
.connectionPosition(getConnectionPosition()) | ||
.connectionDirection(getConnectionDirection()) | ||
.reactiveCapabilityCurve(getReactiveCapabilityCurve()) | ||
.build(); | ||
} | ||
|
||
private static List<ReactiveCapabilityCurveCreationEmbeddable> toEmbeddablePoints( | ||
List<ReactiveCapabilityCurveCreationInfos> points) { | ||
return points == null ? null : points.stream() | ||
.map(point -> new ReactiveCapabilityCurveCreationEmbeddable(point.getQminP(), | ||
point.getQmaxP(), | ||
point.getP())) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
private static List<ReactiveCapabilityCurveCreationInfos> toReactiveCapabilityCurveInfos(List<ReactiveCapabilityCurveCreationEmbeddable> pointsEmbeddable) { | ||
if (pointsEmbeddable == null) { | ||
return null; | ||
} | ||
|
||
return pointsEmbeddable.stream() | ||
.map(pointEmbeddable -> ReactiveCapabilityCurveCreationInfos.builder() | ||
.p(pointEmbeddable.getP()) | ||
.qmaxP(pointEmbeddable.getQmaxP()) | ||
.qminP(pointEmbeddable.getQminP()) | ||
.build()) | ||
.collect(Collectors.toList()); | ||
} | ||
} |
Oops, something went wrong.