Skip to content

Commit

Permalink
add hvdc lcc creation entity (#3)
Browse files Browse the repository at this point in the history
Signed-off-by: Rehili Ghazwa <[email protected]>
  • Loading branch information
ghazwarhili authored Dec 9, 2024
1 parent 8112014 commit da0b580
Show file tree
Hide file tree
Showing 9 changed files with 674 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public enum ModificationType {
TABULAR_CREATION(PreloadingStrategy.COLLECTION),
BY_FORMULA_MODIFICATION(PreloadingStrategy.COLLECTION),
MODIFICATION_BY_ASSIGNMENT(PreloadingStrategy.COLLECTION),
COMPOSITE_MODIFICATION(PreloadingStrategy.COLLECTION);
COMPOSITE_MODIFICATION(PreloadingStrategy.COLLECTION),
LCC_CONVERTER_STATION_CREATION(PreloadingStrategy.NONE),
LCC_CREATION(PreloadingStrategy.NONE);

private final PreloadingStrategy strategy;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ public enum Type {
TABULAR_CREATION_ERROR(HttpStatus.INTERNAL_SERVER_ERROR),
CREATE_VSC_ERROR(HttpStatus.INTERNAL_SERVER_ERROR),
MODIFY_VSC_ERROR(HttpStatus.INTERNAL_SERVER_ERROR),
CREATE_LCC_ERROR(HttpStatus.INTERNAL_SERVER_ERROR),
HVDC_LINE_ALREADY_EXISTS(HttpStatus.BAD_REQUEST),
VSC_CONVERTER_STATION_NOT_FOUND(HttpStatus.NOT_FOUND),
LCC_CONVERTER_STATION_NOT_FOUND(HttpStatus.NOT_FOUND),
CREATE_CONVERTER_STATION_ERROR(HttpStatus.INTERNAL_SERVER_ERROR),
MODIFY_CONVERTER_STATION_ERROR(HttpStatus.INTERNAL_SERVER_ERROR),
BY_FORMULA_MODIFICATION_ERROR(HttpStatus.INTERNAL_SERVER_ERROR),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* Copyright (c) 2024, 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.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.gridsuite.modification.dto.annotation.ModificationErrorTypeName;

import java.util.List;

/**
* @author Ghazwa Rehili <ghazwa.rehili at rte-france.com>
*/

@SuperBuilder
@NoArgsConstructor
@Getter
@Setter
@ToString(callSuper = true)
@Schema(description = "Lcc converter station creation")
@JsonTypeName("LCC_CONVERTER_STATION_CREATION")
@ModificationErrorTypeName("LCC_CREATE_CONVERTER_STATION_ERROR")
public class LccConverterStationCreationInfos extends InjectionCreationInfos {
@Builder
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public static class ShuntCompensatorInfos {
private String id;
private String name;
private Double maxQAtNominalV;
private Boolean connectedToHvdc;
}

@Schema(description = "Loss Factor")
private Float lossFactor;

@Schema(description = "Power Factor")
private Float powerFactor;

@Schema(description = "LCC HVDC Converter Station Shunt Compensator")
@JsonInclude(JsonInclude.Include.NON_NULL)
private List<ShuntCompensatorInfos> shuntCompensatorsOnSide;
}
69 changes: 69 additions & 0 deletions src/main/java/org/gridsuite/modification/dto/LccCreationInfos.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* Copyright (c) 2024, 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.dto;

import com.fasterxml.jackson.annotation.JsonTypeName;
import com.powsybl.commons.report.ReportNode;
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.dto.annotation.ModificationErrorTypeName;
import org.gridsuite.modification.modifications.AbstractModification;
import org.gridsuite.modification.modifications.LccCreation;

/**
* @author Ghazwa Rehili <ghazwa.rehili at rte-france.com>
*/

@SuperBuilder
@NoArgsConstructor
@Getter
@Setter
@ToString(callSuper = true)
@Schema(description = "LCC creation")
@JsonTypeName("LCC_CREATION")
@ModificationErrorTypeName("CREATE_LCC_ERROR")
public class LccCreationInfos extends EquipmentCreationInfos {
@Schema(description = "DC nominal voltage")
private Double nominalV;

@Schema(description = "DC resistance")
private Double r;

@Schema(description = "Maximum active power")
private Double maxP;

@Schema(description = "Converters mode")
private HvdcLine.ConvertersMode convertersMode;

@Schema(description = "Active power setpoint")
private Double activePowerSetpoint;

@Schema(description = "Converter station 1")
private LccConverterStationCreationInfos converterStation1;

@Schema(description = "Converter station 2")
private LccConverterStationCreationInfos converterStation2;

@Override
public AbstractModification toModification() {
return new LccCreation(this);
}

@Override
public ReportNode createSubReportNode(ReportNode reportNode) {
return reportNode.newReportNode()
.withMessageTemplate(getType().name(), "Lcc creation ${lccId}")
.withUntypedValue("lccId", getEquipmentId())
.add();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
@JsonSubTypes.Type(value = GenerationDispatchInfos.class),
@JsonSubTypes.Type(value = VoltageInitModificationInfos.class),
@JsonSubTypes.Type(value = VscCreationInfos.class),
@JsonSubTypes.Type(value = LccCreationInfos.class),
@JsonSubTypes.Type(value = LccConverterStationCreationInfos.class),
@JsonSubTypes.Type(value = ConverterStationCreationInfos.class),
@JsonSubTypes.Type(value = TabularModificationInfos.class),
@JsonSubTypes.Type(value = ByFormulaModificationInfos.class),
Expand Down
Loading

0 comments on commit da0b580

Please sign in to comment.